bit_utils 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7db8732b2bd635239001f64777db4a4d73390b8a
4
- data.tar.gz: c3ae3e279994847fdfd01ad10ae63339474bb4d8
3
+ metadata.gz: 29652b1461a6f57881077b9d2ce9b84bfee96963
4
+ data.tar.gz: 88af702fdf33ecfdc358cff4df09ae0c58a58a66
5
5
  SHA512:
6
- metadata.gz: 7af788427077dd7b7a5c6e877c26004fbfd6375af1ef4cd60add281a7b69737c2f531fb65c424a7688dd2acbeb1f4520e7d3ef628999c1d2505315a2b1a3faea
7
- data.tar.gz: 3e1e54c7f66c1dccd36be8da133cf62277cec42be0c62dcd562e1c22196dff51dcfdcf337df0b790f3dd1b404edcee19c9ad1919cefa455af00c6c4f0e5e9d4c
6
+ metadata.gz: b4f21aa80e65fb35bedd46e7229489d8d814515e7f4716f1d6882c837ab09690badc5ab9045056b7ecd921c9873adfe5f4b69f0c69a6428a6dbc5b0744a45a3c
7
+ data.tar.gz: bfea8c370f5088ccf1745855ce0e439e30a60c553721c0610a31aa6b1ff9ca1b342508d5789bfbb34237238061f2cfd671c636b2dba5cc45ceb84b8adb76ed42
@@ -5,6 +5,7 @@ rvm:
5
5
  - 2.1.6
6
6
  - 2.2.4
7
7
  - 2.3.1
8
+ - ruby-2.4.0-preview1
8
9
  - jruby-1.7.20
9
10
  - jruby-9.0.4.0
10
11
  - jruby-9.1.0.0
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ ## Ver. 0.1.2 (2016/09/19)
4
+
5
+ * Support for [Integer unification in Ruby 2.4](https://bugs.ruby-lang.org/issues/12005)
6
+ * Add specs for core extensions
7
+
8
+ ## Ver. 0.1.1 (2016/06/05)
9
+
10
+ * Initial version.
data/README.md CHANGED
@@ -53,7 +53,8 @@ If negative `num` is given, it raises `RangeError`
53
53
  ### common to all functionalities
54
54
  All of the module functions raise `TypeError` unless the parameter is `Integer`.
55
55
 
56
- All module functions have `.#xxx_fixnum` and `.#xxx_bignum` (specific for `Fixnum` and `Bignum`), but these are not intended for direct use.
56
+ All module functions have `.#xxx_fixnum` and `.#xxx_bignum` (specific for `Fixnum` and `Bignum`), but these are not intended for direct use;
57
+ these will be removed in the future..
57
58
 
58
59
 
59
60
  ## Development
@@ -11,3 +11,9 @@ else
11
11
  require 'backports/2.1.0/bignum/bit_length'
12
12
  require 'bit_utils/cruby'
13
13
  end
14
+
15
+ module BitUtils
16
+ # check if integer is a single class
17
+ # support case when Fixnum is deleted
18
+ INTEGER_UNITED = !defined?(Fixnum) || (Fixnum == Integer)
19
+ end
@@ -1,15 +1,19 @@
1
- require 'bit_utils'
2
-
3
- # Core Extension for Fixnum
4
- class Fixnum
5
- def each_bit(&block)
6
- BitUtils.each_bit_fixnum self, &block
7
- end
8
- end
9
-
10
- # Core Extension for Bignum
11
- class Bignum
12
- def each_bit(&block)
13
- BitUtils.each_bit_bignum self, &block
14
- end
15
- end
1
+ require 'bit_utils'
2
+
3
+ # Core Extension for Integer
4
+ class Integer
5
+ def each_bit(&block)
6
+ BitUtils.each_bit self, &block
7
+ end
8
+ end
9
+
10
+ unless BitUtils::INTEGER_UNITED
11
+
12
+ # Core Extension for Fixnum
13
+ class Fixnum
14
+ def each_bit(&block)
15
+ BitUtils.each_bit_fixnum self, &block
16
+ end
17
+ end
18
+
19
+ end
@@ -1,15 +1,20 @@
1
- require 'bit_utils'
2
-
3
- # Core Extension for Fixnum
4
- class Fixnum
5
- def popcount
6
- BitUtils.popcount_fixnum self
7
- end
8
- end
9
-
10
- # Core Extension for Bignum
11
- class Bignum
12
- def popcount
13
- BitUtils.popcount_bignum self
14
- end
15
- end
1
+ require 'bit_utils'
2
+
3
+
4
+ # Core Extension for Integer
5
+ class Integer
6
+ def popcount
7
+ BitUtils.popcount self
8
+ end
9
+ end
10
+
11
+ unless BitUtils::INTEGER_UNITED
12
+
13
+ # Core Extension for Fixnum
14
+ class Fixnum
15
+ def popcount
16
+ BitUtils.popcount_fixnum self
17
+ end
18
+ end
19
+
20
+ end
@@ -1,15 +1,19 @@
1
- require 'bit_utils'
2
-
3
- # Core Extension for Fixnum
4
- class Fixnum
5
- def trailing_zeros
6
- BitUtils.trailing_zeros_fixnum self
7
- end
8
- end
9
-
10
- # Core Extension for Bignum
11
- class Bignum
12
- def trailing_zeros
13
- BitUtils.trailing_zeros_bignum self
14
- end
15
- end
1
+ require 'bit_utils'
2
+
3
+ # Core Extension for Integer
4
+ class Integer
5
+ def trailing_zeros
6
+ BitUtils.trailing_zeros self
7
+ end
8
+ end
9
+
10
+ unless BitUtils::INTEGER_UNITED
11
+
12
+ # Core Extension for Fixnum
13
+ class Fixnum
14
+ def trailing_zeros
15
+ BitUtils.trailing_zeros_fixnum self
16
+ end
17
+ end
18
+
19
+ end
@@ -1,3 +1,3 @@
1
1
  module BitUtils
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bit_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jkr2255
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-05 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: function_module
@@ -105,6 +105,7 @@ files:
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
107
  - ".travis.yml"
108
+ - CHANGELOG.md
108
109
  - Gemfile
109
110
  - LICENSE.txt
110
111
  - README.md