diff --git a/VERSION.yml b/VERSION.yml index 52fe98dc..9a1b2266 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,5 +1,5 @@ --- :minor: 18 -:patch: 0 +:patch: 1 :build: :major: 1 diff --git a/backports.gemspec b/backports.gemspec index 0bbf3e20..1e1d0a33 100644 --- a/backports.gemspec +++ b/backports.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = %q{backports} - s.version = "1.18.0" + s.version = "1.18.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Marc-Andr\303\251 Lafortune"] - s.date = %q{2010-06-19} + s.date = %q{2010-06-24} s.description = %q{ Essential backports that enable some of the really nice features of ruby 1.8.7, ruby 1.9 and rails from ruby 1.8.6 and earlier. } s.email = %q{github@marc-andre.ca} diff --git a/lib/backports/1.8.7/string.rb b/lib/backports/1.8.7/string.rb index c8b9b7bc..57c24417 100644 --- a/lib/backports/1.8.7/string.rb +++ b/lib/backports/1.8.7/string.rb @@ -2,11 +2,6 @@ class String # Standard in Ruby 1.8.7+. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html] Backports.alias_method self, :bytesize, :length - # Standard in Ruby 1.8.7+. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html] - def chr - chars.first - end unless method_defined? :chr - Backports.make_block_optional self, :each_byte, :each_line, :test_on => "abc" # Standard in Ruby 1.8.7+. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html] diff --git a/lib/backports/1.9.1/string.rb b/lib/backports/1.9.1/string.rb index cf99de73..6f9ea840 100644 --- a/lib/backports/1.9.1/string.rb +++ b/lib/backports/1.9.1/string.rb @@ -5,6 +5,11 @@ def ascii_only? !(self =~ /[^\x00-\x7f]/) end unless method_defined? :ascii_only? + # Standard in Ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html] + def chr + chars.first || "" + end unless method_defined? :chr + # Standard in Ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html] def clear self[0,length] = ""