Skip to content

Commit 01a50f9

Browse files
authored
Merge pull request #68 from evolve75/cleanup_and_gemfile_update
Cleanup and gemfile update. Releasing 1.0.0
2 parents db48c35 + f8ff7df commit 01a50f9

28 files changed

Lines changed: 821 additions & 824 deletions

.travis.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,18 @@ before_install:
77
bundler_args: --without development
88

99
rvm:
10-
- 1.8.7
11-
- 1.9.2
12-
- 1.9.3
13-
- 2.0.0
14-
- 2.2.1
15-
# - ruby-head # The latest Ruby, whatever version it happens to be.
16-
# - jruby-18mode
17-
# - jruby-19mode
18-
10+
- 2.2.9
11+
- 2.3.6
12+
- 2.4.3
1913

2014
matrix:
2115
allow_failures:
2216
- rvm: rbx # rbx is still troublesome.
2317
include:
2418
- rvm: rbx
2519
gemfile: gemfiles/Gemfile.rbx
26-
- rvm: 2.1.5
27-
env: COVERAGE=true
20+
# - rvm: 2.4.3 #
21+
# env: COVERAGE=true #
2822
exclude:
2923
- rvm: rbx
3024
gemfile: Gemfile

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ source 'https://rubygems.org'
44
gemspec
55

66
group :development, :test do
7-
gem "rake", "~> 10.4"
8-
gem "test-unit", "~> 3.0"
9-
gem "coveralls", ">= 0.7", :require => false, :platforms => :mri_21
10-
gem "rspec", ">= 3.4"
7+
gem 'rake', '~> 10.4'
8+
gem 'test-unit', '~> 3.0'
9+
gem 'coveralls', '>= 0.7', :require => false, :platforms => :mri_21
10+
gem 'rspec', '>= 3.4'
1111
end
1212

1313
# Local Variables:

Gemfile.lock

Lines changed: 37 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,68 @@
11
PATH
22
remote: .
33
specs:
4-
rubytree (0.9.7)
5-
json (~> 1.8)
6-
structured_warnings (~> 0.2)
4+
rubytree (1.0.0)
5+
json (~> 2.1)
6+
structured_warnings (~> 0.3)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
coveralls (0.8.10)
12-
json (~> 1.8)
13-
rest-client (>= 1.6.8, < 2)
14-
simplecov (~> 0.11.0)
11+
coveralls (0.8.21)
12+
json (>= 1.8, < 3)
13+
simplecov (~> 0.14.1)
1514
term-ansicolor (~> 1.3)
16-
thor (~> 0.19.1)
17-
tins (~> 1.6.0)
18-
diff-lcs (1.2.5)
15+
thor (~> 0.19.4)
16+
tins (~> 1.6)
17+
diff-lcs (1.3)
1918
docile (1.1.5)
20-
domain_name (0.5.25)
21-
unf (>= 0.0.5, < 1.0.0)
22-
http-cookie (1.0.2)
23-
domain_name (~> 0.5)
24-
json (1.8.3)
25-
mime-types (2.99)
26-
netrc (0.11.0)
27-
power_assert (0.2.6)
28-
rake (10.4.2)
29-
rdoc (4.2.1)
30-
json (~> 1.4)
31-
rest-client (1.8.0)
32-
http-cookie (>= 1.0.2, < 2.0)
33-
mime-types (>= 1.16, < 3.0)
34-
netrc (~> 0.7)
35-
rspec (3.4.0)
36-
rspec-core (~> 3.4.0)
37-
rspec-expectations (~> 3.4.0)
38-
rspec-mocks (~> 3.4.0)
39-
rspec-core (3.4.1)
40-
rspec-support (~> 3.4.0)
41-
rspec-expectations (3.4.0)
19+
json (2.1.0)
20+
power_assert (1.1.1)
21+
rake (10.5.0)
22+
rdoc (6.0.0)
23+
rspec (3.7.0)
24+
rspec-core (~> 3.7.0)
25+
rspec-expectations (~> 3.7.0)
26+
rspec-mocks (~> 3.7.0)
27+
rspec-core (3.7.0)
28+
rspec-support (~> 3.7.0)
29+
rspec-expectations (3.7.0)
4230
diff-lcs (>= 1.2.0, < 2.0)
43-
rspec-support (~> 3.4.0)
44-
rspec-mocks (3.4.0)
31+
rspec-support (~> 3.7.0)
32+
rspec-mocks (3.7.0)
4533
diff-lcs (>= 1.2.0, < 2.0)
46-
rspec-support (~> 3.4.0)
47-
rspec-support (3.4.1)
34+
rspec-support (~> 3.7.0)
35+
rspec-support (3.7.0)
4836
rtags (0.97)
4937
rtagstask (0.0.4)
5038
rtags (> 0.0.0)
51-
simplecov (0.11.1)
39+
simplecov (0.14.1)
5240
docile (~> 1.1.0)
53-
json (~> 1.8)
41+
json (>= 1.8, < 3)
5442
simplecov-html (~> 0.10.0)
55-
simplecov-html (0.10.0)
56-
structured_warnings (0.2.0)
57-
term-ansicolor (1.3.2)
43+
simplecov-html (0.10.2)
44+
structured_warnings (0.3.0)
45+
term-ansicolor (1.6.0)
5846
tins (~> 1.0)
59-
test-unit (3.1.5)
47+
test-unit (3.2.7)
6048
power_assert
61-
thor (0.19.1)
62-
tins (1.6.0)
63-
unf (0.1.4)
64-
unf_ext
65-
unf_ext (0.0.7.1)
66-
yard (0.8.7.6)
49+
thor (0.19.4)
50+
tins (1.16.3)
51+
yard (0.9.12)
6752

6853
PLATFORMS
6954
ruby
7055

7156
DEPENDENCIES
72-
bundler (~> 1.7)
57+
bundler (~> 1.16)
7358
coveralls (>= 0.7)
7459
rake (~> 10.4)
75-
rdoc (~> 4.2)
60+
rdoc (~> 6.0)
7661
rspec (>= 3.4)
7762
rtagstask (~> 0.0)
7863
rubytree!
7964
test-unit (~> 3.0)
80-
yard (~> 0.8)
65+
yard (~> 0.9)
8166

8267
BUNDLED WITH
83-
1.10.2
68+
1.16.0

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
README.md
33
4-
Copyright (C) 2006-2015 Anupam Sengupta (anupamsg@gmail.com)
4+
Copyright (C) 2006-2017 Anupam Sengupta (anupamsg@gmail.com)
55
66
-->
77
# **RubyTree** #
@@ -120,7 +120,7 @@ This example can also be found at
120120

121121
## REQUIREMENTS: ##
122122

123-
* [Ruby][] 1.8.x, 1.9.x, 2.0.x, or 2.1.x.
123+
* [Ruby][] 2.2.x, 2.3.x or 2.4.x
124124

125125

126126
* Run-time Dependencies:
@@ -244,8 +244,8 @@ A big thanks to the following contributors for helping improve **RubyTree**:
244244
[BSD]: http://opensource.org/licenses/bsd-license.php "BSD License"
245245
[Binary tree]: http://en.wikipedia.org/wiki/Binary_tree "Binary Tree Data Structure"
246246
[Bundler]: http://bundler.io "Bundler"
247-
[Comparable]: http://ruby-doc.org/core-1.8.7/Comparable.html "Comparable mix-in"
248-
[Enumerable]: http://ruby-doc.org/core-1.9.3/Enumerable.html "Enumerable mix-in"
247+
[Comparable]: http://ruby-doc.org/core-2.4.2/Comparable.html "Comparable mix-in"
248+
[Enumerable]: http://ruby-doc.org/core-2.4.2/Enumerable.html "Enumerable mix-in"
249249
[JSON]: http://flori.github.com/json "JSON"
250250
[Rake]: https://rubygems.org/gems/rake "Rake"
251251
[Ruby]: http://www.ruby-lang.org "Ruby Programming Language"
@@ -254,7 +254,7 @@ A big thanks to the following contributors for helping improve **RubyTree**:
254254
[breadth-first]: http://en.wikipedia.org/wiki/Breadth-first_search "Breadth-first (level-first) Traversal"
255255
[git]: http://git-scm.com "Git SCM"
256256
[in-order]: http://en.wikipedia.org/wiki/Tree_traversal#In-order "In-order (symmetric) Traversal"
257-
[marshaling]: http://ruby-doc.org/core-1.8.7/Marshal.html "Marshaling in Ruby"
257+
[marshaling]: http://ruby-doc.org/core-2.4.2/Marshal.html "Marshaling in Ruby"
258258
[post-order]: http://en.wikipedia.org/wiki/Tree_traversal#Post-order "Post-ordered Traversal"
259259
[pre-order]: http://en.wikipedia.org/wiki/Tree_traversal#Pre-order "Pre-ordered Traversal"
260260
[rt@github]: http://github.com/evolve75/RubyTree "RubyTree Project Page on Github"

Rakefile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@
3333
#
3434

3535
require 'rubygems'
36-
GEM_SPEC = eval(File.read("rubytree.gemspec")) # Load the gemspec.
36+
GEM_SPEC = eval(File.read('./rubytree.gemspec')) # Load the gemspec.
3737

3838
PKG_NAME = GEM_SPEC.name
3939
PKG_VER = GEM_SPEC.version
4040
GEM_NAME = "#{PKG_NAME}-#{PKG_VER}.gem"
4141

42-
desc "Default Task (Run the tests)"
42+
desc 'Default Task (Run the tests)'
4343
task :default do
44-
if ENV["COVERAGE"]
45-
Rake::Task["test:coverage"].invoke
44+
if ENV['COVERAGE']
45+
Rake::Task['test:coverage'].invoke
4646
else
47-
Rake::Task["test:unit"].invoke
48-
Rake::Task["spec"].invoke
47+
Rake::Task['test:unit'].invoke
48+
Rake::Task['spec'].invoke
4949
end
5050
end
5151

52-
desc "Display the current gem version"
52+
desc 'Display the current gem version'
5353
task :version do
5454
puts "Current Version: #{GEM_NAME}"
5555
end
@@ -59,21 +59,21 @@ task :clean => 'gem:clobber_package'
5959
CLEAN.include('coverage')
6060
task :clobber => [:clean, 'doc:clobber_rdoc', 'doc:clobber_yard']
6161

62-
desc "Open an irb session preloaded with this library"
62+
desc 'Open an irb session preloaded with this library'
6363
task :console do
64-
sh "irb -rubygems -r ./lib/tree.rb"
64+
sh 'irb -rubygems -r ./lib/tree.rb'
6565
end
6666

6767
namespace :doc do # ................................ Documentation
6868
begin
69-
gem 'rdoc', ">= 2.4.2" # To get around a stupid bug in Ruby 1.9.2 Rake.
69+
gem 'rdoc', '>= 2.4.2' # To get around a stupid bug in Ruby 1.9.2 Rake.
7070
require 'rdoc/task'
7171
Rake::RDocTask.new do |rdoc|
7272
rdoc.rdoc_dir = 'rdoc'
7373
rdoc.title = "#{PKG_NAME}-#{PKG_VER}"
7474
rdoc.main = 'README.rdoc'
7575
rdoc.rdoc_files.include(GEM_SPEC.extra_rdoc_files)
76-
rdoc.rdoc_files.include('lib/**/*.rb')
76+
rdoc.rdoc_files.include('./lib/**/*.rb')
7777
end
7878
rescue LoadError
7979
# Oh well.
@@ -83,19 +83,19 @@ namespace :doc do # ................................ Documentation
8383
require 'yard'
8484
YARD::Rake::YardocTask.new do |t|
8585
t.files = ['lib/**/*.rb', '-', GEM_SPEC.extra_rdoc_files]
86-
t.options = ['--no-private', '--embed-mixins']
86+
t.options = %w(--no-private --embed-mixins)
8787
end
8888
rescue LoadError
8989
# Oh well.
9090
end
9191

92-
desc "Remove YARD Documentation"
92+
desc 'Remove YARD Documentation'
9393
task :clobber_yard do
9494
rm_rf 'doc'
9595
end
9696
end
9797

98-
desc "Run the test cases"
98+
desc 'Run the test cases'
9999
task :test => 'test:unit'
100100

101101
namespace :test do # ................................ Test related
@@ -107,23 +107,23 @@ namespace :test do # ................................ Test related
107107
test.verbose = false
108108
end
109109

110-
desc "Run the examples"
110+
desc 'Run the examples'
111111
Rake::TestTask.new(:examples) do |example|
112112
example.libs << 'lib' << 'examples'
113113
example.pattern = 'examples/**/example_*.rb'
114114
example.verbose = true
115115
example.warning = false
116116
end
117117

118-
desc "Run the code coverage"
118+
desc 'Run the code coverage'
119119
task :coverage do
120120
ruby 'test/run_test.rb'
121121
end
122122

123123
begin
124124
require 'rcov/rcovtask'
125125
Rcov::RcovTask.new(:rcov) do |t|
126-
t.libs << "test"
126+
t.libs << 'test'
127127
t.test_files = FileList['test/**/test_*.rb']
128128
t.verbose = true
129129
t.rcov_opts << '--exclude /gems/,/Library/,/usr/,spec,lib/tasks'
@@ -139,7 +139,7 @@ begin # ................................ rspec tests
139139

140140
RSpec::Core::RakeTask.new(:spec) do |t|
141141
t.fail_on_error = false
142-
t.rspec_opts = ["--color", "--format doc"]
142+
t.rspec_opts = ['--color', '--format doc']
143143
end
144144
rescue LoadError
145145
# Cannot load rspec.
@@ -164,7 +164,7 @@ namespace :gem do # ................................ Gem related
164164
pkg.need_tar = true
165165
end
166166

167-
desc "Push the gem into the Rubygems repository"
167+
desc 'Push the gem into the Rubygems repository'
168168
task :push => :gem do
169169
sh "gem push pkg/#{GEM_NAME}"
170170
end

examples/example_basic.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@
2626
require 'tree' # Load the library
2727

2828
# ..... Create the root node first. Note that every node has a name and an optional content payload.
29-
root_node = Tree::TreeNode.new("ROOT", "Root Content")
29+
root_node = Tree::TreeNode.new('ROOT', 'Root Content')
3030
root_node.print_tree
3131

3232
# ..... Now insert the child nodes. Note that you can "chain" the child insertions for a given path to any depth.
33-
root_node << Tree::TreeNode.new("CHILD1", "Child1 Content") << Tree::TreeNode.new("GRANDCHILD1", "GrandChild1 Content")
34-
root_node << Tree::TreeNode.new("CHILD2", "Child2 Content")
33+
root_node << Tree::TreeNode.new('CHILD1', 'Child1 Content') << Tree::TreeNode.new('GRANDCHILD1', 'GrandChild1 Content')
34+
root_node << Tree::TreeNode.new('CHILD2', 'Child2 Content')
3535

3636
# ..... Lets print the representation to stdout. This is primarily used for debugging purposes.
3737
root_node.print_tree
3838

3939
# ..... Lets directly access children and grandchildren of the root. The can be "chained" for a given path to any depth.
40-
child1 = root_node["CHILD1"]
41-
grand_child1 = root_node["CHILD1"]["GRANDCHILD1"]
40+
child1 = root_node['CHILD1']
41+
grand_child1 = root_node['CHILD1']['GRANDCHILD1']
4242

4343
# ..... Now lets retrieve siblings of the current node as an array.
4444
siblings_of_child1 = child1.siblings

lib/rubytree.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3939
#
4040

41-
require "tree.rb"
41+
require 'tree.rb'

0 commit comments

Comments
 (0)