backports 3.3.5 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7da093a04f20685d90b76d07f7398d4decfc2469
4
+ data.tar.gz: d64740047dfc70000974538b0a330bd1ffc79483
5
+ SHA512:
6
+ metadata.gz: 16c0b340e43e79bc6215c22a5943495f63cb7e4961aad2c15bd2120d68dcf0c30868277e49a105c8728e269d125a9eb0194ec23ba5764aa5d64d3d1cc1f96db9
7
+ data.tar.gz: 1175d551ee9fb1d2efef7e033a09c04bed75423e5378092e5448c9fa9d3ece568f6f9e7ed9dd1c954de331b97f84867e97fadb09cb9d3e53be98b4e10a71c817
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,10 @@
1
1
  = Backports --- History
2
2
 
3
+ == Version 3.4.0 - December 29th, 2013
4
+
5
+ * Additional features of 2.1.0
6
+ * Array#to_h, Enumerable#to_h
7
+
3
8
  == Version 3.3.0 - April 3rd, 2013
4
9
 
5
10
  * Moved `Proc#yield` & `Hash#key` from 1.8.7 to 1.9.1
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- backports (3.3.4)
10
+ backports (3.3.5)
11
11
 
12
12
  GEM
13
13
  remote: http://rubygems.org/
data/README.rdoc CHANGED
@@ -65,7 +65,7 @@ With bundler, add to your Gemfile:
65
65
 
66
66
  Run <tt>bundle install</tt> and require the desired backports.
67
67
 
68
- Compatible with Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2, 1.9.3, JRuby and Rubinius.
68
+ Compatible with Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2, 1.9.3, 2.0.0, JRuby and Rubinius.
69
69
 
70
70
  = Complete List of backports
71
71
 
@@ -240,6 +240,15 @@ Some features of Ruby 2.0.0 have been backported:
240
240
 
241
241
  To include all Ruby backports but not those of Rails, <tt>require "backports/2.0"</tt> (or "backports/2.0.0")
242
242
 
243
+ == Ruby 2.1.0
244
+
245
+ Some features of Ruby 2.1.0 have been backported:
246
+
247
+ * Array
248
+ * +to_h+
249
+ * Enumerable
250
+ * +to_h+
251
+
243
252
  == Rails
244
253
 
245
254
  Some generic methods from Rails methods have been copied:
data/lib/backports.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  require "backports/tools"
2
2
  require "backports/version"
3
- require "backports/2.0"
3
+ require "backports/2.1"
4
4
  require "backports/rails"
@@ -0,0 +1,3 @@
1
+ # require this file to load all the backports up to Ruby 2.1.0
2
+ require 'backports/2.0'
3
+ Backports.require_relative_dir
@@ -0,0 +1,3 @@
1
+ require 'backports/tools'
2
+
3
+ Backports.require_relative_dir
@@ -0,0 +1,2 @@
1
+ # No need to specialize it, just use Enumerable's implementation:
2
+ require 'backports/2.1.0/enumerable/to_h'
@@ -0,0 +1,3 @@
1
+ require 'backports/tools'
2
+
3
+ Backports.require_relative_dir
@@ -0,0 +1,16 @@
1
+ unless Enumerable.method_defined?(:to_h)
2
+ require 'backports/tools'
3
+ module Enumerable
4
+ def to_h(*args)
5
+ h = {}
6
+ each_entry(*args) do |key_value|
7
+ key_value = Backports.coerce_to_ary(key_value)
8
+ if key_value.size != 2
9
+ raise ArgumentError, "element has wrong array length (expected 2, was #{key_value.size})"
10
+ end
11
+ h[ key_value[0] ] = key_value[1]
12
+ end
13
+ h
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,2 @@
1
+ # require this file to load all the backports of Ruby 2.1 and below
2
+ require 'backports/2.1.0'
@@ -1,3 +1,3 @@
1
1
  module Backports
2
- VERSION = "3.3.5" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
2
+ VERSION = "3.4.0" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backports
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.5
5
- prerelease:
4
+ version: 3.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marc-André Lafortune
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-10 00:00:00.000000000 Z
11
+ date: 2013-12-29 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Essential backports that enable many of the nice features of Ruby 1.8.7
15
14
  up to 2.0.0 for earlier versions.
@@ -387,6 +386,12 @@ files:
387
386
  - lib/backports/2.0.0/struct.rb
388
387
  - lib/backports/2.0.0/struct/to_h.rb
389
388
  - lib/backports/2.0.rb
389
+ - lib/backports/2.1.0.rb
390
+ - lib/backports/2.1.0/array.rb
391
+ - lib/backports/2.1.0/array/to_h.rb
392
+ - lib/backports/2.1.0/enumerable.rb
393
+ - lib/backports/2.1.0/enumerable/to_h.rb
394
+ - lib/backports/2.1.rb
390
395
  - lib/backports/basic_object.rb
391
396
  - lib/backports/extra/random/MT19937.rb
392
397
  - lib/backports/extra/random/bits_and_bytes.rb
@@ -515,27 +520,26 @@ files:
515
520
  - test/test_helper.rb
516
521
  homepage: http://github.com/marcandre/backports
517
522
  licenses: []
523
+ metadata: {}
518
524
  post_install_message:
519
525
  rdoc_options: []
520
526
  require_paths:
521
527
  - lib
522
528
  required_ruby_version: !ruby/object:Gem::Requirement
523
- none: false
524
529
  requirements:
525
- - - ! '>='
530
+ - - '>='
526
531
  - !ruby/object:Gem::Version
527
532
  version: '0'
528
533
  required_rubygems_version: !ruby/object:Gem::Requirement
529
- none: false
530
534
  requirements:
531
- - - ! '>='
535
+ - - '>='
532
536
  - !ruby/object:Gem::Version
533
537
  version: '0'
534
538
  requirements: []
535
539
  rubyforge_project:
536
- rubygems_version: 1.8.25
540
+ rubygems_version: 2.0.3
537
541
  signing_key:
538
- specification_version: 3
542
+ specification_version: 4
539
543
  summary: Backports of Ruby features for older Ruby.
540
544
  test_files:
541
545
  - spec/tags/1.8.6/core/array/rotate_spec.rb
@@ -639,4 +643,3 @@ test_files:
639
643
  - test/lazy_test.rb
640
644
  - test/socket_interaction_test.rb
641
645
  - test/test_helper.rb
642
- has_rdoc: