tomlrb 1.2.4 → 1.2.5

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: 811f70b18b678d2f673d17c966a26cf97ee8e6a1
4
- data.tar.gz: 2911f897197afd22da28e39ae45d21e552dcdcc5
3
+ metadata.gz: be502b2a9974d26ce6fd6b03288086b2aedbbffd
4
+ data.tar.gz: 0a8e50b7800a3e6ab2f69decb26978c2013db0a6
5
5
  SHA512:
6
- metadata.gz: d6159d611a29b90846e278c3f006c2d461124cf97ae8ca6d637b4d072f30a6ade342b5401730acbeba3511fa6e361630786570e1f1acda46ef3a35e54f403adc
7
- data.tar.gz: 1613388e7d6631cfb2250c637dee71dc231f17375d4f755b8f1f9dbc1285ffa26f60ead4cebd6879182ebf003aca55c11dd91b0e0d092e9a2a95b2e3beb5f784
6
+ metadata.gz: 20ddd92f583df5e8eaa30359f44bcb78979b2bce0046992475db6256d15a6ff81babdc5f07841ad7f6ee8dc6466de9abb8b486ea38dd7e279fb43fb460dc826a
7
+ data.tar.gz: 39f8154cbae5943b80ceedc1648ec5c95bd6bb71766aa8e836fd1be5a56bce7b69e161682f946d74d85e02539de94f19b1b3eed6089d9aee48fe40bfcd4725db
data/README.md CHANGED
@@ -45,17 +45,16 @@ You can run the benchmark against the only other v0.4.0 compliant parser to my k
45
45
  Here are the results on my machine:
46
46
 
47
47
  ```
48
- Calculating -------------------------------------
48
+ Warming up --------------------------------------
49
49
  emancu/toml-rb 1.000 i/100ms
50
- fbernier/tomlrb 46.000 i/100ms
51
- -------------------------------------------------
52
- emancu/toml-rb 13.6577.3%) i/s - 69.000
53
- fbernier/tomlrb 486.0953.5%) i/s - 2.438k
50
+ fbernier/tomlrb 65.000 i/100ms
51
+ Calculating -------------------------------------
52
+ emancu/toml-rb 19.1995.2%) i/s - 96.000 in 5.034377s
53
+ fbernier/tomlrb 653.6504.0%) i/s - 3.315k in 5.081117s
54
54
 
55
55
  Comparison:
56
- fbernier/tomlrb: 486.1 i/s
57
- emancu/toml-rb: 13.7 i/s - 35.59x slower
58
-
56
+ fbernier/tomlrb: 653.6 i/s
57
+ emancu/toml-rb: 19.2 i/s - 34.05x slower
59
58
  ```
60
59
 
61
60
  ## Development
@@ -1,7 +1,7 @@
1
1
  require 'benchmark/ips'
2
2
  require_relative '../lib/tomlrb'
3
3
  begin
4
- require 'toml'
4
+ require 'toml-rb'
5
5
  rescue LoadError
6
6
  puts "Install toml-rb using 'gem install toml-rb' first."
7
7
  end
@@ -11,7 +11,7 @@ data = File.read(File.join(__dir__, '../test/example-v0.4.0.toml'))
11
11
  Benchmark.ips do |x|
12
12
 
13
13
  x.report("emancu/toml-rb") do
14
- TOML.parse(data)
14
+ TomlRB.parse(data)
15
15
  end
16
16
 
17
17
  x.report("fbernier/tomlrb") do
@@ -35,6 +35,10 @@ module Tomlrb
35
35
  # @option options [Boolean] :symbolize_keys (false) whether to return the keys as symbols or strings
36
36
  # @return [Hash] the Ruby data structure represented by the input
37
37
  def self.load_file(path, **options)
38
- Tomlrb.parse(File.read(path), options)
38
+ # By default Ruby sets the external encoding of an IO object to the
39
+ # default external encoding. The default external encoding is set by
40
+ # locale encoding or the interpreter -E option.
41
+ tmp = File.read(path, :encoding=>'utf-8')
42
+ Tomlrb.parse(tmp, options)
39
43
  end
40
44
  end
@@ -11,7 +11,7 @@ module Tomlrb
11
11
  STRING_LITERAL_MULTI = /'{3}([\s\S]*?'{3})/m
12
12
  DATETIME = /(-?\d{4})-(\d{2})-(\d{2})(?:(?:t|\s)(\d{2}):(\d{2}):(\d{2}(?:\.\d+)?))?(z|[-+]\d{2}:\d{2})?/i
13
13
  FLOAT = /[+-]?(?:[0-9_]+\.[0-9_]*|\.[0-9_]+|\d+(?=[eE]))(?:[eE][+-]?[0-9_]+)?/
14
- INTEGER = /[+-]?\d(_?\d)*/
14
+ INTEGER = /[+-]?\d(_?\d)*(?![A-Za-z0-9_-]+)/
15
15
  TRUE = /true/
16
16
  FALSE = /false/
17
17
 
@@ -1,3 +1,3 @@
1
1
  module Tomlrb
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomlrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francois Bernier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2017-09-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A racc based toml parser
14
14
  email:
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  version: '0'
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 2.6.10
59
+ rubygems_version: 2.5.2.1
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: A racc based toml parser