treevisitor 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/README.md +0 -2
- data/Rakefile +4 -2
- data/examples/protovis/directory_to_json_visitor.rb +2 -0
- data/examples/protovis/index.html +1 -1
- data/examples/protovis/protovis-r3.2.js +277 -0
- data/examples/protovis/treevisitor.js +23 -23
- data/lib/treevisitor.rb +1 -12
- data/lib/treevisitor/cli/cli_tree.rb +1 -1
- data/lib/treevisitor/tree_node_visitor.rb +21 -3
- data/lib/treevisitor/version.rb +4 -0
- data/spec/fixtures/test_dir_2/[Dsube]/sub/.gitkeep +0 -0
- data/spec/treevisitor/cli/cli_tree_spec.rb +1 -1
- data/treevisitor.gemspec +50 -109
- metadata +36 -36
- data/VERSION.yml +0 -5
- data/examples/protovis/protovis-d3.2.js +0 -15269
- data/lib/treevisitor/visitors/callback_tree_node_visitor.rb +0 -45
- data/tasks/jeweler.rake +0 -46
@@ -1,45 +0,0 @@
|
|
1
|
-
## -*- coding: utf-8 -*-
|
2
|
-
#module TreeVisitor
|
3
|
-
# #
|
4
|
-
# # Executes a block when enter in a node
|
5
|
-
# # The block are defined from on_enter_X methods
|
6
|
-
# # The blocks take as argument only the node
|
7
|
-
# #
|
8
|
-
# class CallbackTreeNodeVisitor
|
9
|
-
#
|
10
|
-
# def initialize(delegate = nil)
|
11
|
-
# @root = nil
|
12
|
-
# @stack = []
|
13
|
-
# @action_enter_tree_node = nil
|
14
|
-
# @action_visit_leaf_node = nil
|
15
|
-
# @delegate = delegate
|
16
|
-
# end
|
17
|
-
#
|
18
|
-
# def on_enter_node(&block)
|
19
|
-
# raise "already defined a delegate" if @delegate
|
20
|
-
# @action_enter_tree_node = block
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# def on_visit_leaf(&block)
|
24
|
-
# raise "already defined a delegate" if @delegate
|
25
|
-
# @action_visit_leaf_node = block
|
26
|
-
# end
|
27
|
-
#
|
28
|
-
# def enter_node(tree_node)
|
29
|
-
# @root = tree_node if @stack.empty?
|
30
|
-
# @stack.push(tree_node)
|
31
|
-
# @action_enter_tree_node.call(tree_node) if @action_enter_tree_node
|
32
|
-
# @delegate.enter_node(tree_node) if @delegate
|
33
|
-
# end
|
34
|
-
#
|
35
|
-
# def exit_node(tree_node)
|
36
|
-
# @stack.pop
|
37
|
-
# end
|
38
|
-
#
|
39
|
-
# def visit_leaf(leaf_node)
|
40
|
-
# @action_visit_leaf_node.call(leaf_node) if @action_visit_leaf_node
|
41
|
-
# @delegate.visit_leaf(leaf_node) if @delegate
|
42
|
-
# end
|
43
|
-
#
|
44
|
-
# end
|
45
|
-
#end
|
data/tasks/jeweler.rake
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
begin
|
3
|
-
require 'jeweler'
|
4
|
-
Jeweler::Tasks.new do |gem|
|
5
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
6
|
-
gem.name = "treevisitor"
|
7
|
-
gem.summary = "Implementation of visitor design pattern"
|
8
|
-
gem.description = <<-EOF
|
9
|
-
Implementation of visitor design pattern. It contains a 'tree.rb'
|
10
|
-
command line clone of the tree unix tool.
|
11
|
-
EOF
|
12
|
-
|
13
|
-
gem.authors = ["Tokiro"]
|
14
|
-
gem.email = "tokiro.oyama@gmail.com"
|
15
|
-
gem.homepage = "http://github.com/tokiro/treevisitor"
|
16
|
-
|
17
|
-
#
|
18
|
-
# dependencies automatically loaded from Gemfile
|
19
|
-
#
|
20
|
-
|
21
|
-
#
|
22
|
-
# bin
|
23
|
-
#
|
24
|
-
gem.executables = %w{ tree.rb }
|
25
|
-
|
26
|
-
#
|
27
|
-
# files
|
28
|
-
#
|
29
|
-
gem.files = %w{LICENSE.txt README.md Rakefile VERSION.yml treevisitor.gemspec}
|
30
|
-
gem.files.concat Dir['lib/**/*.rb']
|
31
|
-
gem.files.concat Dir['tasks/**/*.rake']
|
32
|
-
gem.files.concat Dir['examples/**/*']
|
33
|
-
|
34
|
-
#
|
35
|
-
# test files
|
36
|
-
#
|
37
|
-
gem.test_files = Dir['spec/**/*.rb']
|
38
|
-
gem.test_files.concat Dir['spec/fixtures/**/*']
|
39
|
-
gem.test_files.concat Dir['spec/fixtures/**/.gitkeep']
|
40
|
-
gem.test_files.concat Dir['spec/fixtures/**/.dir_with_dot/*']
|
41
|
-
|
42
|
-
end
|
43
|
-
Jeweler::GemcutterTasks.new
|
44
|
-
rescue LoadError
|
45
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
46
|
-
end
|