tree.rb 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/tree_rb.rb +3 -0
- data/lib/tree_rb/abs_node.rb +0 -4
- data/lib/tree_rb/cli/cli_tree.rb +26 -6
- data/lib/tree_rb/extension_md5.rb +29 -0
- data/lib/tree_rb/extension_numeric.rb +27 -0
- data/lib/tree_rb/tree_node.rb +82 -32
- data/lib/tree_rb/version.rb +1 -1
- data/lib/tree_rb/visitors/build_dir_tree_visitor.rb +50 -17
- data/lib/tree_rb_cli.rb +9 -5
- data/lib/tree_visitor.rb +2 -1
- data/lib/treevisitor.rb +1 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/tree_rb/cli/cli_tree_spec.rb +1 -1
- data/spec/tree_rb/tree_dsl_with_derived_class1_spec.rb +6 -10
- data/spec/tree_rb/tree_dsl_with_derived_class_spec.rb +5 -5
- data/tree.rb.gemspec +14 -2
- metadata +46 -49
data/lib/tree_rb.rb
CHANGED
data/lib/tree_rb/abs_node.rb
CHANGED
data/lib/tree_rb/cli/cli_tree.rb
CHANGED
@@ -22,7 +22,7 @@ module TreeRb
|
|
22
22
|
opts.separator ""
|
23
23
|
opts.separator "options: "
|
24
24
|
|
25
|
-
opts.on("
|
25
|
+
opts.on("--help", "Show this message") do
|
26
26
|
puts opts
|
27
27
|
return 0
|
28
28
|
end
|
@@ -78,6 +78,25 @@ module TreeRb
|
|
78
78
|
options[:show_size] = true
|
79
79
|
end
|
80
80
|
|
81
|
+
msg =<<-EOS
|
82
|
+
Print the size of each file but in a more human readable way, e.g. appending a size letter for kilobytes (K),
|
83
|
+
megabytes (M), gigabytes (G), terrabytes (T), petabytes (P) and exabytes (E).
|
84
|
+
EOS
|
85
|
+
|
86
|
+
opts.on("-h", msg) do
|
87
|
+
options[:show_size_human] = true
|
88
|
+
end
|
89
|
+
|
90
|
+
options[:show_indentation] = true
|
91
|
+
opts.on("-i", "Makes tree not print the indentation lines, useful when used in conjunction with the -f option.") do
|
92
|
+
options[:show_indentation] = false
|
93
|
+
end
|
94
|
+
|
95
|
+
options[:show_md5] = false
|
96
|
+
opts.on("--md5", "show md5 of file") do
|
97
|
+
options[:show_md5] = true
|
98
|
+
end
|
99
|
+
|
81
100
|
begin
|
82
101
|
rest = opts.parse(argv)
|
83
102
|
rescue OptionParser::InvalidOption => e
|
@@ -96,6 +115,9 @@ module TreeRb
|
|
96
115
|
dirname = rest[0]
|
97
116
|
end
|
98
117
|
|
118
|
+
|
119
|
+
|
120
|
+
|
99
121
|
dirname = File.expand_path(dirname)
|
100
122
|
|
101
123
|
dtw = DirTreeWalker.new(dirname)
|
@@ -108,16 +130,14 @@ module TreeRb
|
|
108
130
|
case options[:algo]
|
109
131
|
|
110
132
|
when 'build-dir'
|
111
|
-
# TODO: capture CTRL^C
|
133
|
+
# TODO: capture CTRL^C to avoid show the stack trace
|
112
134
|
# http://ruby-doc.org/core-1.9.3/Kernel.html#method-i-trap
|
113
135
|
Signal.trap('INT') { put "User interrupted exit"; exit }
|
114
136
|
|
115
|
-
visitor = BuildDirTreeVisitor.new
|
116
|
-
visitor.show_size = options[:show_size]
|
117
|
-
|
137
|
+
visitor = BuildDirTreeVisitor.new(options)
|
118
138
|
dtw.run(visitor)
|
119
139
|
|
120
|
-
puts visitor.root.to_str('', options
|
140
|
+
puts visitor.root.to_str('', options)
|
121
141
|
puts
|
122
142
|
puts "#{visitor.nr_directories} directories, #{visitor.nr_files} files"
|
123
143
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# calculate md5 of big files, snipped found on usenet
|
4
|
+
#
|
5
|
+
|
6
|
+
if RUBY_VERSION =~ /1\.8/
|
7
|
+
# std lib
|
8
|
+
require 'md5'
|
9
|
+
else
|
10
|
+
# std lib
|
11
|
+
require 'digest/md5'
|
12
|
+
include Digest
|
13
|
+
end
|
14
|
+
|
15
|
+
# Return an MD5 object
|
16
|
+
# example:
|
17
|
+
# MD5.file( filename ).hexdigest
|
18
|
+
#
|
19
|
+
class MD5
|
20
|
+
def self.file(file)
|
21
|
+
File.open(file, "rb") do |f|
|
22
|
+
res = self.new
|
23
|
+
while (data = f.read(4096))
|
24
|
+
res << data
|
25
|
+
end
|
26
|
+
res
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
class Numeric
|
3
|
+
#
|
4
|
+
# returns a string separated by the thousands <separator>
|
5
|
+
# es.: 100000 -> 1.000.000
|
6
|
+
#
|
7
|
+
def with_separator(separator = ',', length = 3)
|
8
|
+
splitter = Regexp.compile "(\\d{#{length}})"
|
9
|
+
before, after = self.to_s.split('.')
|
10
|
+
before = before.reverse.gsub splitter, '\1' + separator
|
11
|
+
str = "#{ before.chomp(separator).reverse }"
|
12
|
+
str += ".#{ after }" if after
|
13
|
+
str
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_human
|
17
|
+
if self == 0
|
18
|
+
return "0B"
|
19
|
+
end
|
20
|
+
units = %w{B KB MB GB TB}
|
21
|
+
|
22
|
+
e = (Math.log(self)/Math.log(1024)).floor
|
23
|
+
s = "%.3f" % (to_f / 1024**e)
|
24
|
+
s.sub(/\.?0*$/, units[e])
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/lib/tree_rb/tree_node.rb
CHANGED
@@ -90,7 +90,7 @@ module TreeRb
|
|
90
90
|
end
|
91
91
|
leaf_node
|
92
92
|
end
|
93
|
-
end
|
93
|
+
end # end class << self
|
94
94
|
|
95
95
|
# leaves of this node
|
96
96
|
attr_reader :leaves
|
@@ -249,56 +249,106 @@ module TreeRb
|
|
249
249
|
# TODO: integrate with ansi color
|
250
250
|
# TODO: see dircolors command
|
251
251
|
# http://isthe.com/chongo/tech/comp/ansi_escapes.html
|
252
|
+
|
252
253
|
# puts "\033[2J" # clear screen
|
253
|
-
# puts "aaaa \033[7;31;40m ciao \033[0m"
|
254
254
|
# ESC[K Clear to end of line
|
255
|
+
# puts "aaaa \033[7;31;40m ciao \033[0m"
|
256
|
+
|
257
|
+
|
258
|
+
#
|
259
|
+
# check console character encoding
|
260
|
+
# altre variabili LC_CTYPE
|
261
|
+
# LC_ALL
|
262
|
+
# comando locale
|
263
|
+
# puts "enconding: #{ENV['LANG']}"
|
264
|
+
#
|
265
|
+
|
266
|
+
|
267
|
+
# │ (ascii 179)
|
268
|
+
# ├ (ascii 195)
|
269
|
+
# └ (ascii 192)
|
270
|
+
# ─ (ascii 196)
|
271
|
+
|
255
272
|
|
256
|
-
|
257
|
-
|
273
|
+
BRANCH = '|-- '
|
274
|
+
LAST_BRANCH = '`-- '
|
275
|
+
CONT_1 = "| "
|
276
|
+
CONT_2 = " "
|
277
|
+
|
278
|
+
def to_str(prefix= "", options = { })
|
279
|
+
#TODO: find a more idiomatic mode to assign an array of options
|
280
|
+
tty_color = options[:colorize].nil? ? false : options[:colorize]
|
281
|
+
show_indentation = options[:show_indentation].nil? ? true : options[:show_indentation]
|
282
|
+
str = ""
|
258
283
|
|
259
284
|
# print node itself
|
260
285
|
if root?
|
261
|
-
|
262
|
-
str << ANSI.red{ to_s } << "\n"
|
263
|
-
else
|
264
|
-
str << to_s << "\n"
|
265
|
-
end
|
286
|
+
str << node_content_to_str(content, options)
|
266
287
|
else
|
267
|
-
|
268
|
-
if
|
269
|
-
str <<
|
270
|
-
|
271
|
-
|
288
|
+
|
289
|
+
if show_indentation
|
290
|
+
str << prefix
|
291
|
+
if self.next
|
292
|
+
str << BRANCH
|
293
|
+
else
|
294
|
+
str << LAST_BRANCH
|
295
|
+
end
|
272
296
|
end
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
297
|
+
|
298
|
+
str << node_content_to_str(content, options)
|
299
|
+
if show_indentation
|
300
|
+
prefix += self.next ? CONT_1 : CONT_2
|
277
301
|
end
|
278
|
-
prefix += self.next ? "| " : " "
|
279
302
|
end
|
280
303
|
|
281
304
|
# print leaves
|
282
305
|
@leaves.each do |leaf|
|
283
|
-
|
284
|
-
if
|
285
|
-
str <<
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
else
|
292
|
-
str << leaf.to_s << "\n"
|
306
|
+
|
307
|
+
if show_indentation
|
308
|
+
str << prefix
|
309
|
+
if !leaf.next.nil? or !@children.empty?
|
310
|
+
str << BRANCH
|
311
|
+
else
|
312
|
+
str << LAST_BRANCH
|
313
|
+
end
|
293
314
|
end
|
315
|
+
|
316
|
+
str << leaf_content_to_str(leaf.content, options)
|
294
317
|
end
|
295
318
|
|
296
319
|
# print children
|
297
320
|
@children.each do |child|
|
298
|
-
str << child.to_str(prefix,
|
321
|
+
str << child.to_str(prefix, options)
|
299
322
|
end
|
300
323
|
str
|
301
324
|
end
|
302
325
|
|
303
|
-
|
304
|
-
|
326
|
+
def self.method_added(s)
|
327
|
+
if s == :to_str
|
328
|
+
puts "Warning: you should not override method 'to_str'"
|
329
|
+
else
|
330
|
+
super
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
private
|
335
|
+
|
336
|
+
def node_content_to_str(content, options)
|
337
|
+
if options[:tty_color]
|
338
|
+
"#{ANSI.red { content }}\n"
|
339
|
+
else
|
340
|
+
"#{content}\n"
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
def leaf_content_to_str(content, options)
|
345
|
+
if options[:tty_color]
|
346
|
+
"#{ANSI.green { content }}\n"
|
347
|
+
else
|
348
|
+
"#{content}\n"
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
|
353
|
+
end # end class
|
354
|
+
end # end module TreeRb
|
data/lib/tree_rb/version.rb
CHANGED
@@ -1,11 +1,51 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
module TreeRb
|
3
3
|
|
4
|
+
#
|
5
|
+
# contains informataion related to directory (TreeNode)
|
6
|
+
#
|
7
|
+
class ContentDir
|
8
|
+
def initialize( basename, options )
|
9
|
+
@basename = basename
|
10
|
+
@options = options
|
11
|
+
end
|
12
|
+
def to_str
|
13
|
+
@basename
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# contains information related to file (LeafNode)
|
19
|
+
#
|
20
|
+
class ContentFile
|
21
|
+
def initialize( pathname, options )
|
22
|
+
stat = File.lstat(pathname)
|
23
|
+
# stat.symlink?
|
24
|
+
|
25
|
+
if options[:show_size]
|
26
|
+
str = "#{File.basename(pathname)} #{stat.size}"
|
27
|
+
elsif options[:show_size_human]
|
28
|
+
str = "#{File.basename(pathname)} #{stat.size.to_human}"
|
29
|
+
else
|
30
|
+
str = "#{File.basename(pathname)}"
|
31
|
+
end
|
32
|
+
|
33
|
+
if options[:show_md5]
|
34
|
+
str << " #{MD5.file( pathname ).hexdigest}"
|
35
|
+
end
|
36
|
+
@str = str
|
37
|
+
|
38
|
+
end
|
39
|
+
def to_str
|
40
|
+
@str
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
4
44
|
#
|
5
45
|
# Builds a TreeNode from a filesystem directory
|
6
46
|
# It similar to CloneTreeNodeVisitor
|
7
47
|
#
|
8
|
-
class BuildDirTreeVisitor
|
48
|
+
class BuildDirTreeVisitor
|
9
49
|
|
10
50
|
attr_reader :root
|
11
51
|
|
@@ -19,23 +59,22 @@ module TreeRb
|
|
19
59
|
# @see AbsNode#nr_leaves
|
20
60
|
#
|
21
61
|
attr_reader :nr_files
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
def initialize
|
26
|
-
super
|
62
|
+
|
63
|
+
def initialize(options = {})
|
27
64
|
@root = nil
|
28
65
|
@stack = []
|
29
66
|
@nr_directories = 0
|
30
67
|
@nr_files = 0
|
68
|
+
@options = options
|
31
69
|
end
|
32
70
|
|
33
71
|
def enter_node( pathname )
|
72
|
+
content = ContentDir.new(File.basename( pathname ), @options)
|
34
73
|
if @stack.empty?
|
35
|
-
tree_node = TreeNode.new(
|
74
|
+
tree_node = TreeNode.new( content )
|
36
75
|
@root = tree_node
|
37
76
|
else
|
38
|
-
tree_node = TreeNode.new(
|
77
|
+
tree_node = TreeNode.new( content, @stack.last )
|
39
78
|
end
|
40
79
|
@nr_directories += 1
|
41
80
|
@stack.push( tree_node )
|
@@ -49,16 +88,10 @@ module TreeRb
|
|
49
88
|
end
|
50
89
|
|
51
90
|
def visit_leaf( pathname )
|
52
|
-
@
|
91
|
+
content = ContentFile.new(pathname, @options)
|
53
92
|
# connect the leaf_node created to the last tree_node on the stack
|
54
|
-
|
55
|
-
|
56
|
-
if show_size
|
57
|
-
str = "#{File.basename(pathname)} #{stat.size}"
|
58
|
-
else
|
59
|
-
str = "#{File.basename(pathname)}"
|
60
|
-
end
|
61
|
-
LeafNode.new( str, @stack.last )
|
93
|
+
@nr_files += 1
|
94
|
+
LeafNode.new( content, @stack.last )
|
62
95
|
end
|
63
96
|
|
64
97
|
end
|
data/lib/tree_rb_cli.rb
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
|
2
3
|
#
|
3
|
-
#
|
4
|
+
# stdlib
|
4
5
|
#
|
5
|
-
|
6
6
|
require 'optparse'
|
7
|
-
|
7
|
+
|
8
|
+
#
|
9
|
+
# gem
|
10
|
+
#
|
8
11
|
|
9
12
|
begin
|
10
|
-
require 'Win32/Console/ANSI'
|
13
|
+
require 'Win32/Console/ANSI'
|
11
14
|
rescue LoadError
|
12
15
|
puts 'You must gem install win32console to use color on Windows'
|
13
16
|
end
|
14
17
|
|
15
18
|
#
|
16
|
-
#
|
19
|
+
# tree_rb cli
|
17
20
|
#
|
21
|
+
require 'tree_rb'
|
18
22
|
require "tree_rb/cli/cli_tree"
|
data/lib/tree_visitor.rb
CHANGED
data/lib/treevisitor.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
require "stringio"
|
6
6
|
|
7
7
|
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
8
|
-
require '
|
9
|
-
require '
|
8
|
+
require 'tree_rb'
|
9
|
+
require 'tree_rb_cli'
|
10
10
|
include TreeRb
|
11
11
|
|
12
12
|
FIXTURES = File.expand_path( File.join( File.dirname(__FILE__), "fixtures" ) )
|
@@ -7,26 +7,22 @@ describe "Tree Node Dsl Derived Class with n-arg constructor" do
|
|
7
7
|
attr_reader :description
|
8
8
|
|
9
9
|
def initialize(name, description, parent)
|
10
|
-
|
11
|
-
|
10
|
+
content = "a: #{description}"
|
11
|
+
super(content, parent)
|
12
|
+
@description = description
|
12
13
|
end
|
13
14
|
|
14
|
-
def to_s
|
15
|
-
"a: #{description}"
|
16
|
-
end
|
17
15
|
end
|
18
16
|
|
19
17
|
class ArgsLeafNode < LeafNode
|
20
18
|
attr_reader :description
|
21
19
|
|
22
20
|
def initialize(name, description, parent)
|
23
|
-
|
24
|
-
|
21
|
+
content = "a: #{description}"
|
22
|
+
super(content, parent)
|
23
|
+
@description = description
|
25
24
|
end
|
26
25
|
|
27
|
-
def to_s
|
28
|
-
"a: #{description}"
|
29
|
-
end
|
30
26
|
end
|
31
27
|
|
32
28
|
it "test_derivated_args" do
|
@@ -4,14 +4,14 @@ require File.join(File.dirname(__FILE__), "..", "spec_helper")
|
|
4
4
|
describe "Tree Node Dsl Derived Class with no-arg constructor " do
|
5
5
|
|
6
6
|
class DTreeNode < TreeNode
|
7
|
-
def
|
8
|
-
"dt: #{
|
7
|
+
def content
|
8
|
+
"dt: #{super}"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
class DLeafNode < LeafNode
|
13
|
-
def
|
14
|
-
"dl: #{
|
13
|
+
def content
|
14
|
+
"dl: #{super}"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -26,7 +26,7 @@ describe "Tree Node Dsl Derived Class with no-arg constructor " do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
|
29
|
+
puts tree.to_str
|
30
30
|
out =<<EOS
|
31
31
|
dt: root
|
32
32
|
|-- dl: l1
|
data/tree.rb.gemspec
CHANGED
@@ -26,10 +26,18 @@ An example of DSL to build tree:
|
|
26
26
|
</pre>
|
27
27
|
EOF
|
28
28
|
|
29
|
-
gem.authors =
|
29
|
+
gem.authors = %w{ Tokiro }
|
30
30
|
gem.email = "tokiro.oyama@gmail.com"
|
31
31
|
gem.homepage = "http://github.com/tokiro/tree.rb"
|
32
|
-
|
32
|
+
|
33
|
+
gem.post_install_message = %q{
|
34
|
+
|
35
|
+
Thank you to have installed tree.rb, any feedback is appreciated.
|
36
|
+
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
gem.require_paths = %w{ lib }
|
33
41
|
|
34
42
|
#
|
35
43
|
# dependencies
|
@@ -38,6 +46,10 @@ An example of DSL to build tree:
|
|
38
46
|
gem.add_runtime_dependency(%q<json>, [">= 0"])
|
39
47
|
gem.add_runtime_dependency(%q<ansi>, [">= 0"])
|
40
48
|
|
49
|
+
# win32 depends on win32console.gem but this must be installed from ext/mkrf_conf.rb
|
50
|
+
# gem.add_runtime_dependency(%q<win32console>, [">= 0"])
|
51
|
+
#
|
52
|
+
|
41
53
|
gem.add_development_dependency(%q<rake>, [">= 0"])
|
42
54
|
gem.add_development_dependency(%q<yard>, [">= 0"])
|
43
55
|
gem.add_development_dependency(%q<bundler>, [">= 0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tree.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.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: 2012-08-
|
12
|
+
date: 2012-08-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -124,63 +124,66 @@ files:
|
|
124
124
|
- Rakefile
|
125
125
|
- tree.rb.gemspec
|
126
126
|
- .gemtest
|
127
|
-
- lib/
|
127
|
+
- lib/treevisitor_cli.rb
|
128
128
|
- lib/tree_visitor.rb
|
129
|
-
- lib/
|
129
|
+
- lib/tree_rb/cli/cli_tree.rb
|
130
130
|
- lib/tree_rb/util/dir_processor.rb
|
131
|
-
- lib/tree_rb/abs_node.rb
|
132
|
-
- lib/tree_rb/version.rb
|
133
131
|
- lib/tree_rb/directory_walker.rb
|
134
|
-
- lib/tree_rb/
|
135
|
-
- lib/tree_rb/basic_tree_node_visitor.rb
|
136
|
-
- lib/tree_rb/tree_node_visitor.rb
|
137
|
-
- lib/tree_rb/cli/cli_tree.rb
|
138
|
-
- lib/tree_rb/visitors/block_tree_node_visitor.rb
|
139
|
-
- lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
|
140
|
-
- lib/tree_rb/visitors/clone_tree_node_visitor.rb
|
132
|
+
- lib/tree_rb/visitors/print_dir_tree_visitor.rb
|
141
133
|
- lib/tree_rb/visitors/build_dir_tree_visitor.rb
|
142
|
-
- lib/tree_rb/visitors/directory_to_hash_visitor.rb
|
143
134
|
- lib/tree_rb/visitors/depth_tree_node_visitor.rb
|
144
|
-
- lib/tree_rb/visitors/callback_tree_node_visitor2.rb
|
145
135
|
- lib/tree_rb/visitors/print_tree_node_visitor.rb
|
146
|
-
- lib/tree_rb/visitors/
|
136
|
+
- lib/tree_rb/visitors/callback_tree_node_visitor2.rb
|
137
|
+
- lib/tree_rb/visitors/directory_to_hash_visitor.rb
|
138
|
+
- lib/tree_rb/visitors/flat_print_tree_node_visitors.rb
|
139
|
+
- lib/tree_rb/visitors/block_tree_node_visitor.rb
|
140
|
+
- lib/tree_rb/visitors/clone_tree_node_visitor.rb
|
141
|
+
- lib/tree_rb/abs_node.rb
|
142
|
+
- lib/tree_rb/extension_numeric.rb
|
147
143
|
- lib/tree_rb/leaf_node.rb
|
144
|
+
- lib/tree_rb/tree_node_visitor.rb
|
145
|
+
- lib/tree_rb/tree_node.rb
|
146
|
+
- lib/tree_rb/basic_tree_node_visitor.rb
|
147
|
+
- lib/tree_rb/version.rb
|
148
|
+
- lib/tree_rb/extension_md5.rb
|
149
|
+
- lib/treevisitor.rb
|
148
150
|
- lib/tree_rb.rb
|
149
|
-
- lib/
|
151
|
+
- lib/tree_rb_cli.rb
|
150
152
|
- tasks/rspec.rake
|
151
153
|
- tasks/yard.rake
|
154
|
+
- examples/directory_walker/print_files.rb
|
152
155
|
- examples/directory_walker/directory_without_subdirectory.rb
|
153
156
|
- examples/directory_walker/find_files.rb
|
154
|
-
- examples/
|
155
|
-
- examples/protovis/treevisitor.js
|
157
|
+
- examples/protovis/treevisitor.png
|
156
158
|
- examples/protovis/protovis-r3.2.js
|
157
159
|
- examples/protovis/index.html
|
158
|
-
- examples/protovis/treevisitor.
|
160
|
+
- examples/protovis/treevisitor.js
|
159
161
|
- examples/protovis/directory_to_json_visitor.rb
|
160
|
-
- spec/
|
161
|
-
- spec/tree_rb/util/dir_processor_spec.rb
|
162
|
-
- spec/tree_rb/tree_node_spec.rb
|
163
|
-
- spec/tree_rb/directory_walker_spec.rb
|
164
|
-
- spec/tree_rb/tree_dsl_spec.rb
|
165
|
-
- spec/tree_rb/tree_dsl_with_derived_class1_spec.rb
|
162
|
+
- spec/spec_helper.rb
|
166
163
|
- spec/tree_rb/cli/cli_tree_spec.rb
|
164
|
+
- spec/tree_rb/util/dir_processor_spec.rb
|
167
165
|
- spec/tree_rb/visitors/depth_tree_node_visitor_spec.rb
|
168
|
-
- spec/tree_rb/visitors/tree_node_visitors_spec.rb
|
169
|
-
- spec/tree_rb/visitors/block_tree_node_visitor_spec.rb
|
170
166
|
- spec/tree_rb/visitors/callback_tree_node_visitor2_spec.rb
|
167
|
+
- spec/tree_rb/visitors/block_tree_node_visitor_spec.rb
|
168
|
+
- spec/tree_rb/visitors/tree_node_visitors_spec.rb
|
171
169
|
- spec/tree_rb/tree_dsl_with_derived_class_spec.rb
|
170
|
+
- spec/tree_rb/directory_walker_spec.rb
|
171
|
+
- spec/tree_rb/tree_dsl_spec.rb
|
172
|
+
- spec/tree_rb/tree_node_paths_spec.rb
|
173
|
+
- spec/tree_rb/tree_dsl_with_derived_class1_spec.rb
|
172
174
|
- spec/tree_rb/tree_node_visitor_delegate_spec.rb
|
175
|
+
- spec/tree_rb/tree_node_spec.rb
|
173
176
|
- spec/tree_rb/tree_node_visitor_dsl_spec.rb
|
174
|
-
- spec/spec_helper.rb
|
175
|
-
- spec/fixtures/test_dir_1/dir.2/file.2.1
|
176
|
-
- spec/fixtures/test_dir_1/dir.1/file.1.1
|
177
177
|
- spec/fixtures/test_dir_1/dir.1/dir.1.2/file.1.2.1
|
178
|
+
- spec/fixtures/test_dir_1/dir.1/file.1.1
|
179
|
+
- spec/fixtures/test_dir_1/dir.2/file.2.1
|
178
180
|
- spec/fixtures/test_dir_2/[Dsube]/sub/.gitkeep
|
179
181
|
- spec/fixtures/test_dir_1/.dir_with_dot/dummy.txt
|
180
182
|
- bin/tree.rb
|
181
183
|
homepage: http://github.com/tokiro/tree.rb
|
182
184
|
licenses: []
|
183
|
-
post_install_message:
|
185
|
+
post_install_message: ! "\n\n Thank you to have installed tree.rb, any feedback is
|
186
|
+
appreciated.\n\n"
|
184
187
|
rdoc_options: []
|
185
188
|
require_paths:
|
186
189
|
- lib
|
@@ -190,18 +193,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
193
|
- - ! '>='
|
191
194
|
- !ruby/object:Gem::Version
|
192
195
|
version: '0'
|
193
|
-
segments:
|
194
|
-
- 0
|
195
|
-
hash: 3293516785273926334
|
196
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
197
|
none: false
|
198
198
|
requirements:
|
199
199
|
- - ! '>='
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
|
-
segments:
|
203
|
-
- 0
|
204
|
-
hash: 3293516785273926334
|
205
202
|
requirements: []
|
206
203
|
rubyforge_project:
|
207
204
|
rubygems_version: 1.8.24
|
@@ -210,24 +207,24 @@ specification_version: 3
|
|
210
207
|
summary: tree.rb is a 'clone' of tree unix command. The gem implements a library to
|
211
208
|
mange tree structures.
|
212
209
|
test_files:
|
213
|
-
- spec/
|
214
|
-
- spec/tree_rb/util/dir_processor_spec.rb
|
215
|
-
- spec/tree_rb/tree_node_spec.rb
|
216
|
-
- spec/tree_rb/directory_walker_spec.rb
|
217
|
-
- spec/tree_rb/tree_dsl_spec.rb
|
218
|
-
- spec/tree_rb/tree_dsl_with_derived_class1_spec.rb
|
210
|
+
- spec/spec_helper.rb
|
219
211
|
- spec/tree_rb/cli/cli_tree_spec.rb
|
212
|
+
- spec/tree_rb/util/dir_processor_spec.rb
|
220
213
|
- spec/tree_rb/visitors/depth_tree_node_visitor_spec.rb
|
221
|
-
- spec/tree_rb/visitors/tree_node_visitors_spec.rb
|
222
|
-
- spec/tree_rb/visitors/block_tree_node_visitor_spec.rb
|
223
214
|
- spec/tree_rb/visitors/callback_tree_node_visitor2_spec.rb
|
215
|
+
- spec/tree_rb/visitors/block_tree_node_visitor_spec.rb
|
216
|
+
- spec/tree_rb/visitors/tree_node_visitors_spec.rb
|
224
217
|
- spec/tree_rb/tree_dsl_with_derived_class_spec.rb
|
218
|
+
- spec/tree_rb/directory_walker_spec.rb
|
219
|
+
- spec/tree_rb/tree_dsl_spec.rb
|
220
|
+
- spec/tree_rb/tree_node_paths_spec.rb
|
221
|
+
- spec/tree_rb/tree_dsl_with_derived_class1_spec.rb
|
225
222
|
- spec/tree_rb/tree_node_visitor_delegate_spec.rb
|
223
|
+
- spec/tree_rb/tree_node_spec.rb
|
226
224
|
- spec/tree_rb/tree_node_visitor_dsl_spec.rb
|
227
|
-
- spec/spec_helper.rb
|
228
|
-
- spec/fixtures/test_dir_1/dir.2/file.2.1
|
229
|
-
- spec/fixtures/test_dir_1/dir.1/file.1.1
|
230
225
|
- spec/fixtures/test_dir_1/dir.1/dir.1.2/file.1.2.1
|
226
|
+
- spec/fixtures/test_dir_1/dir.1/file.1.1
|
227
|
+
- spec/fixtures/test_dir_1/dir.2/file.2.1
|
231
228
|
- spec/fixtures/test_dir_2/[Dsube]/sub/.gitkeep
|
232
229
|
- spec/fixtures/test_dir_1/.dir_with_dot/dummy.txt
|
233
230
|
has_rdoc:
|