bit_utils 0.1.1-java → 0.1.2-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3a43f5b1fa5a368f668333525bfbe4e26c81936
4
- data.tar.gz: 74a634a4e4d5f2ed55ad6f5d0885b4485520345f
3
+ metadata.gz: 8a2b0b0d3970d146f5016e5913146b028ca23153
4
+ data.tar.gz: 12e573a02869659f92372a7d5129f52d627daba8
5
5
  SHA512:
6
- metadata.gz: 03ae269c996d32a8ab0577a285a47ea4a57118a30192ed8d234714d8cdec581b4332efe14da2ae69f11a5518fbbd03aebafb59f020bb36e89db371a5f67fd981
7
- data.tar.gz: 78079e83d9f89c0a2c98443559368db1a3ecfc64088a76c3365f3d72889bc44871cd8b77be997cbc456ae9a8d32322a41d45e19ea4f12c23fabceb2c5a6a9a76
6
+ metadata.gz: 10e0ea0b0cbd52b72830f6ebfed911ea5e7dea8f6903c50ce81f35e75927ce3aaa60834bbfb28ddb3757c8a3868dd00cc2b1d570be94239c1e8ef9b00e2e4bb5
7
+ data.tar.gz: f6ec28eeb2cca14f64b6185bd1cdc6d23a915bb4a8bcaaee4c17e15f31f6b633c87ce6a048298a3582ed2fb9445783a6f6ec8f5c7dfbf3881f3225a80f998abc
data/.travis.yml CHANGED
@@ -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
data/CHANGELOG.md ADDED
@@ -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
@@ -1,15 +1,19 @@
1
1
  require 'bit_utils'
2
2
 
3
- # Core Extension for Fixnum
4
- class Fixnum
3
+ # Core Extension for Integer
4
+ class Integer
5
5
  def each_bit(&block)
6
- BitUtils.each_bit_fixnum self, &block
6
+ BitUtils.each_bit self, &block
7
7
  end
8
8
  end
9
9
 
10
- # Core Extension for Bignum
11
- class Bignum
12
- def each_bit(&block)
13
- BitUtils.each_bit_bignum self, &block
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
14
17
  end
18
+
15
19
  end
@@ -1,15 +1,20 @@
1
1
  require 'bit_utils'
2
2
 
3
- # Core Extension for Fixnum
4
- class Fixnum
3
+
4
+ # Core Extension for Integer
5
+ class Integer
5
6
  def popcount
6
- BitUtils.popcount_fixnum self
7
+ BitUtils.popcount self
7
8
  end
8
9
  end
9
10
 
10
- # Core Extension for Bignum
11
- class Bignum
12
- def popcount
13
- BitUtils.popcount_bignum self
11
+ unless BitUtils::INTEGER_UNITED
12
+
13
+ # Core Extension for Fixnum
14
+ class Fixnum
15
+ def popcount
16
+ BitUtils.popcount_fixnum self
17
+ end
14
18
  end
19
+
15
20
  end
@@ -1,15 +1,19 @@
1
1
  require 'bit_utils'
2
2
 
3
- # Core Extension for Fixnum
4
- class Fixnum
3
+ # Core Extension for Integer
4
+ class Integer
5
5
  def trailing_zeros
6
- BitUtils.trailing_zeros_fixnum self
6
+ BitUtils.trailing_zeros self
7
7
  end
8
8
  end
9
9
 
10
- # Core Extension for Bignum
11
- class Bignum
12
- def trailing_zeros
13
- BitUtils.trailing_zeros_bignum self
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
14
17
  end
18
+
15
19
  end
@@ -1,3 +1,3 @@
1
1
  module BitUtils
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/bit_utils.rb CHANGED
@@ -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
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: java
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
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +90,7 @@ files:
90
90
  - ".gitignore"
91
91
  - ".rspec"
92
92
  - ".travis.yml"
93
+ - CHANGELOG.md
93
94
  - Gemfile
94
95
  - LICENSE.txt
95
96
  - README.md