ruby_sscanf 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +56 -17
- data/lib/ruby_sscanf/version.rb +1 -1
- data/rakefile.rb +1 -1
- data/ruby_sscanf.gemspec +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 716b018576df51f78f889788cd2ff4949b22c4f1
|
4
|
+
data.tar.gz: 7d764f88dfecd6cbab0289048d2ecace1175be03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c25d2ba372ba49398ef50c91447d83a63b731b49f31d2457bbae8d76c15877a88e82a8b5744500113c08208644d763ae98916c61d2e51e41bbdea3c24370a6b9
|
7
|
+
data.tar.gz: 6592945eb935ca1f6e0a4aa45c7cd2ee574cebace3fb8b441393ce0430c6c801b918dfdadc455f1090581a305eb4d80730f92148a471147fd4df326f2cef4baf
|
data/README.md
CHANGED
@@ -105,7 +105,7 @@ Limitation: zero width (positive or negative) look behind assertions (?<= )
|
|
105
105
|
and (?<! ) are not supported at this time.
|
106
106
|
|
107
107
|
#### Examples
|
108
|
-
Here are a few
|
108
|
+
Here are a few examples of the sscanf method in action.
|
109
109
|
|
110
110
|
```ruby
|
111
111
|
"12 34 -56".sscanf "%d %2d %4d"
|
@@ -173,6 +173,8 @@ is not parsed. It is possible to retrieve this text using the following:
|
|
173
173
|
```ruby
|
174
174
|
String.sscanf_unparsed
|
175
175
|
```
|
176
|
+
Note: Since the ruby_sscanf gem is designed to be thread safe, each thread has
|
177
|
+
its own copy of the unparsed text.
|
176
178
|
|
177
179
|
## Demo
|
178
180
|
|
@@ -187,25 +189,50 @@ I ran a test just to make sure that ruby_sscanf was not terribly
|
|
187
189
|
under-performant when compared to the ruby standard library version. I was
|
188
190
|
pleased to see that in fact ruby_sscanf was faster. Here are the results:
|
189
191
|
|
190
|
-
Warming up --------------------------------------
|
191
|
-
Scan strings with ruby_sscanf
|
192
|
-
1.734k i/100ms
|
193
|
-
Scan strings with scanf
|
194
|
-
309.000 i/100ms
|
195
|
-
Calculating -------------------------------------
|
196
|
-
Scan strings with ruby_sscanf
|
197
|
-
17.926k (± 0.6%) i/s - 90.168k
|
198
|
-
Scan strings with scanf
|
199
|
-
3.123k (± 0.6%) i/s - 15.759k
|
200
|
-
|
201
|
-
Comparison:
|
202
|
-
Scan strings with ruby_sscanf: 17925.7 i/s
|
203
|
-
Scan strings with scanf: 3123.0 i/s - 5.74x slower
|
204
|
-
|
205
192
|
This benchmark test was run under:
|
206
193
|
* ruby 2.1.6p336 (2015-04-13 revision 50298) [i386-mingw32]
|
207
194
|
* format_engine version = 0.7.2
|
208
195
|
|
196
|
+
```
|
197
|
+
Warming up --------------------------------------
|
198
|
+
Scan strings with ruby_sscanf
|
199
|
+
1.734k i/100ms
|
200
|
+
Scan strings with scanf
|
201
|
+
309.000 i/100ms
|
202
|
+
Calculating -------------------------------------
|
203
|
+
Scan strings with ruby_sscanf
|
204
|
+
17.926k (± 0.6%) i/s - 90.168k
|
205
|
+
Scan strings with scanf
|
206
|
+
3.123k (± 0.6%) i/s - 15.759k
|
207
|
+
|
208
|
+
Comparison:
|
209
|
+
Scan strings with ruby_sscanf: 17925.7 i/s
|
210
|
+
Scan strings with scanf: 3123.0 i/s - 5.74x slower
|
211
|
+
```
|
212
|
+
|
213
|
+
This benchmark test was run under:
|
214
|
+
* ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]
|
215
|
+
* format_engine version = 0.7.7
|
216
|
+
|
217
|
+
```
|
218
|
+
Warming up --------------------------------------
|
219
|
+
Scan strings with ruby_sscanf
|
220
|
+
1.632k i/100ms
|
221
|
+
Scan strings with scanf
|
222
|
+
288.000 i/100ms
|
223
|
+
Calculating -------------------------------------
|
224
|
+
Scan strings with ruby_sscanf
|
225
|
+
17.402k (± 0.6%) i/s - 88.128k in 5.064426s
|
226
|
+
Scan strings with scanf
|
227
|
+
2.908k (± 0.3%) i/s - 14.688k in 5.050854s
|
228
|
+
|
229
|
+
Comparison:
|
230
|
+
Scan strings with ruby_sscanf: 17402.1 i/s
|
231
|
+
Scan strings with scanf: 2908.1 i/s - 5.98x slower
|
232
|
+
```
|
233
|
+
|
234
|
+
|
235
|
+
|
209
236
|
## Contributing
|
210
237
|
|
211
238
|
#### Plan A
|
@@ -218,6 +245,18 @@ This benchmark test was run under:
|
|
218
245
|
|
219
246
|
#### Plan B
|
220
247
|
|
221
|
-
Go to the GitHub repository and raise an
|
248
|
+
Go to the GitHub repository and raise an
|
249
|
+
[issue](https://github.com/PeterCamilleri/ruby_sscanf/issues)
|
250
|
+
calling attention to some
|
222
251
|
aspect that could use some TLC or a suggestion or an idea.
|
223
252
|
|
253
|
+
## License
|
254
|
+
|
255
|
+
The gem is available as open source under the terms of the
|
256
|
+
[MIT License](./LICENSE.txt).
|
257
|
+
|
258
|
+
## Code of Conduct
|
259
|
+
|
260
|
+
Everyone interacting in the fully_freeze project’s codebases, issue trackers,
|
261
|
+
chat rooms and mailing lists is expected to follow the
|
262
|
+
[code of conduct](./CODE_OF_CONDUCT.md).
|
data/lib/ruby_sscanf/version.rb
CHANGED
data/rakefile.rb
CHANGED
data/ruby_sscanf.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.add_runtime_dependency "format_engine", "~> 0.7.2"
|
26
26
|
|
27
|
-
spec.add_development_dependency "rake", "
|
27
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.3"
|
29
29
|
spec.add_development_dependency 'minitest', "~> 5.7"
|
30
30
|
spec.add_development_dependency 'minitest_visible', "~> 0.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_sscanf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Camilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: format_engine
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 12.3.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 12.3.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,9 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.2
|
137
|
+
rubygems_version: 2.5.2
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: A string parser.
|
141
141
|
test_files: []
|
142
|
-
has_rdoc:
|