backports 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ The goal of 'backports' is to make it easier to write ruby code that runs across
10
10
 
11
11
  require 'backports'
12
12
 
13
- This will bring in all the features of 1.8.7 (for Ruby 1.8.6) and many features of Ruby 1.9.1 (for Ruby 1.8.x), Ruby 1.9.2 and Ruby 1.9.3 (for all earlier versions)!
13
+ This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x and even Ruby 2.0.0 (for all versions of Ruby)!
14
14
 
15
15
  +Note+: Although I am a Ruby committer, this gem is a personal project and is not endorsed by ruby-core.
16
16
 
@@ -25,7 +25,7 @@ Let's be a bit more precise about the breaking code business. It is of course en
25
25
 
26
26
  A real incompatibility is, for example, <tt>Module::instance_methods</tt> which returns strings in 1.8 and symbols in 1.9. No change can be made without the risk of breaking existing code. Such incompatibilities are left unchanged, although you can require some of these changes in addition (see below)
27
27
 
28
- All features of 1.8.7 are backported (well, almost all, see the exception list bellow), and many of 1.9 are also. Some features of 2.0.0 are backported, but not loaded until a final version of Ruby 2.0.0 is released.
28
+ All features of 1.8.7 are backported (well, almost all, see the exception list bellow), and many of 1.9 are also. Some features of 2.0.0 are backported too.
29
29
 
30
30
  Some generic and self-contained features of active-support are also included. By simple I mean that String#camelcase is there, but #pluralize isn't.
31
31
 
@@ -46,7 +46,7 @@ Compatible with Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2, 1.9.3, JRuby and Rubinius.
46
46
 
47
47
  == Ruby 1.8.7
48
48
 
49
- Complete Ruby 1.8.7 backporting (core language). Refer to the official list of changes[http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7/NEWS].
49
+ Complete Ruby 1.8.7 backporting (core language). Refer to the official list of changes[https://github.com/ruby/ruby/blob/ruby_1_8_7/NEWS].
50
50
 
51
51
  Only exceptions:
52
52
  * String#gsub (the form returning an enumerator)
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Backports::VERSION
9
9
  gem.authors = ["Marc-André Lafortune"]
10
10
  gem.email = ["github@marc-andre.ca"]
11
- gem.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.}
12
- gem.summary = %q{Backports of Ruby features for older ruby.}
11
+ gem.description = %q{Essential backports that enable many of the nice features of Ruby 1.8.7 up to 2.0.0 for earlier versions.}
12
+ gem.summary = %q{Backports of Ruby features for older Ruby.}
13
13
  gem.homepage = "http://github.com/marcandre/backports"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
@@ -1,16 +1,20 @@
1
1
  class Hash
2
2
  def to_h
3
3
  self
4
- end unless method_defined :to_h
4
+ end unless method_defined? :to_h
5
5
 
6
- def default_proc_with_nil=(proc)
7
- if proc == nil
8
- self.default = nil
9
- self
10
- else
11
- self.default_proc_without_nil=(proc)
6
+ begin
7
+ {}.default_proc = nil
8
+ rescue
9
+ def default_proc_with_nil=(proc)
10
+ if proc == nil
11
+ self.default = nil
12
+ self
13
+ else
14
+ self.default_proc_without_nil=(proc)
15
+ end
12
16
  end
13
- end if ({}.default_proc = nil rescue true)
17
+ end
14
18
  end
15
19
 
16
- Backports.alias_method(ENV, :to_h, :to_hash)
20
+ Backports.alias_method(ENV.singleton_class, :to_h, :to_hash)
@@ -1,3 +1,3 @@
1
1
  module Backports
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backports
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,8 +11,8 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-02-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: Essential backports that enable some of the really nice features of ruby
15
- 1.8.7, ruby 1.9 and rails from ruby 1.8.6 and earlier.
14
+ description: Essential backports that enable many of the nice features of Ruby 1.8.7
15
+ up to 2.0.0 for earlier versions.
16
16
  email:
17
17
  - github@marc-andre.ca
18
18
  executables: []
@@ -155,7 +155,7 @@ rubyforge_project:
155
155
  rubygems_version: 1.8.24
156
156
  signing_key:
157
157
  specification_version: 3
158
- summary: Backports of Ruby features for older ruby.
158
+ summary: Backports of Ruby features for older Ruby.
159
159
  test_files:
160
160
  - test/README
161
161
  - test/std_lib_loading_test.rb