slate 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,5 +45,15 @@ module Slate
45
45
  super.gsub(/"/,'')
46
46
  end
47
47
  end
48
+
49
+ class Integer < Treetop::Runtime::SyntaxNode
50
+ def type
51
+ :integer
52
+ end
53
+
54
+ def text_value
55
+ super.to_i
56
+ end
57
+ end
48
58
  end
49
59
  end
@@ -13,7 +13,7 @@ module Slate
13
13
  end
14
14
 
15
15
  rule argument
16
- string ','? space? <Argument>
16
+ (string / integer) ','? space? <Argument>
17
17
  end
18
18
 
19
19
  rule token
@@ -24,6 +24,10 @@ module Slate
24
24
  '"' ('\"' / !'"' .)* '"' <String>
25
25
  end
26
26
 
27
+ rule integer
28
+ [\d]+ <Integer>
29
+ end
30
+
27
31
  rule space
28
32
  [\s]+
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module Slate
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -45,6 +45,18 @@ describe Slate::Parser do
45
45
  }).to_s.should == target.to_s
46
46
  end
47
47
 
48
+ it "should be able to parse a target with one function and single integer arg" do
49
+ target = Slate::Target.build("stats.web01.response_time") do |t|
50
+ t.add_function :aliasByNode, 3
51
+ end
52
+
53
+ Slate::Parser.parse(%q{
54
+ "stats.web01.response_time" {
55
+ aliasByNode 3
56
+ }
57
+ }).to_s.should == target.to_s
58
+ end
59
+
48
60
  it "should be able to parse a target with one function and multiple args" do
49
61
  target = Slate::Target.build("stats.web01.response_time") do |t|
50
62
  t.add_function :summarize, "5min", "avg"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000 Z
12
+ date: 2013-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -168,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  segments:
170
170
  - 0
171
- hash: -1731051461027255620
171
+ hash: -51540163827976113
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  none: false
174
174
  requirements:
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  segments:
179
179
  - 0
180
- hash: -1731051461027255620
180
+ hash: -51540163827976113
181
181
  requirements: []
182
182
  rubyforge_project:
183
183
  rubygems_version: 1.8.24