backports 3.5.0 → 3.6.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.
- data/CHANGELOG.rdoc +7 -0
- data/Gemfile.lock +1 -1
- data/README.rdoc +6 -0
- data/lib/backports/2.1.0/bignum.rb +3 -0
- data/lib/backports/2.1.0/bignum/bit_length.rb +15 -0
- data/lib/backports/2.1.0/fixnum.rb +3 -0
- data/lib/backports/2.1.0/fixnum/bit_length.rb +13 -0
- data/lib/backports/2.1.0/module.rb +3 -0
- data/lib/backports/2.1.0/module/include.rb +5 -0
- data/lib/backports/version.rb +1 -1
- metadata +54 -28
- checksums.yaml +0 -7
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
= Backports --- History
|
2
2
|
|
3
|
+
== Version 3.6.0 - February 14th, 2014
|
4
|
+
|
5
|
+
* Additional features of 2.1.0
|
6
|
+
* Bignum#bit_length
|
7
|
+
* Fixnum#bit_length
|
8
|
+
* Module#include (now public)
|
9
|
+
|
3
10
|
== Version 3.5.0 - February 3rd, 2014
|
4
11
|
|
5
12
|
* Additional features of 2.0.0
|
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -73,8 +73,14 @@ Compatible with Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2, 1.9.3, 2.0, 2.1, JRuby and Rubi
|
|
73
73
|
|
74
74
|
* Array
|
75
75
|
* +to_h+
|
76
|
+
* Bignum
|
77
|
+
* +bit_length+
|
76
78
|
* Enumerable
|
77
79
|
* +to_h+
|
80
|
+
* Fixnum
|
81
|
+
* +bit_length+
|
82
|
+
* Module
|
83
|
+
* +include+ (now public)
|
78
84
|
|
79
85
|
== Ruby 2.0 backports
|
80
86
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
unless Bignum.method_defined? :bit_length
|
2
|
+
require 'backports/2.0.0/range/bsearch'
|
3
|
+
class Bignum
|
4
|
+
def bit_length
|
5
|
+
n = 8 * (size - 42.size)
|
6
|
+
smaller = self >> n
|
7
|
+
if smaller >= 0
|
8
|
+
smaller += 1
|
9
|
+
else
|
10
|
+
smaller = -smaller
|
11
|
+
end
|
12
|
+
n + (0...8 * 42.size).bsearch{|i| smaller <= (1 << i) }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/backports/version.rb
CHANGED
metadata
CHANGED
@@ -1,28 +1,38 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: backports
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 3.6.0
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
- Marc-
|
12
|
+
authors:
|
13
|
+
- "Marc-Andr\xC3\xA9 Lafortune"
|
8
14
|
autorequire:
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
|
-
|
17
|
+
|
18
|
+
date: 2014-02-15 00:00:00 Z
|
12
19
|
dependencies: []
|
13
|
-
|
14
|
-
|
15
|
-
email:
|
20
|
+
|
21
|
+
description: Essential backports that enable many of the nice features of Ruby 1.8.7 up to 2.0.0 for earlier versions.
|
22
|
+
email:
|
16
23
|
- github@marc-andre.ca
|
17
24
|
executables: []
|
25
|
+
|
18
26
|
extensions: []
|
27
|
+
|
19
28
|
extra_rdoc_files: []
|
20
|
-
|
21
|
-
|
22
|
-
-
|
23
|
-
-
|
24
|
-
-
|
25
|
-
-
|
29
|
+
|
30
|
+
files:
|
31
|
+
- .document
|
32
|
+
- .gitignore
|
33
|
+
- .gitmodules
|
34
|
+
- .irbrc
|
35
|
+
- .travis.yml
|
26
36
|
- CHANGELOG.rdoc
|
27
37
|
- Gemfile
|
28
38
|
- Gemfile.lock
|
@@ -390,8 +400,14 @@ files:
|
|
390
400
|
- lib/backports/2.1.0.rb
|
391
401
|
- lib/backports/2.1.0/array.rb
|
392
402
|
- lib/backports/2.1.0/array/to_h.rb
|
403
|
+
- lib/backports/2.1.0/bignum.rb
|
404
|
+
- lib/backports/2.1.0/bignum/bit_length.rb
|
393
405
|
- lib/backports/2.1.0/enumerable.rb
|
394
406
|
- lib/backports/2.1.0/enumerable/to_h.rb
|
407
|
+
- lib/backports/2.1.0/fixnum.rb
|
408
|
+
- lib/backports/2.1.0/fixnum/bit_length.rb
|
409
|
+
- lib/backports/2.1.0/module.rb
|
410
|
+
- lib/backports/2.1.0/module/include.rb
|
395
411
|
- lib/backports/2.1.rb
|
396
412
|
- lib/backports/basic_object.rb
|
397
413
|
- lib/backports/extra/random/MT19937.rb
|
@@ -535,28 +551,38 @@ files:
|
|
535
551
|
- test/test_helper.rb
|
536
552
|
homepage: http://github.com/marcandre/backports
|
537
553
|
licenses: []
|
538
|
-
|
554
|
+
|
539
555
|
post_install_message:
|
540
556
|
rdoc_options: []
|
541
|
-
|
557
|
+
|
558
|
+
require_paths:
|
542
559
|
- lib
|
543
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
544
|
-
|
560
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
561
|
+
none: false
|
562
|
+
requirements:
|
545
563
|
- - ">="
|
546
|
-
- !ruby/object:Gem::Version
|
547
|
-
|
548
|
-
|
549
|
-
|
564
|
+
- !ruby/object:Gem::Version
|
565
|
+
hash: 3
|
566
|
+
segments:
|
567
|
+
- 0
|
568
|
+
version: "0"
|
569
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
570
|
+
none: false
|
571
|
+
requirements:
|
550
572
|
- - ">="
|
551
|
-
- !ruby/object:Gem::Version
|
552
|
-
|
573
|
+
- !ruby/object:Gem::Version
|
574
|
+
hash: 3
|
575
|
+
segments:
|
576
|
+
- 0
|
577
|
+
version: "0"
|
553
578
|
requirements: []
|
579
|
+
|
554
580
|
rubyforge_project:
|
555
|
-
rubygems_version:
|
581
|
+
rubygems_version: 1.8.25
|
556
582
|
signing_key:
|
557
|
-
specification_version:
|
583
|
+
specification_version: 3
|
558
584
|
summary: Backports of Ruby features for older Ruby.
|
559
|
-
test_files:
|
585
|
+
test_files:
|
560
586
|
- spec/tags/1.8.6/core/argf/each_line_spec.rb
|
561
587
|
- spec/tags/1.8.6/core/argf/each_spec.rb
|
562
588
|
- spec/tags/1.8.6/core/argf/lines_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 406b2a6d3666f1f413255264b750efd06e9a1d73
|
4
|
-
data.tar.gz: 3176285dc83cc99080b3d350d683cfee879a5535
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: a1dfeb35ef0719dd98b30faf16d8e9e8e0f627018c17cfb1fec38daff0ecf8d0ae1948a41d497af4e8dfe90aa8bc4c10da51abed870b7dff4a7c12584d9cc4fa
|
7
|
-
data.tar.gz: 1417e2b0a7bc6c73670f8708a1ef7eba903c68db8bdeef78f6ba3e95fedb269ef003b746de6fe41394a56c85d8577ffc7409231c87fadbe503872b3f09eaad9c
|