scanf 0.0.1 → 1.0.0
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 +5 -5
- data/lib/scanf.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ad472a3283c15fc599f1f2e5efda713d5c4151fdbb6eb74df448cbba7bb25573
|
4
|
+
data.tar.gz: 56de860e7ae095a1b0577868cd3f531a5123f88e0e56701ed80f6b7a32dd16ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c270f9abd237c908e2b81d5f74fc51eb76ffda571751fef031fd4b99dfbc59f60eeb2d28ed5c1f37c9f3db05e941a8f61366048976a87674a380766dbc84611e
|
7
|
+
data.tar.gz: 077bd5497494695b6d4d8ea8e0669e0ce07436697c952559f558eec2a867fc71db1760e68d6dd051a1c00717e8b6342d58290f89dae52d16f11423d94d84f025
|
data/lib/scanf.rb
CHANGED
@@ -295,7 +295,7 @@ module Scanf
|
|
295
295
|
|
296
296
|
def extract_float(s)
|
297
297
|
return nil unless s &&! skip
|
298
|
-
if /\A(?<sign>[-+]?)0[xX](?<frac>\.\h+|\h+(?:\.\h*)?)[pP](?<exp>[-+]
|
298
|
+
if /\A(?<sign>[-+]?)0[xX](?<frac>\.\h+|\h+(?:\.\h*)?)[pP](?<exp>[-+]?\d+)/ =~ s
|
299
299
|
f1, f2 = frac.split('.')
|
300
300
|
f = f1.hex
|
301
301
|
if f2
|
@@ -411,11 +411,11 @@ module Scanf
|
|
411
411
|
|
412
412
|
# %f
|
413
413
|
when /%\*?[aefgAEFG]/
|
414
|
-
[ '([-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]
|
414
|
+
[ '([-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]?\d+|\d+(?![\d.])|\d*\.\d*(?:[eE][-+]?\d+)?))', :extract_float ]
|
415
415
|
|
416
416
|
# %5f
|
417
417
|
when /%\*?(\d+)[aefgAEFG]/
|
418
|
-
[ '(?=[-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]
|
418
|
+
[ '(?=[-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]?\d+|\d+(?![\d.])|\d*\.\d*(?:[eE][-+]?\d+)?))' +
|
419
419
|
"(\\S{1,#{$1}})", :extract_float ]
|
420
420
|
|
421
421
|
# %5s
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scanf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Alan Black
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
75
|
+
version: 2.3.0
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
78
|
- - ">="
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.7.3
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: scanf is an implementation of the C function scanf(3).
|