Sha256: 2fa2a92e22decf998863500e66bc5f4732697bdf0c953aa5188766d4bc13efa5

Contents?: true

Size: 1.32 KB

Versions: 79

Compression:

Stored size: 1.32 KB

Contents

# encoding: utf-8
$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.binread 'rack-protection.gemspec'

  # fetch data
  fields = {
    :authors => `git shortlog -sn`.force_encoding('utf-8').scan(/[^\d\s].*/),
    :email   => `git shortlog -sne`.force_encoding('utf-8').scan(/[^<]+@[^>]+/),
    :files   => `git ls-files`.force_encoding('utf-8').split("\n").reject { |f| f =~ /^(\.|Gemfile)/ }
  }

  # double email :(
  fields[:email].delete("konstantin.haase@gmail.com")

  # insert data
  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

  # set version
  content.sub! /(s\.version.*=\s+).*/, "\\1\"#{Rack::Protection::VERSION}\""

  # escape unicode
  content.gsub!(/./) { |c| c.bytesize > 1 ? "\\u{#{c.codepoints.first.to_s(16)}}" : c }

  File.open('rack-protection.gemspec', 'w') { |f| f << content }
end

task :gemspec => 'rack-protection.gemspec'
task :default => :spec
task :test    => :spec

Version data entries

79 entries across 74 versions & 21 rubygems

Version Path
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/rack-protection-1.5.3/Rakefile
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/rack-protection-1.5.3/Rakefile
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/rack-protection-1.5.5/Rakefile
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/rack-protection-1.5.5/Rakefile
rack-protection-1.5.5 Rakefile
rack-protection-1.5.4 Rakefile
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/rack-protection-1.5.3/Rakefile
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/rack-protection-1.5.3/Rakefile
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/rack-protection-1.5.3/Rakefile