tickly 2.1.6 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +52 -0
- data/.travis.yml +5 -1
- data/Gemfile +1 -9
- data/README.md +38 -6
- data/Rakefile +20 -47
- data/lib/tickly.rb +1 -1
- data/lib/tickly/version.rb +3 -0
- data/test/test_benchmark.rb +1 -15
- data/test/test_emitter.rb +1 -1
- data/tickly.gemspec +11 -49
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 79dee9e082c21c3cb365af477c63168331c4576e978c58ebff856daedce3a746
|
4
|
+
data.tar.gz: 8d11fdb50e734105ae5b9dbf82a866252748ce6fe7c2b910b8f833935051164f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 410ac1d060bf206c34bc58a7a9ad2a324ad32835a283f0120782353ddd37e1b794bc80037cfaa717cc6767f283cb8022b70e747e0ae21c6c7265e97c867c07c7
|
7
|
+
data.tar.gz: c07d44ac24fb4d9fa666d38f95a2fda2e6976ab5e18beba7951fb40bb2b66fee3fc4c2069367aefb644bfbe4bf6f9697867e8a5d16db61c6a2b247dfa8f7cb40
|
data/.gitignore
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
Gemfile.lock
|
2
|
+
profiler_calls.html
|
3
|
+
|
4
|
+
# rcov generated
|
5
|
+
coverage
|
6
|
+
coverage.data
|
7
|
+
|
8
|
+
# rdoc generated
|
9
|
+
rdoc
|
10
|
+
|
11
|
+
# yard generated
|
12
|
+
doc
|
13
|
+
.yardoc
|
14
|
+
|
15
|
+
# bundler
|
16
|
+
.bundle
|
17
|
+
|
18
|
+
# jeweler generated
|
19
|
+
pkg
|
20
|
+
|
21
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
22
|
+
#
|
23
|
+
# * Create a file at ~/.gitignore
|
24
|
+
# * Include files you want ignored
|
25
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
26
|
+
#
|
27
|
+
# After doing this, these files will be ignored in all your git projects,
|
28
|
+
# saving you from having to 'pollute' every project you touch with them
|
29
|
+
#
|
30
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
31
|
+
#
|
32
|
+
# For MacOS:
|
33
|
+
#
|
34
|
+
#.DS_Store
|
35
|
+
|
36
|
+
# For TextMate
|
37
|
+
#*.tmproj
|
38
|
+
#tmtags
|
39
|
+
|
40
|
+
# For emacs:
|
41
|
+
#*~
|
42
|
+
#\#*
|
43
|
+
#.\#*
|
44
|
+
|
45
|
+
# For vim:
|
46
|
+
#*.swp
|
47
|
+
|
48
|
+
# For redcar:
|
49
|
+
#.redcar
|
50
|
+
|
51
|
+
# For rubinius:
|
52
|
+
#*.rbc
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,11 +1,3 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
# Include everything needed to run rake, tests, features, etc.
|
5
|
-
group :development do
|
6
|
-
gem "rake"
|
7
|
-
gem "rdoc", "~> 3.12"
|
8
|
-
gem "jeweler", "~> 1.8.7"
|
9
|
-
# Use the older ruby-prof that still supports 1.8.7
|
10
|
-
gem "ruby-prof", '0.13.0'
|
11
|
-
end
|
3
|
+
gemspec
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/julik/tickly.svg?branch=master)](https://travis-ci.org/julik/tickly)
|
2
|
+
|
1
3
|
A highly simplistic TCL parser and evaluator (primarily designed for parsing Nuke scripts).
|
2
4
|
It transforms the passed Nuke scripts into a TCL AST.
|
3
5
|
It also supports some cheap tricks to discard the nodes you are not interested in, since Nuke
|
@@ -64,10 +66,10 @@ and memory.
|
|
64
66
|
To match nodes you create Ruby classes matching the node classes by name. It doesn't matter if your
|
65
67
|
custom node handler is inside a module since the processor will only use the last part of the name.
|
66
68
|
|
67
|
-
For example, to capture every
|
69
|
+
For example, to capture every `Blur` node in your script:
|
68
70
|
|
69
71
|
# Remember, only the last part of the class name matters
|
70
|
-
class MyAwesomeDirtyScript::
|
72
|
+
class MyAwesomeDirtyScript::Blur
|
71
73
|
attr_reader :knobs
|
72
74
|
def initialize(string_keyed_knobs_hash)
|
73
75
|
@knobs = string_keyed_knobs_hash
|
@@ -83,10 +85,10 @@ For example, to capture every +SomeNode+ in your script:
|
|
83
85
|
# Open the ginormous Nuke script
|
84
86
|
file = File.open("/mnt/raid/nuke/scripts/HugeShot_123.nk")
|
85
87
|
|
86
|
-
e.parse(file) do |
|
87
|
-
# Everytime a
|
88
|
+
e.parse(file) do | blur_node |
|
89
|
+
# Everytime a Blur node is found in the script it will be instantiated,
|
88
90
|
# and the knobs of the node will be passed to the constructor that you define
|
89
|
-
|
91
|
+
kernel_size = blur_node.knobs["radius"]
|
90
92
|
...
|
91
93
|
end
|
92
94
|
|
@@ -99,11 +101,41 @@ nodes containing tracking data:
|
|
99
101
|
parser.add_node_handler_class(PlanarTracker1_0)
|
100
102
|
parser.add_node_handler_class(Tracker4)
|
101
103
|
|
104
|
+
Then you will need to handle switching between node types during parsing
|
105
|
+
|
106
|
+
e.parse(file) do | detected_node |
|
107
|
+
if detected_node.is_a?(Tracker3)
|
108
|
+
...
|
109
|
+
else
|
110
|
+
...
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
Node clones are not supported.
|
115
|
+
|
102
116
|
## Animation curves
|
103
117
|
|
104
|
-
You can parse Nuke's animation curves using Tickly::Curve
|
118
|
+
You can parse Nuke's animation curves using `Tickly::Curve`. This will give you a way to iterate over every defined keyframe.
|
105
119
|
This currently does not happen automatically for things passing through the parser.
|
106
120
|
|
121
|
+
## Tip: Speeding up parsing
|
122
|
+
|
123
|
+
Normally, Tickly will accept strings and IO objects as sources. However if you want a little performance boost
|
124
|
+
when parsing actual _files_ (or long IO objects that can be prebuffered) you should use it together
|
125
|
+
with [bychar](http://rubygems.org/gems/bychar), version 3 or newer - like so:
|
126
|
+
|
127
|
+
p = Tickly::Parser.new
|
128
|
+
File.open("/mnt/raid/comps/s023_v23.nk", "r") do | f |
|
129
|
+
expressions = p.parse(Bychar.wrap(f))
|
130
|
+
...
|
131
|
+
end
|
132
|
+
|
133
|
+
This way some of the IO will be prebuffered for you and give you improved reading performance when parsing.
|
134
|
+
|
135
|
+
Tracksperanto does the bychar wrapping thing automatically, so no need to worry about that.
|
136
|
+
|
137
|
+
|
138
|
+
|
107
139
|
## Contributing to tickly
|
108
140
|
|
109
141
|
Just like tracksperanto Tickly no longer ships with test data in gem format (since the test data amounts to
|
data/Rakefile
CHANGED
@@ -1,36 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
require File.dirname(__FILE__) + "/lib/tickly"
|
6
|
-
|
7
|
-
begin
|
8
|
-
Bundler.setup(:default, :development)
|
9
|
-
rescue Bundler::BundlerError => e
|
10
|
-
$stderr.puts e.message
|
11
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
12
|
-
exit e.status_code
|
13
|
-
end
|
14
|
-
require 'rake'
|
15
|
-
|
16
|
-
require 'jeweler'
|
17
|
-
Jeweler::Tasks.new do |gem|
|
18
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
19
|
-
gem.version = Tickly::VERSION
|
20
|
-
gem.name = "tickly"
|
21
|
-
gem.homepage = "http://github.com/julik/tickly"
|
22
|
-
gem.license = "MIT"
|
23
|
-
gem.summary = %Q{Assists in parsing Nuke scripts in TCL}
|
24
|
-
gem.description = %Q{Parses the subset of the TCL grammar needed for Nuke scripts}
|
25
|
-
gem.email = "me@julik.nl"
|
26
|
-
gem.authors = ["Julik Tarkhanov"]
|
27
|
-
# dependencies defined in Gemfile
|
28
|
-
|
29
|
-
# Do not package test data
|
30
|
-
gem.files.exclude "test/test-data/*.*"
|
31
|
-
end
|
32
|
-
|
33
|
-
Jeweler::RubygemsDotOrgTasks.new
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require 'rake/testtask'
|
34
3
|
|
35
4
|
require 'rake/testtask'
|
36
5
|
Rake::TestTask.new(:test) do |test|
|
@@ -39,8 +8,6 @@ Rake::TestTask.new(:test) do |test|
|
|
39
8
|
test.verbose = true
|
40
9
|
end
|
41
10
|
|
42
|
-
task :default => :test
|
43
|
-
|
44
11
|
require 'rdoc/task'
|
45
12
|
Rake::RDocTask.new do |rdoc|
|
46
13
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
@@ -51,20 +18,26 @@ Rake::RDocTask.new do |rdoc|
|
|
51
18
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
19
|
end
|
53
20
|
|
54
|
-
desc "
|
55
|
-
task :
|
56
|
-
require
|
57
|
-
|
58
|
-
f = File.open(File.dirname(__FILE__) + "/test/test-data/huge_nuke_tcl.tcl")
|
21
|
+
desc "Benchmarks the parser"
|
22
|
+
task :bench do
|
23
|
+
require File.dirname(__FILE__) + "/lib/tickly"
|
24
|
+
require 'benchmark'
|
59
25
|
|
60
|
-
|
61
|
-
|
62
|
-
|
26
|
+
class Tracker3
|
27
|
+
def initialize(n); end
|
28
|
+
end
|
63
29
|
|
64
|
-
|
65
|
-
|
66
|
-
|
30
|
+
pe = Tickly::NodeProcessor.new
|
31
|
+
pe.add_node_handler_class(Tracker3)
|
32
|
+
|
33
|
+
HUGE_SCRIPT = File.open(File.dirname(__FILE__) + "/test/test-data/huge_nuke_tcl.tcl", "rb")
|
34
|
+
Benchmark.bm do | runner |
|
35
|
+
runner.report("Parsing a huge Nuke script:") do
|
36
|
+
counter = 0
|
37
|
+
pe.parse(HUGE_SCRIPT) { counter += 1 }
|
38
|
+
HUGE_SCRIPT.rewind
|
39
|
+
end
|
67
40
|
end
|
68
|
-
`open profiler_calls.html`
|
69
41
|
end
|
70
42
|
|
43
|
+
task :default => [:test, :bench]
|
data/lib/tickly.rb
CHANGED
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + "/tickly/parser"
|
|
2
2
|
require File.dirname(__FILE__) + "/tickly/evaluator"
|
3
3
|
require File.dirname(__FILE__) + "/tickly/curve"
|
4
4
|
require File.dirname(__FILE__) + "/tickly/node_processor"
|
5
|
+
require File.dirname(__FILE__) + "/tickly/version"
|
5
6
|
|
6
7
|
module Tickly
|
7
|
-
VERSION = '2.1.6'
|
8
8
|
end
|
data/test/test_benchmark.rb
CHANGED
@@ -3,19 +3,5 @@ require 'benchmark'
|
|
3
3
|
|
4
4
|
class TestParserEvaluator < Test::Unit::TestCase
|
5
5
|
|
6
|
-
|
7
|
-
def initialize(n); end
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_parses_huge
|
11
|
-
pe = Tickly::NodeProcessor.new
|
12
|
-
pe.add_node_handler_class(Tracker3)
|
13
|
-
|
14
|
-
Benchmark.bm do | runner |
|
15
|
-
runner.report("Parsing a huge Nuke script:") do
|
16
|
-
counter = 0
|
17
|
-
pe.parse(HUGE_SCRIPT) { counter += 1 }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
6
|
+
|
21
7
|
end
|
data/test/test_emitter.rb
CHANGED
data/tickly.gemspec
CHANGED
@@ -1,68 +1,30 @@
|
|
1
|
-
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: tickly 2.1.6 ruby lib
|
1
|
+
require File.dirname(__FILE__) + '/lib/tickly/version'
|
6
2
|
|
7
3
|
Gem::Specification.new do |s|
|
8
4
|
s.name = "tickly"
|
9
|
-
s.version =
|
5
|
+
s.version = Tickly::VERSION
|
10
6
|
|
11
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
8
|
s.require_paths = ["lib"]
|
13
9
|
s.authors = ["Julik Tarkhanov"]
|
14
|
-
s.date = "
|
10
|
+
s.date = Time.now.utc.strftime("%Y-%m-%d")
|
15
11
|
s.description = "Parses the subset of the TCL grammar needed for Nuke scripts"
|
16
12
|
s.email = "me@julik.nl"
|
17
13
|
s.extra_rdoc_files = [
|
18
14
|
"LICENSE.txt",
|
19
15
|
"README.md"
|
20
16
|
]
|
21
|
-
s.files =
|
22
|
-
|
23
|
-
|
24
|
-
"Gemfile",
|
25
|
-
"LICENSE.txt",
|
26
|
-
"README.md",
|
27
|
-
"Rakefile",
|
28
|
-
"lib/tickly.rb",
|
29
|
-
"lib/tickly/curve.rb",
|
30
|
-
"lib/tickly/evaluator.rb",
|
31
|
-
"lib/tickly/node_processor.rb",
|
32
|
-
"lib/tickly/parser.rb",
|
33
|
-
"test/helper.rb",
|
34
|
-
"test/test_benchmark.rb",
|
35
|
-
"test/test_curve.rb",
|
36
|
-
"test/test_emitter.rb",
|
37
|
-
"test/test_evaluator.rb",
|
38
|
-
"test/test_node_processor.rb",
|
39
|
-
"test/test_parser.rb",
|
40
|
-
"tickly.gemspec"
|
41
|
-
]
|
17
|
+
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.start_with? "test/test-data/"
|
19
|
+
end
|
42
20
|
s.homepage = "http://github.com/julik/tickly"
|
43
21
|
s.licenses = ["MIT"]
|
44
22
|
s.rubygems_version = "2.2.2"
|
45
23
|
s.summary = "Assists in parsing Nuke scripts in TCL"
|
46
24
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
53
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.8.7"])
|
54
|
-
s.add_development_dependency(%q<ruby-prof>, ["= 0.13.0"])
|
55
|
-
else
|
56
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
57
|
-
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
58
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
|
59
|
-
s.add_dependency(%q<ruby-prof>, ["= 0.13.0"])
|
60
|
-
end
|
61
|
-
else
|
62
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
63
|
-
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
64
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
|
65
|
-
s.add_dependency(%q<ruby-prof>, ["= 0.13.0"])
|
66
|
-
end
|
25
|
+
s.specification_version = 4
|
26
|
+
s.add_development_dependency("rake", [">= 0"])
|
27
|
+
s.add_development_dependency("rdoc", ["~> 3.12"])
|
28
|
+
s.add_development_dependency("ruby-prof")
|
29
|
+
s.add_development_dependency("test-unit")
|
67
30
|
end
|
68
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -39,33 +39,33 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.12'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: ruby-prof
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: test-unit
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0
|
68
|
+
version: '0'
|
69
69
|
description: Parses the subset of the TCL grammar needed for Nuke scripts
|
70
70
|
email: me@julik.nl
|
71
71
|
executables: []
|
@@ -75,6 +75,7 @@ extra_rdoc_files:
|
|
75
75
|
- README.md
|
76
76
|
files:
|
77
77
|
- ".document"
|
78
|
+
- ".gitignore"
|
78
79
|
- ".travis.yml"
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
@@ -85,6 +86,7 @@ files:
|
|
85
86
|
- lib/tickly/evaluator.rb
|
86
87
|
- lib/tickly/node_processor.rb
|
87
88
|
- lib/tickly/parser.rb
|
89
|
+
- lib/tickly/version.rb
|
88
90
|
- test/helper.rb
|
89
91
|
- test/test_benchmark.rb
|
90
92
|
- test/test_curve.rb
|
@@ -113,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
115
|
version: '0'
|
114
116
|
requirements: []
|
115
117
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
118
|
+
rubygems_version: 2.7.6
|
117
119
|
signing_key:
|
118
120
|
specification_version: 4
|
119
121
|
summary: Assists in parsing Nuke scripts in TCL
|