bitint 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: 06dcd0b83a6c91e37dac7943bec5cbaaa91b901a6f8c4b19e6c45b4dba24269a
4
- data.tar.gz: b6299c4988582178484aee179e2a4aa2e8961f5aa87679378043fc1848aeea39
3
+ metadata.gz: 75e3bf4db6ee1c4cfc212b8bff049cb1445aadd046a118ea3dab258265b8e8af
4
+ data.tar.gz: 3207dadb95f0dae0a7084dc73daf741b45400a96bd92736f16c73515ca5023ba
5
5
  SHA512:
6
- metadata.gz: d536a9f415638dae60580af85aae14ae37f9ec1a03f8a25e988e66ebbe6b4c3055bd028f9b570fba1636adf4c0531218a68a672e8e113e0bd725e4f4bcea6d79
7
- data.tar.gz: 5438d936adca571ed12812580c69726e155aa786dccb349b908d1cc38a0f5f91b8703b0ec081ea52c10abd1c7fd7d279c4cae27b75f3fa27a6db62b39bdcb899
6
+ metadata.gz: fd10fb7e841befab6ebfacf89c7e339be37511b37489896896e1063c332cdb4b42171a067e461a759249887020d7ede860fa4a1d155d3aa7b2fb6ec5ee3736bb
7
+ data.tar.gz: f82d4513e9f79185152a37f8b15bf01fd5a55e27826a957f70404f30794af48be83b63f7159d343b493bf1c5714798d7e6f8d484cfb1dda23b2d79445dbdf6fa
data/lib/bitint/bitint.rb CHANGED
@@ -293,6 +293,8 @@ class BitInt
293
293
  private_constant :PACK_FMT
294
294
 
295
295
  def bytes(endian = :native)
296
+ return to_enum(__method__, endian) unless block_given?
297
+
296
298
  template = '_CS_L___Q'[self.class::BYTES]
297
299
  if template.nil? || template == '_'
298
300
  raise ArgumentError, 'bytes only works for sizes of 8, 16, 32, or 64.'
@@ -20,10 +20,10 @@ class BitInt
20
20
  # If no arguments are given, this instead forwards to Numeric#i.
21
21
  #
22
22
  # Any additional arguments are forwarded to +BitInt#new+
23
- def i(bits = bits_not_given=true, ...)
23
+ def i(bits = bits_not_given=true, *a, **k, &b) # Support ruby-3.0
24
24
  bits_not_given and return super
25
25
 
26
- BitInt::i(bits, ...).new(self)
26
+ BitInt::i(bits, *a, **k, &b).new(self)
27
27
  end
28
28
 
29
29
  # Converts +self+ into an unsigned 8-bit integer.
@@ -2,5 +2,5 @@
2
2
 
3
3
  class BitInt < Numeric
4
4
  # The current version of BitInt.
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.1'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Westerman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-19 00:00:00.000000000 Z
11
+ date: 2024-12-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
- rubygems_version: 3.3.3
58
+ rubygems_version: 3.2.3
59
59
  signing_key:
60
60
  specification_version: 4
61
61
  summary: A 2's-complement integer of arbitrary length