Skip to content

Commit 85f3455

Browse files
authored
Merge pull request #83 from evolve75/next
Release 1.0.1: Updated dependencies and code cleanup
2 parents eb04506 + 3be0e58 commit 85f3455

25 files changed

Lines changed: 736 additions & 802 deletions

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Local configuration for the rubocop linter.

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3
1+
2.7

Gemfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@ source 'https://rubygems.org'
33
# Specify your gem's dependencies in rubytree.gemspec
44
gemspec
55

6-
group :development, :test do
7-
gem 'rake', '>= 13.0.1'
8-
gem 'test-unit', '~> 3.3.6'
9-
gem 'coveralls', '>= 0.8.23', :require => false, :platforms => :mri_21
10-
gem 'rspec', '>= 3.9.0'
11-
gem 'rubocop'
12-
end
13-
146
# Local Variables:
157
# mode: ruby
168
# End:

Gemfile.lock

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,90 +2,96 @@ PATH
22
remote: .
33
specs:
44
rubytree (1.0.1)
5-
json (~> 2.3.1)
5+
json (~> 2.6.1)
66
structured_warnings (~> 0.4.0)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
ast (2.4.1)
11+
ast (2.4.2)
1212
coveralls (0.8.23)
1313
json (>= 1.8, < 3)
1414
simplecov (~> 0.16.1)
1515
term-ansicolor (~> 1.3)
1616
thor (>= 0.19.4, < 2.0)
1717
tins (~> 1.6)
18-
diff-lcs (1.4.4)
19-
docile (1.3.2)
20-
json (2.3.1)
21-
parallel (1.19.2)
22-
parser (2.7.1.4)
18+
diff-lcs (1.5.0)
19+
docile (1.4.0)
20+
json (2.6.1)
21+
parallel (1.21.0)
22+
parser (3.0.3.2)
2323
ast (~> 2.4.1)
24-
power_assert (1.2.0)
24+
power_assert (2.0.1)
25+
psych (4.0.3)
26+
stringio
2527
rainbow (3.0.0)
26-
rake (13.0.1)
27-
rdoc (6.2.1)
28-
regexp_parser (1.7.1)
29-
rexml (3.2.4)
30-
rspec (3.9.0)
31-
rspec-core (~> 3.9.0)
32-
rspec-expectations (~> 3.9.0)
33-
rspec-mocks (~> 3.9.0)
34-
rspec-core (3.9.2)
35-
rspec-support (~> 3.9.3)
36-
rspec-expectations (3.9.2)
28+
rake (13.0.6)
29+
rdoc (6.4.0)
30+
psych (>= 4.0.0)
31+
regexp_parser (2.2.0)
32+
rexml (3.2.5)
33+
rspec (3.10.0)
34+
rspec-core (~> 3.10.0)
35+
rspec-expectations (~> 3.10.0)
36+
rspec-mocks (~> 3.10.0)
37+
rspec-core (3.10.1)
38+
rspec-support (~> 3.10.0)
39+
rspec-expectations (3.10.1)
3740
diff-lcs (>= 1.2.0, < 2.0)
38-
rspec-support (~> 3.9.0)
39-
rspec-mocks (3.9.1)
41+
rspec-support (~> 3.10.0)
42+
rspec-mocks (3.10.2)
4043
diff-lcs (>= 1.2.0, < 2.0)
41-
rspec-support (~> 3.9.0)
42-
rspec-support (3.9.3)
44+
rspec-support (~> 3.10.0)
45+
rspec-support (3.10.3)
4346
rtags (0.97)
4447
rtagstask (0.0.4)
4548
rtags (> 0.0.0)
46-
rubocop (0.90.0)
49+
rubocop (1.24.0)
4750
parallel (~> 1.10)
48-
parser (>= 2.7.1.1)
51+
parser (>= 3.0.0.0)
4952
rainbow (>= 2.2.2, < 4.0)
50-
regexp_parser (>= 1.7)
53+
regexp_parser (>= 1.8, < 3.0)
5154
rexml
52-
rubocop-ast (>= 0.3.0, < 1.0)
55+
rubocop-ast (>= 1.15.0, < 2.0)
5356
ruby-progressbar (~> 1.7)
54-
unicode-display_width (>= 1.4.0, < 2.0)
55-
rubocop-ast (0.3.0)
56-
parser (>= 2.7.1.4)
57-
ruby-progressbar (1.10.1)
57+
unicode-display_width (>= 1.4.0, < 3.0)
58+
rubocop-ast (1.15.1)
59+
parser (>= 3.0.1.1)
60+
ruby-progressbar (1.11.0)
5861
simplecov (0.16.1)
5962
docile (~> 1.1)
6063
json (>= 1.8, < 3)
6164
simplecov-html (~> 0.10.0)
6265
simplecov-html (0.10.2)
66+
stringio (3.0.1)
6367
structured_warnings (0.4.0)
6468
sync (0.5.0)
6569
term-ansicolor (1.7.1)
6670
tins (~> 1.0)
67-
test-unit (3.3.6)
71+
test-unit (3.5.3)
6872
power_assert
69-
thor (1.0.1)
70-
tins (1.25.0)
73+
thor (1.1.0)
74+
tins (1.30.0)
7175
sync
72-
unicode-display_width (1.7.0)
73-
yard (0.9.25)
76+
unicode-display_width (2.1.0)
77+
webrick (1.7.0)
78+
yard (0.9.27)
79+
webrick (~> 1.7.0)
7480

7581
PLATFORMS
7682
ruby
7783

7884
DEPENDENCIES
79-
bundler (~> 2.1.4)
85+
bundler (~> 2.3.4)
8086
coveralls (>= 0.8.23)
81-
rake (>= 13.0.1)
82-
rdoc (~> 6.2.1)
83-
rspec (>= 3.9.0)
87+
rake (>= 13.0.6)
88+
rdoc (>= 6.4.0)
89+
rspec (~> 3.10.0)
8490
rtagstask (~> 0.0.4)
85-
rubocop
91+
rubocop (>= 1.24.0)
8692
rubytree!
87-
test-unit (~> 3.3.6)
88-
yard (~> 0.9.25)
93+
test-unit (>= 3.5.3)
94+
yard (~> 0.9.27)
8995

9096
BUNDLED WITH
91-
2.1.4
97+
2.3.4

Rakefile

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ task :version do
5555
end
5656

5757
require 'rake/clean'
58-
task :clean => 'gem:clobber_package'
58+
task clean: 'gem:clobber_package'
5959
CLEAN.include('coverage')
60-
task :clobber => [:clean, 'doc:clobber_rdoc', 'doc:clobber_yard']
60+
task clobber: [:clean, 'doc:clobber_rdoc', 'doc:clobber_yard']
6161

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

67-
namespace :doc do # ................................ Documentation
67+
namespace :doc do # ................................ Documentation
6868
begin
6969
gem 'rdoc', '>= 2.4.2' # To get around a stupid bug in Ruby 1.9.2 Rake.
7070
require 'rdoc/task'
@@ -83,7 +83,7 @@ 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 = %w(--no-private --embed-mixins)
86+
t.options = %w[--no-private --embed-mixins]
8787
end
8888
rescue LoadError
8989
# Oh well.
@@ -96,10 +96,9 @@ namespace :doc do # ................................ Documentation
9696
end
9797

9898
desc 'Run the test cases'
99-
task :test => 'test:unit'
100-
101-
namespace :test do # ................................ Test related
99+
task test: 'test:unit'
102100

101+
namespace :test do # ................................ Test related
103102
require 'rake/testtask'
104103
Rake::TestTask.new(:unit) do |test|
105104
test.libs << 'lib' << 'test'
@@ -131,10 +130,9 @@ namespace :test do # ................................ Test related
131130
rescue LoadError
132131
# Oh well. Can't have everything.
133132
end
134-
135133
end
136134

137-
begin # ................................ rspec tests
135+
begin # ................................ rspec tests
138136
require 'rspec/core/rake_task'
139137

140138
RSpec::Core::RakeTask.new(:spec) do |t|
@@ -145,17 +143,15 @@ rescue LoadError
145143
# Cannot load rspec.
146144
end
147145

148-
namespace :tag do # ................................ Emacs Tags
149-
begin
150-
require 'rtagstask'
151-
RTagsTask.new(:tags) do |rd|
152-
rd.vi = false
153-
CLEAN.include('TAGS')
154-
end
155-
rescue LoadError
156-
# Oh well. Can't have everything.
146+
namespace :tag do # ................................ Emacs Tags
147+
require 'rtagstask'
148+
RTagsTask.new(:tags) do |rd|
149+
rd.vi = false
150+
CLEAN.include('TAGS')
157151
end
158-
end
152+
rescue LoadError
153+
# Oh well. Can't have everything.
154+
end
159155

160156
namespace :gem do # ................................ Gem related
161157
require 'rubygems/package_task'
@@ -165,7 +161,7 @@ namespace :gem do # ................................ Gem related
165161
end
166162

167163
desc 'Push the gem into the Rubygems repository'
168-
task :push => :gem do
164+
task push: :gem do
169165
sh "gem push pkg/#{GEM_NAME}"
170166
end
171167
end

examples/example_basic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# +---------------+
2424

2525
# ..... Example starts.
26-
require 'tree' # Load the library
26+
require 'tree' # Load the library
2727

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

gemfiles/Gemfile.rbx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
source 'https://rubygems.org'
22

33
# Specify your gem's dependencies in rubytree.gemspec
4-
gemspec :path => '..'
4+
gemspec path: '..'
55

66
platforms :rbx do
7-
gem "rubysl"
8-
gem "rubysl-test-unit"
7+
gem 'rubysl'
8+
gem 'rubysl-test-unit'
99
end
1010

1111
group :development, :test do
12-
gem "rake", "~> 10.1"
12+
gem 'rake', '~> 10.1'
1313
end
1414

1515
# Local Variables:

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'

0 commit comments

Comments
 (0)