qcmd 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/qcmd/version.rb +1 -1
- data/lib/vendor/sexpistol/sexpistol/sexpistol_parser.rb +8 -8
- data/qcmd.gemspec +4 -4
- data/spec/unit/parser_spec.rb +7 -2
- metadata +120 -110
data/lib/qcmd/version.rb
CHANGED
@@ -52,31 +52,31 @@ class SexpistolParser < StringScanner
|
|
52
52
|
when '(' then exp << [:quote].concat([parse])
|
53
53
|
else exp << [:quote, @token]
|
54
54
|
end
|
55
|
-
when String, Fixnum, Float, Symbol
|
55
|
+
when String, Fixnum, Float, Symbol
|
56
56
|
exp << @token
|
57
|
-
when nil
|
57
|
+
when nil
|
58
58
|
break
|
59
59
|
end
|
60
60
|
end
|
61
61
|
exp
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def fetch_token
|
65
65
|
skip(/\s+/)
|
66
66
|
return nil if(eos?)
|
67
|
-
|
68
|
-
@token =
|
67
|
+
|
68
|
+
@token =
|
69
69
|
# Match parentheses
|
70
|
-
if scan(/[\(\)]/)
|
70
|
+
if scan(/[\(\)]/)
|
71
71
|
matched
|
72
72
|
# Match a string literal
|
73
73
|
elsif scan(/"([^"\\]|\\.)*"/)
|
74
74
|
eval(matched)
|
75
75
|
# Match a float literal
|
76
|
-
elsif scan(/[\-\+]? [0-9]+ ((e[0-9]+) | (\.[0-9]+(e[0-9]+)?))/x)
|
76
|
+
elsif scan(/[\-\+]? [0-9]+ ((e[0-9]+) | (\.[0-9]+(e[0-9]+)?)) (\s|$)/x)
|
77
77
|
matched.to_f
|
78
78
|
# Match an integer literal
|
79
|
-
elsif scan(/[\-\+]?[0-9]
|
79
|
+
elsif scan(/[\-\+]?[0-9]+ (\s|$)/x)
|
80
80
|
matched.to_i
|
81
81
|
# Match a comma (for comma quoting)
|
82
82
|
elsif scan(/'/)
|
data/qcmd.gemspec
CHANGED
@@ -17,12 +17,12 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_runtime_dependency 'dnssd'
|
21
|
-
gem.add_runtime_dependency 'json'
|
20
|
+
gem.add_runtime_dependency 'dnssd', '= 2.0'
|
21
|
+
gem.add_runtime_dependency 'json', '= 1.7.7'
|
22
22
|
gem.add_runtime_dependency 'osc-ruby', '= 1.0.0'
|
23
|
-
gem.add_runtime_dependency 'trollop'
|
23
|
+
gem.add_runtime_dependency 'trollop', '= 2.0'
|
24
24
|
|
25
25
|
gem.add_development_dependency "rspec", '~> 2.10.0'
|
26
|
-
gem.add_development_dependency "cucumber"
|
26
|
+
gem.add_development_dependency "cucumber", '= 1.2.1'
|
27
27
|
gem.add_development_dependency "aruba"
|
28
28
|
end
|
data/spec/unit/parser_spec.rb
CHANGED
@@ -17,8 +17,13 @@ describe Qcmd::Parser do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should parse floats" do
|
20
|
-
tokens = Qcmd::Parser.parse 'go "word word" 10 -12.3'
|
21
|
-
tokens.should eql([:go, 'word word', 10, -12.3])
|
20
|
+
tokens = Qcmd::Parser.parse '1.1 go "word word" 10 -12.3 1.1.1 10.2'
|
21
|
+
tokens.should eql([1.1, :go, 'word word', 10, -12.3, :'1.1.1', 10.2])
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should parse invalid numbers as symbols" do
|
25
|
+
tokens = Qcmd::Parser.parse 'cue 1.11.0'
|
26
|
+
tokens.should eql([:cue, :'1.11.0'])
|
22
27
|
end
|
23
28
|
|
24
29
|
it "should parse nested quotes" do
|
metadata
CHANGED
@@ -1,120 +1,136 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: qcmd
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 11
|
9
|
-
version: 0.1.11
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.12
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Adam Bachman
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: dnssd
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 0
|
29
|
-
version: "0"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - '='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.0'
|
30
22
|
type: :runtime
|
31
|
-
version_requirements: *id001
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: json
|
34
23
|
prerelease: false
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - '='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: json
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - '='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.7.7
|
42
38
|
type: :runtime
|
43
|
-
version_requirements: *id002
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: osc-ruby
|
46
39
|
prerelease: false
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.7.7
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: osc-ruby
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
55
53
|
version: 1.0.0
|
56
54
|
type: :runtime
|
57
|
-
version_requirements: *id003
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: trollop
|
60
55
|
prerelease: false
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: trollop
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - '='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.0'
|
68
70
|
type: :runtime
|
69
|
-
version_requirements: *id004
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rspec
|
72
71
|
prerelease: false
|
73
|
-
|
74
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '2.0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
75
83
|
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
segments:
|
78
|
-
- 2
|
79
|
-
- 10
|
80
|
-
- 0
|
84
|
+
- !ruby/object:Gem::Version
|
81
85
|
version: 2.10.0
|
82
86
|
type: :development
|
83
|
-
version_requirements: *id005
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: cucumber
|
86
87
|
prerelease: false
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.10.0
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: cucumber
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - '='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.2.1
|
94
102
|
type: :development
|
95
|
-
version_requirements: *id006
|
96
|
-
- !ruby/object:Gem::Dependency
|
97
|
-
name: aruba
|
98
103
|
prerelease: false
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - '='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.2.1
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: aruba
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
106
118
|
type: :development
|
107
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
108
126
|
description: A simple interactive QLab 3 command line controller
|
109
|
-
email:
|
127
|
+
email:
|
110
128
|
- adam.bachman@gmail.com
|
111
|
-
executables:
|
129
|
+
executables:
|
112
130
|
- qcmd
|
113
131
|
extensions: []
|
114
|
-
|
115
132
|
extra_rdoc_files: []
|
116
|
-
|
117
|
-
files:
|
133
|
+
files:
|
118
134
|
- .gitignore
|
119
135
|
- CHANGELOG.md
|
120
136
|
- Gemfile
|
@@ -167,37 +183,31 @@ files:
|
|
167
183
|
- spec/unit/parser_spec.rb
|
168
184
|
- spec/unit/qcmd_spec.rb
|
169
185
|
- spec/unit/qlab_spec.rb
|
170
|
-
has_rdoc: true
|
171
186
|
homepage: https://github.com/Figure53/qcmd
|
172
187
|
licenses: []
|
173
|
-
|
174
188
|
post_install_message:
|
175
189
|
rdoc_options: []
|
176
|
-
|
177
|
-
require_paths:
|
190
|
+
require_paths:
|
178
191
|
- lib
|
179
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
requirements:
|
188
|
-
- -
|
189
|
-
- !ruby/object:Gem::Version
|
190
|
-
|
191
|
-
- 0
|
192
|
-
version: "0"
|
192
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - ! '>='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
|
+
none: false
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
193
204
|
requirements: []
|
194
|
-
|
195
205
|
rubyforge_project:
|
196
|
-
rubygems_version: 1.
|
206
|
+
rubygems_version: 1.8.24
|
197
207
|
signing_key:
|
198
208
|
specification_version: 3
|
199
209
|
summary: QLab 3 console
|
200
|
-
test_files:
|
210
|
+
test_files:
|
201
211
|
- features/support/setup.rb
|
202
212
|
- spec/spec_helper.rb
|
203
213
|
- spec/unit/action_spec.rb
|