diff --git a/rack-protection/Rakefile b/rack-protection/Rakefile index b8ee58b3..78adeaf5 100644 --- a/rack-protection/Rakefile +++ b/rack-protection/Rakefile @@ -1,3 +1,4 @@ +# encoding: utf-8 $LOAD_PATH.unshift File.expand_path('../lib', __FILE__) begin @@ -15,12 +16,14 @@ task 'rack-protection.gemspec' do require 'rack/protection/version' content = File.read 'rack-protection.gemspec' + # fetch data fields = { :authors => `git shortlog -sn`.scan(/[^\d\s].*/), :email => `git shortlog -sne`.scan(/[^<]+@[^>]+/), :files => `git ls-files`.split("\n").reject { |f| f =~ /^(\.|Gemfile)/ } } + # insert data fields.each do |field, values| updated = " s.#{field} = [" updated << values.map { |v| "\n %p" % v }.join(',') @@ -28,7 +31,12 @@ task 'rack-protection.gemspec' do 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 diff --git a/rack-protection/lib/rack/protection/version.rb b/rack-protection/lib/rack/protection/version.rb index a3d80489..040b0954 100644 --- a/rack-protection/lib/rack/protection/version.rb +++ b/rack-protection/lib/rack/protection/version.rb @@ -4,7 +4,7 @@ module Rack VERSION end - SIGNATURE = [1, 3, 1] + SIGNATURE = [1, 3, 2] VERSION = SIGNATURE.join('.') VERSION.extend Comparable diff --git a/rack-protection/rack-protection.gemspec b/rack-protection/rack-protection.gemspec index 5ee64568..0d5567c6 100644 --- a/rack-protection/rack-protection.gemspec +++ b/rack-protection/rack-protection.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| # general infos s.name = "rack-protection" - s.version = "1.3.1" + s.version = "1.3.2" s.description = "You should use protection!" s.homepage = "http://github.com/rkh/rack-protection" s.summary = s.description @@ -23,7 +23,7 @@ Gem::Specification.new do |s| "Steve Agalloco", "Akzhan Abdulin", "TOBY", - "Bjørge Næss" + "Bj\u{f8}rge N\u{e6}ss" ] # generated from git shortlog -sne