tickly 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/lib/tickly.rb +1 -1
- data/lib/tickly/curve.rb +6 -1
- data/test/test_curve.rb +10 -0
- data/tickly.gemspec +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -32,7 +32,7 @@ will always return an Array of expressions, even if you only fed it one expressi
|
|
32
32
|
The AST is represented by simple arrays. Each TCL expression becomes an array. An array starting
|
33
33
|
with the :c symbol ("c" for "curlies") is a literal expression in curly braces ({}). An array with the
|
34
34
|
:b symbol at the beginning is an expression with string interpolations (square brackets).
|
35
|
-
All the other array elements are guaranteed to be strings.
|
35
|
+
All the other array elements are guaranteed to be strings or innner expressions (arrays).
|
36
36
|
|
37
37
|
String literals are expanded to string array elements.
|
38
38
|
|
data/lib/tickly.rb
CHANGED
data/lib/tickly/curve.rb
CHANGED
@@ -17,9 +17,14 @@ module Tickly
|
|
17
17
|
# [:c, "curve", "x1", "123", "456", ...]
|
18
18
|
def initialize(curve_expression)
|
19
19
|
raise InvalidCurveError, "A curve expression should have :c as it's first symbol" unless curve_expression[0] == :c
|
20
|
-
raise InvalidCurveError, "A curve expression should start with a `curve' command" unless curve_expression[1] == "curve"
|
21
20
|
raise InvalidCurveError, "Curve expression contained no values" unless curve_expression[2]
|
22
21
|
|
22
|
+
# Nuke7 sometimes produces curves where the command is a string literal
|
23
|
+
# within quotes, and it contains a trailing space
|
24
|
+
cmd = curve_expression[1].to_s.strip
|
25
|
+
raise InvalidCurveError, "Curve expression should start with a 'curve' command" unless cmd == 'curve'
|
26
|
+
|
27
|
+
|
23
28
|
expand_curve(curve_expression)
|
24
29
|
end
|
25
30
|
|
data/test/test_curve.rb
CHANGED
@@ -28,4 +28,14 @@ x754 912.0731812 x755 913.7190552 916.0959473 918.1025391 920.0751953 922.189880
|
|
28
28
|
Tickly::Curve.new([:c, "curve"])
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
def test_curve_with_trailing_space_at_command_end
|
33
|
+
atoms = [:c, "curve ", "x374", "1008.35", "899.289", "809.798",
|
34
|
+
"742.572", "825.061", "1013.43", "1238.31", "1490.91",
|
35
|
+
"1698.4", "1848.96", "1889.24", "1961.12", "2024.13",
|
36
|
+
"2090.3", "2114.74", "2164.57", "2227.17", "2309.3"]
|
37
|
+
|
38
|
+
c = Tickly::Curve.new(atoms)
|
39
|
+
assert_kind_of Tickly::Curve, c
|
40
|
+
end
|
31
41
|
end
|
data/tickly.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "tickly"
|
8
|
-
s.version = "2.1.
|
8
|
+
s.version = "2.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Julik Tarkhanov"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-09-01"
|
13
13
|
s.description = "Parses the subset of the TCL grammar needed for Nuke scripts"
|
14
14
|
s.email = "me@julik.nl"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tickly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
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-
|
12
|
+
date: 2013-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bychar
|
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
segments:
|
146
146
|
- 0
|
147
|
-
hash:
|
147
|
+
hash: 2166634319159916573
|
148
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|