gem-compare 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE.txt → LICENSE} +8 -10
- data/README.md +141 -16
- data/Rakefile +41 -1
- data/lib/rubygems/commands/compare_command.rb +79 -2
- data/lib/rubygems/comparator.rb +198 -0
- data/lib/rubygems/comparator/base.rb +88 -0
- data/lib/rubygems/comparator/dependency_comparator.rb +111 -0
- data/lib/rubygems/comparator/file_list_comparator.rb +262 -0
- data/lib/rubygems/comparator/gemfile_comparator.rb +150 -0
- data/lib/rubygems/comparator/report.rb +121 -0
- data/lib/rubygems/comparator/spec_comparator.rb +77 -0
- data/lib/rubygems_plugin.rb +0 -7
- data/test/rubygems/comparator/test_dependency_comparator.rb +29 -0
- data/test/rubygems/comparator/test_file_list_comparator.rb +22 -0
- data/test/rubygems/comparator/test_gemfile_comparator.rb +14 -0
- data/test/rubygems/comparator/test_spec_comparator.rb +153 -0
- data/test/rubygems/test_gem_commands_compare_command.rb +34 -0
- data/test/test_helper.rb +20 -0
- metadata +48 -25
- data/.gitignore +0 -17
- data/Gemfile +0 -4
- data/gem-compare.gemspec +0 -23
- data/lib/gem/compare.rb +0 -7
- data/lib/gem/compare/version.rb +0 -5
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rubygems/test_case'
|
2
|
+
require 'rubygems/commands/compare_command'
|
3
|
+
|
4
|
+
class TestGemCommandsCompareCommand < Gem::TestCase
|
5
|
+
def setup
|
6
|
+
super
|
7
|
+
|
8
|
+
@command = Gem::Commands::CompareCommand.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_execute_no_gemfile
|
12
|
+
@command.options[:args] = []
|
13
|
+
|
14
|
+
e = assert_raises Gem::CommandLineError do
|
15
|
+
use_ui @ui do
|
16
|
+
@command.execute
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
assert_match 'Please specify a gem (e.g. gem compare foo VERSION [VERSION ...])', e.message
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_execute_no_patch
|
24
|
+
@command.options[:args] = ['my_gem']
|
25
|
+
|
26
|
+
e = assert_raises Gem::CommandLineError do
|
27
|
+
use_ui @ui do
|
28
|
+
@command.execute
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
assert_match 'Please specify versions you want to compare (e.g. gem compare foo 0.1.0 0.2.0)', e.message
|
33
|
+
end
|
34
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rubygems/test_case'
|
2
|
+
require 'rubygems/comparator'
|
3
|
+
|
4
|
+
class TestGemComparator < Gem::TestCase
|
5
|
+
def setup
|
6
|
+
super
|
7
|
+
|
8
|
+
options = { keep_all: true, log_all: true, no_color: true }
|
9
|
+
versions = ['0.0.1', '0.0.2', '0.0.3', '0.0.4']
|
10
|
+
|
11
|
+
@comparator = Gem::Comparator.new(options)
|
12
|
+
|
13
|
+
Dir.chdir(File.expand_path('gemfiles', File.dirname(__FILE__))) do
|
14
|
+
@comparator.options.merge!({ output: Dir.getwd })
|
15
|
+
@comparator.compare_versions('lorem', versions)
|
16
|
+
end
|
17
|
+
|
18
|
+
@report = @comparator.report
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,61 +1,84 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem-compare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Josef Stribny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: diffy
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rainbow
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
type: :
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- -
|
38
|
+
- - '>='
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
42
|
+
name: gemnasium-parser
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - '>='
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '0'
|
34
|
-
type: :
|
48
|
+
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - '>='
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
41
|
-
description:
|
42
|
-
|
43
|
-
|
55
|
+
description: |2
|
56
|
+
gem-compare is a RubyGems plugin that helps to compare versions of the given gem.
|
57
|
+
It searches for differences in metadata as well as in files.
|
58
|
+
email: strzibny@strzibny.name
|
44
59
|
executables: []
|
45
60
|
extensions: []
|
46
61
|
extra_rdoc_files: []
|
47
62
|
files:
|
48
|
-
- .gitignore
|
49
|
-
- Gemfile
|
50
|
-
- LICENSE.txt
|
51
63
|
- README.md
|
64
|
+
- LICENSE
|
52
65
|
- Rakefile
|
53
|
-
- gem-compare.gemspec
|
54
|
-
- lib/gem/compare.rb
|
55
|
-
- lib/gem/compare/version.rb
|
56
66
|
- lib/rubygems/commands/compare_command.rb
|
67
|
+
- lib/rubygems/comparator.rb
|
68
|
+
- lib/rubygems/comparator/base.rb
|
69
|
+
- lib/rubygems/comparator/dependency_comparator.rb
|
70
|
+
- lib/rubygems/comparator/file_list_comparator.rb
|
71
|
+
- lib/rubygems/comparator/gemfile_comparator.rb
|
72
|
+
- lib/rubygems/comparator/report.rb
|
73
|
+
- lib/rubygems/comparator/spec_comparator.rb
|
57
74
|
- lib/rubygems_plugin.rb
|
58
|
-
|
75
|
+
- test/rubygems/comparator/test_dependency_comparator.rb
|
76
|
+
- test/rubygems/comparator/test_file_list_comparator.rb
|
77
|
+
- test/rubygems/comparator/test_gemfile_comparator.rb
|
78
|
+
- test/rubygems/comparator/test_spec_comparator.rb
|
79
|
+
- test/rubygems/test_gem_commands_compare_command.rb
|
80
|
+
- test/test_helper.rb
|
81
|
+
homepage: http://github.com/strzibny/gem-compare
|
59
82
|
licenses:
|
60
83
|
- MIT
|
61
84
|
metadata: {}
|
@@ -67,16 +90,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
90
|
requirements:
|
68
91
|
- - '>='
|
69
92
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
93
|
+
version: 2.0.0
|
71
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
95
|
requirements:
|
73
96
|
- - '>='
|
74
97
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
98
|
+
version: 2.0.0
|
76
99
|
requirements: []
|
77
100
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.1.9
|
79
102
|
signing_key:
|
80
103
|
specification_version: 4
|
81
|
-
summary:
|
104
|
+
summary: RubyGems plugin for comparing gem versions
|
82
105
|
test_files: []
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/gem-compare.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'gem/compare/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "gem-compare"
|
8
|
-
spec.version = Gem::Compare::VERSION
|
9
|
-
spec.authors = ["sanemat"]
|
10
|
-
spec.email = ["o.gata.ken@gmail.com"]
|
11
|
-
spec.description = %q{Compare gem source code.}
|
12
|
-
spec.summary = %q{Compare gem source code!}
|
13
|
-
spec.homepage = "https://github.com/sanemat/gem-compare"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
end
|
data/lib/gem/compare.rb
DELETED