tickly 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/lib/tickly/parser.rb +8 -6
- data/lib/tickly.rb +1 -1
- data/tickly.gemspec +70 -0
- metadata +83 -72
data/.travis.yml
ADDED
data/lib/tickly/parser.rb
CHANGED
@@ -7,12 +7,14 @@ module Tickly
|
|
7
7
|
# Parses a piece of TCL and returns it converted into internal expression
|
8
8
|
# structures (nested StringExpr or LiteralExp objects).
|
9
9
|
def parse(io_or_str)
|
10
|
-
io = io_or_str.respond_to?(:
|
10
|
+
io = io_or_str.respond_to?(:read) ? io_or_str : StringIO.new(io_or_str)
|
11
11
|
sub_parse(io)
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
+
LAST_CHAR = -1..-1 # If we were 1.9 only we could use -1
|
17
|
+
|
16
18
|
# Parse from a passed IO object either until an unescaped stop_char is reached
|
17
19
|
# or until the IO is exhausted. The last argument is the class used to
|
18
20
|
# compose the subexpression being parsed. The subparser is reentrant and not
|
@@ -22,9 +24,9 @@ module Tickly
|
|
22
24
|
stack = expr_class.new
|
23
25
|
buf = ''
|
24
26
|
until io.eof?
|
25
|
-
char = io.
|
27
|
+
char = io.read(1)
|
26
28
|
|
27
|
-
if buf[
|
29
|
+
if buf[LAST_CHAR] != ESC
|
28
30
|
if char == stop_char # Bail out of a subexpr
|
29
31
|
stack << buf if (buf.length > 0)
|
30
32
|
return cleanup(stack)
|
@@ -69,10 +71,10 @@ module Tickly
|
|
69
71
|
def parse_str(io, stop_char)
|
70
72
|
buf = ''
|
71
73
|
until io.eof?
|
72
|
-
c = io.
|
73
|
-
if c == stop_char && buf[
|
74
|
+
c = io.read(1)
|
75
|
+
if c == stop_char && buf[LAST_CHAR] != ESC
|
74
76
|
return buf
|
75
|
-
elsif buf[
|
77
|
+
elsif buf[LAST_CHAR] == ESC # Eat out the escape char
|
76
78
|
buf = buf[0..-2] # Trim the escape character at the end of the buffer
|
77
79
|
buf << c
|
78
80
|
else
|
data/lib/tickly.rb
CHANGED
data/tickly.gemspec
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "tickly"
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Julik Tarkhanov"]
|
12
|
+
s.date = "2013-03-02"
|
13
|
+
s.description = "Parses the subset of the TCL grammar needed for Nuke scripts"
|
14
|
+
s.email = "me@julik.nl"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".travis.yml",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"lib/tickly.rb",
|
27
|
+
"lib/tickly/evaluator.rb",
|
28
|
+
"lib/tickly/parser.rb",
|
29
|
+
"test/helper.rb",
|
30
|
+
"test/nuke7_tracker_2tracks.nk",
|
31
|
+
"test/nuke_group.txt",
|
32
|
+
"test/nukenode.txt",
|
33
|
+
"test/one_tracker_with_break.nk",
|
34
|
+
"test/one_tracker_with_break_in_grp.nk",
|
35
|
+
"test/test_evaluator.rb",
|
36
|
+
"test/test_parser.rb",
|
37
|
+
"test/test_split_array.rb",
|
38
|
+
"test/three_nodes_and_roto.txt",
|
39
|
+
"test/tracker_with_differing_gaps.nk",
|
40
|
+
"test/tracker_with_repeating_gaps.nk",
|
41
|
+
"tickly.gemspec"
|
42
|
+
]
|
43
|
+
s.homepage = "http://github.com/julik/tickly"
|
44
|
+
s.licenses = ["MIT"]
|
45
|
+
s.require_paths = ["lib"]
|
46
|
+
s.rubygems_version = "1.8.25"
|
47
|
+
s.summary = "Assists in parsing Nuke scripts in TCL"
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
s.specification_version = 3
|
51
|
+
|
52
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
53
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
54
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
55
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
59
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
60
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
61
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
62
|
+
end
|
63
|
+
else
|
64
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
65
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
66
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
67
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
metadata
CHANGED
@@ -1,89 +1,93 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: tickly
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Julik Tarkhanov
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-03-02 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: shoulda
|
16
|
-
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
23
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
22
|
-
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
23
31
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
type: :development
|
33
|
+
requirement: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
31
35
|
name: rdoc
|
32
|
-
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
33
37
|
none: false
|
34
|
-
requirements:
|
38
|
+
requirements:
|
35
39
|
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
38
|
-
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
hash: 31
|
42
|
+
segments:
|
43
|
+
- 3
|
44
|
+
- 12
|
45
|
+
version: "3.12"
|
39
46
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '3.12'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
+
type: :development
|
48
|
+
requirement: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
47
50
|
name: bundler
|
48
|
-
|
51
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
49
52
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
55
60
|
prerelease: false
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
61
|
+
type: :development
|
62
|
+
requirement: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
63
64
|
name: jeweler
|
64
|
-
|
65
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
65
66
|
none: false
|
66
|
-
requirements:
|
67
|
+
requirements:
|
67
68
|
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 49
|
71
|
+
segments:
|
72
|
+
- 1
|
73
|
+
- 8
|
74
|
+
- 3
|
69
75
|
version: 1.8.3
|
70
|
-
type: :development
|
71
76
|
prerelease: false
|
72
|
-
|
73
|
-
|
74
|
-
requirements:
|
75
|
-
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 1.8.3
|
77
|
+
type: :development
|
78
|
+
requirement: *id004
|
78
79
|
description: Parses the subset of the TCL grammar needed for Nuke scripts
|
79
80
|
email: me@julik.nl
|
80
81
|
executables: []
|
82
|
+
|
81
83
|
extensions: []
|
82
|
-
|
84
|
+
|
85
|
+
extra_rdoc_files:
|
83
86
|
- LICENSE.txt
|
84
87
|
- README.rdoc
|
85
|
-
files:
|
88
|
+
files:
|
86
89
|
- .document
|
90
|
+
- .travis.yml
|
87
91
|
- Gemfile
|
88
92
|
- LICENSE.txt
|
89
93
|
- README.rdoc
|
@@ -103,32 +107,39 @@ files:
|
|
103
107
|
- test/three_nodes_and_roto.txt
|
104
108
|
- test/tracker_with_differing_gaps.nk
|
105
109
|
- test/tracker_with_repeating_gaps.nk
|
110
|
+
- tickly.gemspec
|
106
111
|
homepage: http://github.com/julik/tickly
|
107
|
-
licenses:
|
112
|
+
licenses:
|
108
113
|
- MIT
|
109
114
|
post_install_message:
|
110
115
|
rdoc_options: []
|
111
|
-
|
116
|
+
|
117
|
+
require_paths:
|
112
118
|
- lib
|
113
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
120
|
none: false
|
115
|
-
requirements:
|
116
|
-
- -
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
|
119
|
-
segments:
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 3
|
125
|
+
segments:
|
120
126
|
- 0
|
121
|
-
|
122
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
+
version: "0"
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
129
|
none: false
|
124
|
-
requirements:
|
125
|
-
- -
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 3
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
version: "0"
|
128
137
|
requirements: []
|
138
|
+
|
129
139
|
rubyforge_project:
|
130
|
-
rubygems_version: 1.8.
|
140
|
+
rubygems_version: 1.8.25
|
131
141
|
signing_key:
|
132
142
|
specification_version: 3
|
133
143
|
summary: Assists in parsing Nuke scripts in TCL
|
134
144
|
test_files: []
|
145
|
+
|