tree.rb 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/bin/rtree ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ #require 'rubygems'
4
+
5
+ cwd = File.expand_path( File.join( File.dirname(__FILE__), "..", "lib" ) )
6
+ $:.unshift(cwd) unless $:.include?(cwd)
7
+ require 'tree_rb_cli'
8
+
9
+ include TreeRb
10
+ exit CliTree.run
data/bin/tree_rb ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ #require 'rubygems'
4
+
5
+ cwd = File.expand_path( File.join( File.dirname(__FILE__), "..", "lib" ) )
6
+ $:.unshift(cwd) unless $:.include?(cwd)
7
+ require 'tree_rb_cli'
8
+
9
+ include TreeRb
10
+ exit CliTree.run
data/ext/mkrf_conf.rb ADDED
@@ -0,0 +1,23 @@
1
+ #
2
+ # http://en.wikibooks.org/wiki/Ruby_Programming/RubyGems#How_to_install_different_versions_of_gems_depending_on_which_version_of_ruby_the_installee_is_using
3
+ #
4
+ require 'rubygems'
5
+ require 'rubygems/command.rb'
6
+ require 'rubygems/dependency_installer.rb'
7
+ begin
8
+ Gem::Command.build_args = ARGV
9
+ rescue NoMethodError
10
+ end
11
+ inst = Gem::DependencyInstaller.new
12
+ begin
13
+ if RUBY_PLATFORM =~ /win32/
14
+ inst.install "win32console"
15
+ end
16
+ rescue
17
+ exit(1)
18
+ end
19
+
20
+ f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
21
+ f.write("task :default\n")
22
+ f.close
23
+
@@ -335,17 +335,17 @@ module TreeRb
335
335
 
336
336
  def node_content_to_str(content, options)
337
337
  if options[:tty_color]
338
- "#{ANSI.red { content }}\n"
338
+ "#{ANSI.red { content.to_str }}\n"
339
339
  else
340
- "#{content}\n"
340
+ "#{content.to_str }\n"
341
341
  end
342
342
  end
343
343
 
344
344
  def leaf_content_to_str(content, options)
345
345
  if options[:tty_color]
346
- "#{ANSI.green { content }}\n"
346
+ "#{ANSI.green { content.to_str }}\n"
347
347
  else
348
- "#{content}\n"
348
+ "#{content.to_str }\n"
349
349
  end
350
350
  end
351
351
 
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module TreeRb
3
- VERSION="0.3.3"
3
+ VERSION="0.3.4"
4
4
  end
@@ -0,0 +1,8 @@
1
+ # -*- coding: utf-8 -*-
2
+ require File.expand_path( File.join(File.dirname(__FILE__), "..", "spec_helper") )
3
+ describe "MD5" do
4
+ it "test_simple_md5" do
5
+ file_name = File.expand_path( File.join( File.dirname(__FILE__), "..", "..", "lib", "tree_rb", "extension_md5.rb" ) )
6
+ MD5.file( file_name ).to_s.should == "ccd18527b14ec24ac250cb76f730b2dd"
7
+ end
8
+ end
@@ -0,0 +1,13 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ require File.expand_path( File.join(File.dirname(__FILE__), "..", "spec_helper") )
4
+
5
+ describe "TCNumeric" do
6
+
7
+ it "test_simple" do
8
+ 10.with_separator.should == "10"
9
+ 10.0.with_separator.should == "10.0"
10
+ 1000000.with_separator.should == "1,000,000"
11
+ end
12
+
13
+ end
data/tree.rb.gemspec CHANGED
@@ -31,12 +31,9 @@ An example of DSL to build tree:
31
31
  gem.homepage = "http://github.com/tokiro/tree.rb"
32
32
 
33
33
  gem.post_install_message = %q{
34
-
35
34
  Thank you to have installed tree.rb, any feedback is appreciated.
36
-
37
35
  }
38
36
 
39
-
40
37
  gem.require_paths = %w{ lib }
41
38
 
42
39
  #
@@ -61,6 +58,7 @@ An example of DSL to build tree:
61
58
  # s.files = `git ls-files`.split("\n")
62
59
  # gem.files = `git ls-files`.split($\)
63
60
  gem.files = %w{LICENSE.txt README.md Rakefile tree.rb.gemspec .gemtest}
61
+ gem.files.concat Dir['ext/**/*.rb']
64
62
  gem.files.concat Dir['lib/**/*.rb']
65
63
  gem.files.concat Dir['tasks/**/*.rake']
66
64
  gem.files.concat Dir['examples/**/*']
@@ -70,7 +68,7 @@ An example of DSL to build tree:
70
68
  #
71
69
  # s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
72
70
  # gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
73
- gem.executables = %w{ tree.rb }
71
+ gem.executables = %w{ tree.rb rtree tree_rb }
74
72
 
75
73
 
76
74
  #
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.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -116,6 +116,8 @@ description: ! "(This gem was named as treevisitor)\ntree.rb is a 'clone' of tre
116
116
  email: tokiro.oyama@gmail.com
117
117
  executables:
118
118
  - tree.rb
119
+ - rtree
120
+ - tree_rb
119
121
  extensions: []
120
122
  extra_rdoc_files: []
121
123
  files:
@@ -124,6 +126,7 @@ files:
124
126
  - Rakefile
125
127
  - tree.rb.gemspec
126
128
  - .gemtest
129
+ - ext/mkrf_conf.rb
127
130
  - lib/treevisitor_cli.rb
128
131
  - lib/tree_visitor.rb
129
132
  - lib/tree_rb/cli/cli_tree.rb
@@ -168,7 +171,9 @@ files:
168
171
  - spec/tree_rb/visitors/tree_node_visitors_spec.rb
169
172
  - spec/tree_rb/tree_dsl_with_derived_class_spec.rb
170
173
  - spec/tree_rb/directory_walker_spec.rb
174
+ - spec/tree_rb/extension_md5_spec.rb
171
175
  - spec/tree_rb/tree_dsl_spec.rb
176
+ - spec/tree_rb/extension_numeric_spec.rb
172
177
  - spec/tree_rb/tree_node_paths_spec.rb
173
178
  - spec/tree_rb/tree_dsl_with_derived_class1_spec.rb
174
179
  - spec/tree_rb/tree_node_visitor_delegate_spec.rb
@@ -180,10 +185,12 @@ files:
180
185
  - spec/fixtures/test_dir_2/[Dsube]/sub/.gitkeep
181
186
  - spec/fixtures/test_dir_1/.dir_with_dot/dummy.txt
182
187
  - bin/tree.rb
188
+ - bin/rtree
189
+ - bin/tree_rb
183
190
  homepage: http://github.com/tokiro/tree.rb
184
191
  licenses: []
185
- post_install_message: ! "\n\n Thank you to have installed tree.rb, any feedback is
186
- appreciated.\n\n"
192
+ post_install_message: ! "\n Thank you to have installed tree.rb, any feedback is
193
+ appreciated.\n"
187
194
  rdoc_options: []
188
195
  require_paths:
189
196
  - lib
@@ -216,7 +223,9 @@ test_files:
216
223
  - spec/tree_rb/visitors/tree_node_visitors_spec.rb
217
224
  - spec/tree_rb/tree_dsl_with_derived_class_spec.rb
218
225
  - spec/tree_rb/directory_walker_spec.rb
226
+ - spec/tree_rb/extension_md5_spec.rb
219
227
  - spec/tree_rb/tree_dsl_spec.rb
228
+ - spec/tree_rb/extension_numeric_spec.rb
220
229
  - spec/tree_rb/tree_node_paths_spec.rb
221
230
  - spec/tree_rb/tree_dsl_with_derived_class1_spec.rb
222
231
  - spec/tree_rb/tree_node_visitor_delegate_spec.rb