mirror of
				https://github.com/sinatra/sinatra
				synced 2023-03-27 23:18:01 -04:00 
			
		
		
		
	initial commit
This commit is contained in:
		
						commit
						0985552f33
					
				
					 21 changed files with 333 additions and 0 deletions
				
			
		
							
								
								
									
										37
									
								
								rack-protection/Rakefile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								rack-protection/Rakefile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,37 @@
 | 
			
		|||
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  require 'bundler'
 | 
			
		||||
  Bundler::GemHelper.install_tasks
 | 
			
		||||
rescue LoadError => e
 | 
			
		||||
  $stderr.puts e
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
desc "run specs"
 | 
			
		||||
task(:spec) { ruby '-S rspec spec' }
 | 
			
		||||
 | 
			
		||||
desc "generate gemspec"
 | 
			
		||||
task 'rack-protection.gemspec' do
 | 
			
		||||
  require 'rack/protection/version'
 | 
			
		||||
  content = File.read 'rack-protection.gemspec'
 | 
			
		||||
 | 
			
		||||
  fields = {
 | 
			
		||||
    :authors => `git shortlog -sn`.scan(/[^\d\s].*/),
 | 
			
		||||
    :email   => `git shortlog -sne`.scan(/[^<]+@[^>]+/),
 | 
			
		||||
    :files   => `git ls-files`.split("\n").reject { |f| f =~ /^(\.|Gemfile)/ }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  fields.each do |field, values|
 | 
			
		||||
    updated = "  s.#{field} = ["
 | 
			
		||||
    updated << values.map { |v| "\n    %p" % v }.join(',')
 | 
			
		||||
    updated << "\n  ]"
 | 
			
		||||
    content.sub!(/  s\.#{field} = \[\n(    .*\n)*  \]/, updated)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  content.sub! /(s\.version.*=\s+).*/, "\\1\"#{Rack::Protection::VERSION}\""
 | 
			
		||||
  File.open('rack-protection.gemspec', 'w') { |f| f << content }
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
task :gemspec => 'rack-protection.gemspec'
 | 
			
		||||
task :default => :spec
 | 
			
		||||
task :test    => :spec
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue