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 +4 -4
- data/ext/jruby/lib/strscan.rb +1 -0
- data/lib/strscan/strscan.rb +25 -0
- data/lib/strscan.jar +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeffd3b1cacb8778c6c4d3157d122614aeaa43f6f42fc9ecd3a0eebf7026d99a
|
4
|
+
data.tar.gz: 01a59e543fffc37446e2f98dac6125970c1cbf3496bdf69bef8669567ecb8ccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9763d23607330343d1fdb82ae8366ed2ad413dc088532a4f851b6429ff2c69af0106d58d0dbe6da4b970bdf65ccb54fe48edd495ea0b2c8d3871cc3a93c51964
|
7
|
+
data.tar.gz: 4aeb53650e0d7021d310fbbaa41d78c009ba3f0f708577c8ca9c174f4613a40270d8b0beb1a0d2719eee400ef5987373bc8af0d9cc1020eff8c4bce64212679c
|
data/ext/jruby/lib/strscan.rb
CHANGED
@@ -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.
|
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-
|
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
|
- - ">="
|