tdiff 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ba7729ae82c1c53666417fcf4bc11e8ac808aac3
4
+ data.tar.gz: ea2304121fa503bd0dc4f987939b65193ae5a580
5
+ SHA512:
6
+ metadata.gz: f7b3f28012237e0da54930eaae0250d7e180a2e4d52e5de49109e312bf973669c92fddae940648da166cc2a76d37e92c066c0a980bdf34ed652754dffbcf4bdf
7
+ data.tar.gz: 2d1c0e60dcbe4a007fdab798d848c42cc83df7f1edc4269827539b8d7d9ef10bea6842df949da9b4d2dac4fe135c35a414a6737acdfb759ed61d38675fc5df00
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
+ Gemfile.lock
1
2
  doc/
2
3
  pkg/
@@ -1,3 +1,7 @@
1
+ ### 0.3.4 / 2018-06-11
2
+
3
+ * Fixed shadowed variable warning (@bhollis).
4
+
1
5
  ### 0.3.3 / 2012-05-28
2
6
 
3
7
  * Require ruby >= 1.8.7.
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'rake'
7
+ gem 'rubygems-tasks', '~> 0.1'
8
+
9
+ gem 'rspec', '~> 3.0'
10
+
11
+ gem 'kramdown'
12
+ gem 'yard', '~> 0.9'
13
+ end
data/Rakefile CHANGED
@@ -1,36 +1,11 @@
1
1
  require 'rubygems'
2
- require 'rake'
2
+ require 'rubygems/tasks'
3
+ Gem::Tasks.new
3
4
 
4
- begin
5
- gem 'rubygems-tasks', '~> 0.1'
6
- require 'rubygems/tasks'
7
-
8
- Gem::Tasks.new
9
- rescue LoadError => e
10
- warn e.message
11
- warn "Run `gem install rubygems-tasks` to install 'rubygems/tasks'."
12
- end
13
-
14
- begin
15
- gem 'rspec', '~> 2.4'
16
- require 'rspec/core/rake_task'
17
-
18
- RSpec::Core::RakeTask.new
19
- rescue LoadError => e
20
- task :spec do
21
- abort "Please run `gem install rspec` to install RSpec."
22
- end
23
- end
5
+ require 'rspec/core/rake_task'
6
+ RSpec::Core::RakeTask.new
24
7
  task :test => :spec
25
8
  task :default => :spec
26
9
 
27
- begin
28
- gem 'yard', '~> 0.7'
29
- require 'yard'
30
-
31
- YARD::Rake::YardocTask.new
32
- rescue LoadError => e
33
- task :yard do
34
- abort "Please run `gem install yard` to install YARD."
35
- end
36
- end
10
+ require 'yard'
11
+ YARD::Rake::YardocTask.new
@@ -13,6 +13,4 @@ has_yard: true
13
13
  required_ruby_version: ">= 1.8.7"
14
14
 
15
15
  development_dependencies:
16
- rubygems-tasks: ~> 0.1
17
- rspec: ~> 2.4
18
- yard: ~> 0.7
16
+ bundler: ~> 1.0
@@ -148,7 +148,7 @@ module TDiff
148
148
  changes = nil
149
149
 
150
150
  # recurse down through unchanged nodes
151
- unchanged.each { |x,y| x.tdiff_recursive(y,&block) }
151
+ unchanged.each { |a,b| a.tdiff_recursive(b,&block) }
152
152
  unchanged = nil
153
153
  end
154
154
  end
@@ -1,3 +1,3 @@
1
1
  module TDiff
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
@@ -1,4 +1,3 @@
1
- gem 'rspec', '~> 2.4'
2
1
  require 'rspec'
3
2
 
4
3
  require 'helpers/trees'
@@ -5,36 +5,36 @@ shared_examples_for 'TDiff' do |method|
5
5
  include Helpers::Trees
6
6
 
7
7
  it "should tell if two trees are identical" do
8
- @tree.send(method,@tree).all? { |change,node|
9
- change == ' '
10
- }.should == true
8
+ expect(
9
+ @tree.send(method,@tree).all? { |change,node| change == ' ' }
10
+ ).to be true
11
11
  end
12
12
 
13
13
  it "should stop if the root nodes have changed" do
14
14
  changes = @tree.send(method,@different_root).to_a
15
15
 
16
- changes.length.should == 2
16
+ expect(changes.length).to be 2
17
17
 
18
- changes[0][0].should == '-'
19
- changes[0][1].should == @tree
18
+ expect(changes[0][0]).to be == '-'
19
+ expect(changes[0][1]).to be == @tree
20
20
 
21
- changes[1][0].should == '+'
22
- changes[1][1].should == @different_root
21
+ expect(changes[1][0]).to be == '+'
22
+ expect(changes[1][1]).to be == @different_root
23
23
  end
24
24
 
25
25
  it "should tell when sub-nodes are added" do
26
26
  changes = @tree.send(method,@added).select { |change,node| change == '+' }
27
27
 
28
- changes.length.should == 1
29
- changes[0][0].should == '+'
30
- changes[0][1].should == @added.children[0].children[1]
28
+ expect(changes.length).to be 1
29
+ expect(changes[0][0]).to be == '+'
30
+ expect(changes[0][1]).to be == @added.children[0].children[1]
31
31
  end
32
32
 
33
33
  it "should tell when sub-nodes are removed" do
34
34
  changes = @tree.send(method,@removed).select { |change,node| change == '-' }
35
35
 
36
- changes.length.should == 1
37
- changes[0][0].should == '-'
38
- changes[0][1].should == @tree.children[0].children[1]
36
+ expect(changes.length).to be 1
37
+ expect(changes[0][0]).to be == '-'
38
+ expect(changes[0][1]).to be == @tree.children[0].children[1]
39
39
  end
40
40
  end
@@ -11,24 +11,24 @@ describe TDiff do
11
11
  it "should detect when the order of children has changed" do
12
12
  changes = @tree.tdiff(@changed_order).to_a
13
13
 
14
- changes.length.should == 6
14
+ expect(changes.length).to be == 6
15
15
 
16
- changes[0][0].should == ' '
17
- changes[0][1].should == @tree
16
+ expect(changes[0][0]).to be == ' '
17
+ expect(changes[0][1]).to be == @tree
18
18
 
19
- changes[1][0].should == '-'
20
- changes[1][1].should == @tree.children[0]
19
+ expect(changes[1][0]).to be == '-'
20
+ expect(changes[1][1]).to be == @tree.children[0]
21
21
 
22
- changes[2][0].should == ' '
23
- changes[2][1].should == @tree.children[1]
22
+ expect(changes[2][0]).to be == ' '
23
+ expect(changes[2][1]).to be == @tree.children[1]
24
24
 
25
- changes[3][0].should == '+'
26
- changes[3][1].should == @changed_order.children[1]
25
+ expect(changes[3][0]).to be == '+'
26
+ expect(changes[3][1]).to be == @changed_order.children[1]
27
27
 
28
- changes[4][0].should == ' '
29
- changes[4][1].should == @tree.children[1].children[0]
28
+ expect(changes[4][0]).to be == ' '
29
+ expect(changes[4][1]).to be == @tree.children[1].children[0]
30
30
 
31
- changes[5][0].should == ' '
32
- changes[5][1].should == @tree.children[1].children[1]
31
+ expect(changes[5][0]).to be == ' '
32
+ expect(changes[5][1]).to be == @tree.children[1].children[1]
33
33
  end
34
34
  end
@@ -11,7 +11,7 @@ describe TDiff::Unordered do
11
11
  include TDiff::Unordered
12
12
  end
13
13
 
14
- base.should include(TDiff)
14
+ expect(base).to include(TDiff)
15
15
  end
16
16
 
17
17
  it_should_behave_like 'TDiff', :tdiff_unordered
@@ -21,6 +21,6 @@ describe TDiff::Unordered do
21
21
  change != ' '
22
22
  end
23
23
 
24
- changes.should be_empty
24
+ expect(changes).to be_empty
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,64 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
5
- prerelease:
4
+ version: 0.3.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Postmodern
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-28 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: rubygems-tasks
14
+ name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '0.1'
19
+ version: '1.0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.1'
30
- - !ruby/object:Gem::Dependency
31
- name: rspec
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: '2.4'
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '2.4'
46
- - !ruby/object:Gem::Dependency
47
- name: yard
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: '0.7'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '0.7'
26
+ version: '1.0'
62
27
  description: Calculates the differences between two tree-like structures. Similar
63
28
  to Rubys built-in TSort module.
64
29
  email: postmodern.mod3@gmail.com
@@ -69,12 +34,13 @@ extra_rdoc_files:
69
34
  - LICENSE.txt
70
35
  - README.md
71
36
  files:
72
- - .document
73
- - .gemtest
74
- - .gitignore
75
- - .rspec
76
- - .yardopts
37
+ - ".document"
38
+ - ".gemtest"
39
+ - ".gitignore"
40
+ - ".rspec"
41
+ - ".yardopts"
77
42
  - ChangeLog.md
43
+ - Gemfile
78
44
  - LICENSE.txt
79
45
  - README.md
80
46
  - Rakefile
@@ -93,26 +59,25 @@ files:
93
59
  homepage: https://github.com/postmodern/tdiff#readme
94
60
  licenses:
95
61
  - MIT
62
+ metadata: {}
96
63
  post_install_message:
97
64
  rdoc_options: []
98
65
  require_paths:
99
66
  - lib
100
67
  required_ruby_version: !ruby/object:Gem::Requirement
101
- none: false
102
68
  requirements:
103
- - - ! '>='
69
+ - - ">="
104
70
  - !ruby/object:Gem::Version
105
71
  version: 1.8.7
106
72
  required_rubygems_version: !ruby/object:Gem::Requirement
107
- none: false
108
73
  requirements:
109
- - - ! '>='
74
+ - - ">="
110
75
  - !ruby/object:Gem::Version
111
76
  version: '0'
112
77
  requirements: []
113
78
  rubyforge_project:
114
- rubygems_version: 1.8.24
79
+ rubygems_version: 2.6.14
115
80
  signing_key:
116
- specification_version: 3
81
+ specification_version: 4
117
82
  summary: Calculates the differences between two tree-like structures.
118
83
  test_files: []