tickly 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
 
@@ -4,5 +4,5 @@ require File.dirname(__FILE__) + "/tickly/curve"
4
4
  require File.dirname(__FILE__) + "/tickly/node_processor"
5
5
 
6
6
  module Tickly
7
- VERSION = '2.1.2'
7
+ VERSION = '2.1.3'
8
8
  end
@@ -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
 
@@ -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
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "tickly"
8
- s.version = "2.1.2"
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-08-15"
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.2
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-08-15 00:00:00.000000000 Z
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: 1232326070308292090
147
+ hash: 2166634319159916573
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements: