ruby_sscanf 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: ec28a950c28b1a0af3450694cb4c79bcee8847c1
4
- data.tar.gz: 1f37bacdef6e1e8b04b34614f50e925c771e49d8
3
+ metadata.gz: 2bc480e9779f68f86b3e1fc6c3037c82f9faf0b8
4
+ data.tar.gz: fb6dd5f80869cdcbadaeb9ab8c277f3983b60cef
5
5
  SHA512:
6
- metadata.gz: 826961429f3d5ada3a4e2b4a21313d4187abe41e2c2c0313c8684b3755e71a615df2550381dd996df38acb3887db909ce1dd7bfca125d8c96c7dd55d14f73463
7
- data.tar.gz: 3193a380491b336751702198518cc956273234101b04acce068307c82900e410dfdcb126931bb951caa681fc4d60097b9383f881e9ecfbe7e41c0031152ecb6b
6
+ metadata.gz: 8ddc5dc86fbfb694334448efc479a5084294094204be68cc8bbf7dc7c08f363606213d53668f9ab1b9ab62ade320d7f8e4ac10ef28df6d6cc18764b3c566ecea
7
+ data.tar.gz: 5d6af7a4a181a41e6ba9251b500553beed42e251e9686b9117475ee6fd597338998e648f242bd98cc6ef48e19f63538b7d01e23deb31d10a7da64eaa5557f9f0
data/README.md CHANGED
@@ -4,6 +4,13 @@ The ruby_sscanf gem monkey patches the String class to support the sscanf
4
4
  instance method. This method is modeled after the POSIX "C" standard sscanf
5
5
  but with alterations and omissions to suit the Ruby programming language.
6
6
 
7
+ It is noteworthy that this gem never was intended to be 100% compatible with
8
+ the built in scanf library. Some differences are:
9
+ * It deals only with strings and not IO objects.
10
+ * It adds formats for rational, complex, and quoted string data.
11
+ * It adopts a more uniform approach to eating (or not eating) superfluous spaces.
12
+ * Unsigned integer data are not allowed to be negative.
13
+
7
14
  ## Installation
8
15
 
9
16
  Add this line to your application's Gemfile:
@@ -141,23 +148,26 @@ returns ["a", "b", "c"]
141
148
 
142
149
  I ran a test just to make sure that ruby_sscanf was not terribly
143
150
  under-performant when compared to the ruby standard library version. I was
144
- please to see that in fact ruby_sscanf was faster. Here are the results:
151
+ pleased to see that in fact ruby_sscanf was faster. Here are the results:
145
152
 
146
- Calculating -------------------------------------
153
+ Warming up --------------------------------------
147
154
  Scan strings with ruby_sscanf
148
- 1.520k i/100ms
155
+ 1.594k i/100ms
149
156
  Scan strings with scanf
150
- 308.000 i/100ms
151
- -------------------------------------------------
157
+ 305.000 i/100ms
158
+ Calculating -------------------------------------
152
159
  Scan strings with ruby_sscanf
153
- 15.844k5.2%) i/s - 79.040k
160
+ 16.419k4.9%) i/s - 82.888k
154
161
  Scan strings with scanf
155
- 3.127k4.2%) i/s - 15.708k
162
+ 3.077k6.2%) i/s - 15.555k
156
163
 
157
164
  Comparison:
158
- Scan strings with ruby_sscanf: 15843.8 i/s
159
- Scan strings with scanf: 3126.7 i/s - 5.07x slower
165
+ Scan strings with ruby_sscanf: 16418.6 i/s
166
+ Scan strings with scanf: 3077.1 i/s - 5.34x slower
160
167
 
168
+ This benchmark test was run under:
169
+ * ruby 2.1.6p336 (2015-04-13 revision 50298) [i386-mingw32]
170
+ * format_engine version = 0.5.2
161
171
 
162
172
  ## Contributing
163
173
 
@@ -1,5 +1,5 @@
1
1
  #The ruby_sscanf doesn't really live here.
2
2
  module RubySscanf
3
3
  #The gem's version.
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
data/ruby_sscanf.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "bundler", "~> 1.11"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency 'minitest', "~> 5.5.1"
30
- spec.add_development_dependency 'minitest_visible', "~> 0.0.2"
30
+ spec.add_development_dependency 'minitest_visible', ">= 0.1.0"
31
31
  spec.add_development_dependency 'rdoc', "~> 4.0.1"
32
32
 
33
33
  end
data/tests/scan_tests.rb CHANGED
@@ -8,7 +8,7 @@ require 'minitest_visible'
8
8
  class ScanTester < Minitest::Test
9
9
 
10
10
  #Track mini-test progress.
11
- MinitestVisible.track self, __FILE__
11
+ include MinitestVisible
12
12
 
13
13
  def test_that_it_can_scan
14
14
  result = "12 34 -56".sscanf "%d %2d %4d"
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.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-13 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: format_engine
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: minitest_visible
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.0.2
75
+ version: 0.1.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.0.2
82
+ version: 0.1.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rdoc
85
85
  requirement: !ruby/object:Gem::Requirement