treevisitor 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/LICENSE.txt +20 -0
  2. data/README.rdoc +42 -0
  3. data/Rakefile +9 -0
  4. data/VERSION.yml +5 -0
  5. data/bin/tree.rb +9 -0
  6. data/examples/find_files.rb +17 -0
  7. data/examples/print_files.rb +15 -0
  8. data/lib/tree_visitor.rb +2 -0
  9. data/lib/treevisitor.rb +31 -0
  10. data/lib/treevisitor/abs_node.rb +146 -0
  11. data/lib/treevisitor/cli/cli_tree.rb +98 -0
  12. data/lib/treevisitor/dir_processor.rb +46 -0
  13. data/lib/treevisitor/dir_tree_walker.rb +164 -0
  14. data/lib/treevisitor/leaf_node.rb +33 -0
  15. data/lib/treevisitor/tree_node.rb +247 -0
  16. data/lib/treevisitor/tree_node_visitor.rb +29 -0
  17. data/lib/treevisitor/visitors/block_tree_node_visitor.rb +21 -0
  18. data/lib/treevisitor/visitors/build_dir_tree_visitor.rb +53 -0
  19. data/lib/treevisitor/visitors/callback_tree_node_visitor.rb +43 -0
  20. data/lib/treevisitor/visitors/callback_tree_node_visitor2.rb +61 -0
  21. data/lib/treevisitor/visitors/clone_tree_node_visitor.rb +39 -0
  22. data/lib/treevisitor/visitors/depth_tree_node_visitor.rb +27 -0
  23. data/lib/treevisitor/visitors/flat_print_tree_node_visitors.rb +20 -0
  24. data/lib/treevisitor/visitors/print_dir_tree_visitor.rb +21 -0
  25. data/lib/treevisitor/visitors/print_tree_node_visitor.rb +40 -0
  26. data/lib/treevisitor_cli.rb +7 -0
  27. data/spec/fixtures/test_dir/.dir_with_dot/dummy.txt +0 -0
  28. data/spec/fixtures/test_dir/dir.1/dir.1.2/file.1.2.1 +0 -0
  29. data/spec/fixtures/test_dir/dir.1/file.1.1 +0 -0
  30. data/spec/fixtures/test_dir/dir.2/file.2.1 +0 -0
  31. data/spec/spec_helper.rb +29 -0
  32. data/spec/treevisitor/cli/cli_tree_spec.rb +58 -0
  33. data/spec/treevisitor/dir_processor_spec.rb +15 -0
  34. data/spec/treevisitor/dir_tree_walker_spec.rb +33 -0
  35. data/spec/treevisitor/tree_node_dsl_spec.rb +153 -0
  36. data/spec/treevisitor/tree_node_spec.rb +153 -0
  37. data/spec/treevisitor/tree_node_visitor_spec.rb +70 -0
  38. data/tasks/jeweler.rake +55 -0
  39. data/tasks/rspec.rake +34 -0
  40. data/tasks/rubyforge.rake +28 -0
  41. data/tasks/yard.rake +36 -0
  42. metadata +192 -0
data/tasks/rspec.rake ADDED
@@ -0,0 +1,34 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # spec
4
+ #
5
+ begin
6
+ require 'rspec/core/rake_task'
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ RSpec::Core::RakeTask.new do |t|
10
+ t.rspec_opts = ["--color", "--format", "spec", '--backtrace']
11
+ t.pattern = 'spec/**/*_spec.rb'
12
+ end
13
+
14
+ rescue LoadError
15
+ puts "rspec (or a dependency) not available. Install it with: sudo gem install rspec"
16
+ end
17
+
18
+
19
+ #
20
+ #
21
+ #begin
22
+ # require 'rcov/rcovtask'
23
+ # Rcov::RcovTask.new do |test|
24
+ # test.libs << 'test'
25
+ # test.pattern = 'test/**/*_test.rb'
26
+ # test.verbose = true
27
+ # end
28
+ #rescue LoadError
29
+ # task :rcov do
30
+ # abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
31
+ # end
32
+ #end
33
+ #
34
+ #
@@ -0,0 +1,28 @@
1
+ #
2
+ # rubyforge
3
+ #
4
+ #begin
5
+ # require 'rake/contrib/sshpublisher'
6
+ # namespace :rubyforge do
7
+ #
8
+ # desc "Release gem and RDoc documentation to RubyForge"
9
+ # task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
10
+ #
11
+ # namespace :release do
12
+ # desc "Publish RDoc to RubyForge."
13
+ # task :docs => [:rdoc] do
14
+ # config = YAML.load(
15
+ # File.read(File.expand_path('~/.rubyforge/user-config.yml'))
16
+ # )
17
+ #
18
+ # host = "#{config['username']}@rubyforge.org"
19
+ # remote_dir = "/var/www/gforge-projects/treevisitor/"
20
+ # local_dir = 'rdoc'
21
+ #
22
+ # Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
23
+ # end
24
+ # end
25
+ # end
26
+ #rescue LoadError
27
+ # puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
28
+ #end
data/tasks/yard.rake ADDED
@@ -0,0 +1,36 @@
1
+ # -*- coding: utf-8 -*-
2
+ begin
3
+ require 'yard'
4
+
5
+ YARD::Rake::YardocTask.new do |t|
6
+ # t.files = ['lib/**/*.rb']
7
+ # t.options = [
8
+ # '--readme', 'README.rdoc',
9
+ # ]
10
+ end
11
+
12
+ rescue LoadError
13
+ puts "Yard (or a dependency) not available. Install it with: sudo gem install jeweler"
14
+ end
15
+
16
+
17
+
18
+ # require 'hanna/rdoctask'
19
+ #require 'rake/rdoctask'
20
+ #require 'sdoc'
21
+ #
22
+ #Rake::RDocTask.new do |rdoc|
23
+ # config = YAML.load(File.read('VERSION.yml'))
24
+ # version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
25
+ #
26
+ # rdoc.rdoc_dir = 'doc' # rdoc output folder
27
+ # rdoc.title = "Tree Visitor #{version}"
28
+ # rdoc.main = "README.rdoc" # page to start on
29
+ #
30
+ # rdoc.rdoc_files.include('README*')
31
+ # rdoc.rdoc_files.include('lib/**/*.rb')
32
+ #
33
+ # # sdoc
34
+ # rdoc.options << '--fmt' << 'shtml' # explictly set shtml generator
35
+ # rdoc.template = 'direct' # lighter template used on railsapi.com
36
+ #end
metadata ADDED
@@ -0,0 +1,192 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: treevisitor
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 4
9
+ version: 0.1.4
10
+ platform: ruby
11
+ authors:
12
+ - Tokiro
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-12-18 00:00:00 +01:00
18
+ default_executable: tree.rb
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: abstract
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :runtime
31
+ prerelease: false
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: jeweler
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ version: "0"
43
+ type: :development
44
+ prerelease: false
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: &id003 !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *id003
59
+ - !ruby/object:Gem::Dependency
60
+ name: yard
61
+ requirement: &id004 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: *id004
72
+ - !ruby/object:Gem::Dependency
73
+ name: bundler
74
+ requirement: &id005 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: *id005
85
+ - !ruby/object:Gem::Dependency
86
+ name: rspec
87
+ requirement: &id006 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ type: :development
96
+ prerelease: false
97
+ version_requirements: *id006
98
+ description: " Implementation of visitor design pattern. It contains a 'tree.rb'\n command line clone of the tree unix tool.\n"
99
+ email: tokiro.oyama@gmail.com
100
+ executables:
101
+ - tree.rb
102
+ extensions: []
103
+
104
+ extra_rdoc_files:
105
+ - LICENSE.txt
106
+ - README.rdoc
107
+ files:
108
+ - README.rdoc
109
+ - Rakefile
110
+ - VERSION.yml
111
+ - examples/find_files.rb
112
+ - examples/print_files.rb
113
+ - lib/tree_visitor.rb
114
+ - lib/treevisitor.rb
115
+ - lib/treevisitor/abs_node.rb
116
+ - lib/treevisitor/cli/cli_tree.rb
117
+ - lib/treevisitor/dir_processor.rb
118
+ - lib/treevisitor/dir_tree_walker.rb
119
+ - lib/treevisitor/leaf_node.rb
120
+ - lib/treevisitor/tree_node.rb
121
+ - lib/treevisitor/tree_node_visitor.rb
122
+ - lib/treevisitor/visitors/block_tree_node_visitor.rb
123
+ - lib/treevisitor/visitors/build_dir_tree_visitor.rb
124
+ - lib/treevisitor/visitors/callback_tree_node_visitor.rb
125
+ - lib/treevisitor/visitors/callback_tree_node_visitor2.rb
126
+ - lib/treevisitor/visitors/clone_tree_node_visitor.rb
127
+ - lib/treevisitor/visitors/depth_tree_node_visitor.rb
128
+ - lib/treevisitor/visitors/flat_print_tree_node_visitors.rb
129
+ - lib/treevisitor/visitors/print_dir_tree_visitor.rb
130
+ - lib/treevisitor/visitors/print_tree_node_visitor.rb
131
+ - lib/treevisitor_cli.rb
132
+ - tasks/jeweler.rake
133
+ - tasks/rspec.rake
134
+ - tasks/rubyforge.rake
135
+ - tasks/yard.rake
136
+ - LICENSE.txt
137
+ - spec/fixtures/test_dir/.dir_with_dot/dummy.txt
138
+ - spec/fixtures/test_dir/dir.1/dir.1.2/file.1.2.1
139
+ - spec/fixtures/test_dir/dir.1/file.1.1
140
+ - spec/fixtures/test_dir/dir.2/file.2.1
141
+ - spec/spec_helper.rb
142
+ - spec/treevisitor/cli/cli_tree_spec.rb
143
+ - spec/treevisitor/dir_processor_spec.rb
144
+ - spec/treevisitor/dir_tree_walker_spec.rb
145
+ - spec/treevisitor/tree_node_dsl_spec.rb
146
+ - spec/treevisitor/tree_node_spec.rb
147
+ - spec/treevisitor/tree_node_visitor_spec.rb
148
+ - bin/tree.rb
149
+ has_rdoc: true
150
+ homepage: http://github.com/tokiro/treevisitor
151
+ licenses: []
152
+
153
+ post_install_message:
154
+ rdoc_options: []
155
+
156
+ require_paths:
157
+ - lib
158
+ required_ruby_version: !ruby/object:Gem::Requirement
159
+ none: false
160
+ requirements:
161
+ - - ">="
162
+ - !ruby/object:Gem::Version
163
+ segments:
164
+ - 0
165
+ version: "0"
166
+ required_rubygems_version: !ruby/object:Gem::Requirement
167
+ none: false
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ segments:
172
+ - 0
173
+ version: "0"
174
+ requirements: []
175
+
176
+ rubyforge_project:
177
+ rubygems_version: 1.3.7
178
+ signing_key:
179
+ specification_version: 3
180
+ summary: Implementation of visitor design pattern
181
+ test_files:
182
+ - spec/fixtures/test_dir/.dir_with_dot/dummy.txt
183
+ - spec/fixtures/test_dir/dir.1/dir.1.2/file.1.2.1
184
+ - spec/fixtures/test_dir/dir.1/file.1.1
185
+ - spec/fixtures/test_dir/dir.2/file.2.1
186
+ - spec/spec_helper.rb
187
+ - spec/treevisitor/cli/cli_tree_spec.rb
188
+ - spec/treevisitor/dir_processor_spec.rb
189
+ - spec/treevisitor/dir_tree_walker_spec.rb
190
+ - spec/treevisitor/tree_node_dsl_spec.rb
191
+ - spec/treevisitor/tree_node_spec.rb
192
+ - spec/treevisitor/tree_node_visitor_spec.rb