strscan 3.1.0-java → 3.1.1-java

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
  SHA256:
3
- metadata.gz: 8027f295f16a4ce4f8c294dd13ae52f8f0f7c46a6d309d1fcc43b1d3e8375a96
4
- data.tar.gz: e13a6b0f9264c8de98f4c642c9b4423de36ef86367ec84334e6a1ce05e2f108c
3
+ metadata.gz: aeffd3b1cacb8778c6c4d3157d122614aeaa43f6f42fc9ecd3a0eebf7026d99a
4
+ data.tar.gz: 01a59e543fffc37446e2f98dac6125970c1cbf3496bdf69bef8669567ecb8ccd
5
5
  SHA512:
6
- metadata.gz: 434ea4309eddd66ff1287feb2ce31ca355d9b0474c500a9d55ede10ac3bc1e01db860ba5c02a58dee7f5097c717655df4794828237cff36ebd1e8a2498e4719d
7
- data.tar.gz: 0453f04a0573a5e489510d5b421a1071348b354761d624906791fe4537b7afb81b350ac853a3a3217ae4548522b57b2b75bfd033d5981245f47c358aef703331
6
+ metadata.gz: 9763d23607330343d1fdb82ae8366ed2ad413dc088532a4f851b6429ff2c69af0106d58d0dbe6da4b970bdf65ccb54fe48edd495ea0b2c8d3871cc3a93c51964
7
+ data.tar.gz: 4aeb53650e0d7021d310fbbaa41d78c009ba3f0f708577c8ca9c174f4613a40270d8b0beb1a0d2719eee400ef5987373bc8af0d9cc1020eff8c4bce64212679c
@@ -1,2 +1,3 @@
1
1
  require 'strscan.jar'
2
2
  JRuby::Util.load_ext("org.jruby.ext.strscan.StringScannerLibrary")
3
+ require "strscan/strscan"
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ class StringScanner
4
+ # call-seq:
5
+ # scan_integer(base: 10)
6
+ #
7
+ # If `base` isn't provided or is `10`, then it is equivalent to calling `#scan` with a `[+-]?\d+` pattern,
8
+ # and returns an Integer or nil.
9
+ #
10
+ # If `base` is `16`, then it is equivalent to calling `#scan` with a `[+-]?(0x)?[0-9a-fA-F]+` pattern,
11
+ # and returns an Integer or nil.
12
+ #
13
+ # The scanned string must be encoded with an ASCII compatible encoding, otherwise
14
+ # Encoding::CompatibilityError will be raised.
15
+ def scan_integer(base: 10)
16
+ case base
17
+ when 10
18
+ scan_base10_integer
19
+ when 16
20
+ scan_base16_integer
21
+ else
22
+ raise ArgumentError, "Unsupported integer base: #{base.inspect}, expected 10 or 16"
23
+ end
24
+ end
25
+ end
data/lib/strscan.jar CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strscan
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: java
6
6
  authors:
7
7
  - Minero Aoki
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-02-04 00:00:00.000000000 Z
13
+ date: 2024-12-12 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Provides lexical scanning operations on a String.
16
16
  email:
@@ -25,6 +25,7 @@ files:
25
25
  - LICENSE.txt
26
26
  - ext/jruby/lib/strscan.rb
27
27
  - lib/strscan.jar
28
+ - lib/strscan/strscan.rb
28
29
  homepage: https://github.com/ruby/strscan
29
30
  licenses:
30
31
  - Ruby
@@ -33,8 +34,8 @@ metadata: {}
33
34
  post_install_message:
34
35
  rdoc_options: []
35
36
  require_paths:
36
- - ext/jruby/lib
37
37
  - lib
38
+ - ext/jruby/lib
38
39
  required_ruby_version: !ruby/object:Gem::Requirement
39
40
  requirements:
40
41
  - - ">="