toml-rb 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ grammar TomlArray
2
2
  include Primitive
3
3
 
4
4
  rule array
5
- ("[" indent? (elements)* ","? indent? comment? indent? "]" indent?) { eval(self) }
5
+ ("[" indent? (elements)* ","? indent? comment? indent? "]" indent?) { eval(to_str) }
6
6
  end
7
7
 
8
8
  rule elements
@@ -16,6 +16,7 @@ grammar Primitive
16
16
  # Full Zulu form
17
17
  rule datetime
18
18
  (y:/\d\d\d\d/ "-" m:/\d\d/ "-" d:/\d\d/ "T" h:/\d\d/ ":" mi:/\d\d/ ":" s:/\d\d/ "Z") {
19
+ y,m,d,h,mi,s = [:y,:m,:d,:h,:mi,:s].map{|s| capture(s) }
19
20
  Time.utc(*[y,m,d,h,mi,s].map(&:value))
20
21
  }
21
22
  end
@@ -25,11 +26,11 @@ grammar Primitive
25
26
  end
26
27
 
27
28
  rule float
28
- (integer '.' integer) { to_f }
29
+ (integer '.' integer) { to_str.to_f }
29
30
  end
30
31
 
31
32
  rule integer
32
- (sign? [0-9]+) { to_i }
33
+ (sign? [0-9]+) { to_str.to_i }
33
34
  end
34
35
 
35
36
  rule sign
data/lib/toml/keygroup.rb CHANGED
@@ -23,6 +23,6 @@ end
23
23
  # Used in document.citrus
24
24
  module Keygroup
25
25
  def value
26
- TOML::Keygroup.new(nested_keys.to_s.split('.'))
26
+ TOML::Keygroup.new(capture(:nested_keys).to_str.split('.'))
27
27
  end
28
28
  end
data/lib/toml/keyvalue.rb CHANGED
@@ -21,6 +21,6 @@ end
21
21
  # Used in document.citrus
22
22
  module Keyvalue
23
23
  def value
24
- TOML::Keyvalue.new(key.value, v.value)
24
+ TOML::Keyvalue.new(capture(:key).value, capture(:v).value)
25
25
  end
26
26
  end
data/toml-rb.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'toml-rb'
3
- s.version = '0.1.5'
3
+ s.version = '0.1.6'
4
4
  s.date = Time.now.strftime('%Y-%m-%d')
5
5
  s.summary = "TOML parser in ruby, for ruby."
6
6
  s.description = "A TOML parser using Citrus parsing library. "
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
19
19
  "init.rb"
20
20
  ]
21
21
 
22
- s.add_dependency "citrus", "~> 2.4.1"
22
+ s.add_dependency "citrus", "~> 3.0", "> 3.0"
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toml-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-16 00:00:00.000000000 Z
13
+ date: 2014-03-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: citrus
@@ -19,7 +19,10 @@ dependencies:
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: 2.4.1
22
+ version: '3.0'
23
+ - - ! '>'
24
+ - !ruby/object:Gem::Version
25
+ version: '3.0'
23
26
  type: :runtime
24
27
  prerelease: false
25
28
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,7 +30,10 @@ dependencies:
27
30
  requirements:
28
31
  - - ~>
29
32
  - !ruby/object:Gem::Version
30
- version: 2.4.1
33
+ version: '3.0'
34
+ - - ! '>'
35
+ - !ruby/object:Gem::Version
36
+ version: '3.0'
31
37
  description: ! 'A TOML parser using Citrus parsing library. '
32
38
  email:
33
39
  - emiliano.mancuso@gmail.com