gem-compare 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -29
- data/lib/rubygems/comparator.rb +11 -6
- data/lib/rubygems/comparator/monitor.rb +1 -1
- data/lib/rubygems/comparator/utils.rb +1 -1
- metadata +18 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdfdf184ff5c8adf45d12bd4a112a778846b0de3
|
4
|
+
data.tar.gz: f191f447401e874a43b078daa3632f73b5074d0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2d726d9045cdb74600a57e37d31c6276118a23c8fc735c12282a9f980871ac3b6f08681ae91b367e3441ad6310771bb580161977d3d99a11ccdad0b2a0b39a1
|
7
|
+
data.tar.gz: 25fb2b527a17ab006793063b6797bfc9e6c565cf6cdf721af0cd0d604415d47acf8cb8ac00220599756fb0618a4a0805a11fce96266d78b2ccdf6a69b735f2a4
|
data/Rakefile
CHANGED
@@ -1,34 +1,5 @@
|
|
1
|
-
require 'rubygems/package_task'
|
2
1
|
require 'rake/testtask'
|
3
2
|
require 'rdoc/task'
|
4
|
-
require_relative 'lib/rubygems/comparator'
|
5
|
-
|
6
|
-
gemspec = Gem::Specification.new do |s|
|
7
|
-
s.name = 'gem-compare'
|
8
|
-
s.version = Gem::Comparator::VERSION
|
9
|
-
s.platform = Gem::Platform::RUBY
|
10
|
-
s.summary = 'RubyGems plugin for comparing gem versions'
|
11
|
-
s.description = <<-EOF
|
12
|
-
gem-compare is a RubyGems plugin that helps to compare versions of the given gem.
|
13
|
-
It searches for differences in metadata as well as in files.
|
14
|
-
EOF
|
15
|
-
s.homepage = 'http://github.com/strzibny/gem-compare'
|
16
|
-
s.licenses = ['MIT']
|
17
|
-
s.author = 'Josef Stribny'
|
18
|
-
s.email = 'strzibny@strzibny.name'
|
19
|
-
s.files = FileList['README.md', 'LICENSE', 'Rakefile',
|
20
|
-
'lib/**/*.rb', 'lib/**/**/*.rb', 'test/**/test*.rb']
|
21
|
-
s.required_ruby_version = '>= 2.0.0'
|
22
|
-
s.required_rubygems_version = '>= 2.0.0'
|
23
|
-
s.add_runtime_dependency 'json'
|
24
|
-
s.add_runtime_dependency 'curb'
|
25
|
-
s.add_runtime_dependency 'diffy'
|
26
|
-
s.add_runtime_dependency 'rainbow'
|
27
|
-
s.add_runtime_dependency 'gemnasium-parser'
|
28
|
-
end
|
29
|
-
|
30
|
-
Gem::PackageTask.new gemspec do |pkg|
|
31
|
-
end
|
32
3
|
|
33
4
|
Rake::RDocTask.new do |rd|
|
34
5
|
rd.main = 'README.md'
|
data/lib/rubygems/comparator.rb
CHANGED
@@ -65,15 +65,20 @@ class Gem::Comparator
|
|
65
65
|
|
66
66
|
def compare_versions(gem_name, versions)
|
67
67
|
# Expand versions (<=, >=, ~>) and sort them
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
compared_versions = expand_versions(gem_name, versions)
|
69
|
+
|
70
|
+
if versions.include?('_') && (compared_versions.size == 1)
|
71
|
+
error 'Latest upstream version matches the version given. Nothing to compare.'
|
72
|
+
elsif versions.include?('_') && (compared_versions.size == (versions.size - 1))
|
73
|
+
warn 'Latest upstream version matches one of the versions given.'
|
74
|
+
elsif compared_versions.size == 1
|
75
|
+
error 'Only one version specified. Specify at lease two versions.'
|
76
|
+
end
|
72
77
|
|
73
78
|
# This should match the final versions that has been compared
|
74
|
-
@compared_versions =
|
79
|
+
@compared_versions = compared_versions
|
75
80
|
|
76
|
-
|
81
|
+
compared_versions.each do |version|
|
77
82
|
download_gems? ?
|
78
83
|
get_package(gem_name, version) :
|
79
84
|
get_specification(gem_name, version)
|
@@ -9,7 +9,7 @@ class Gem::Comparator
|
|
9
9
|
SPACE = ' '
|
10
10
|
DEFAULT_INDENT = SPACE*7
|
11
11
|
OPERATORS = ['=', '!=', '>', '<', '>=', '<=', '~>']
|
12
|
-
VERSION_REGEX = /\A(\d+\.){0,}\d+(\.[a-zA-Z]
|
12
|
+
VERSION_REGEX = /\A(\d+\.){0,}\d+(\.[a-zA-Z]+\.{0,1}\d{0,1}){0,1}\z/
|
13
13
|
SPEC_PARAMS = %w[ author
|
14
14
|
authors
|
15
15
|
bindir
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
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.5
|
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: 2015-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: curb
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: diffy
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rainbow
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: gemnasium-parser
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: |2
|
@@ -88,8 +88,8 @@ executables: []
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- README.md
|
92
91
|
- LICENSE
|
92
|
+
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- lib/rubygems/commands/compare_command.rb
|
95
95
|
- lib/rubygems/comparator.rb
|
@@ -114,7 +114,7 @@ files:
|
|
114
114
|
- test/rubygems/comparator/test_utils.rb
|
115
115
|
- test/rubygems/test_gem_commands_compare_command.rb
|
116
116
|
- test/test_helper.rb
|
117
|
-
homepage: http://github.com/
|
117
|
+
homepage: http://github.com/fedora-ruby/gem-compare
|
118
118
|
licenses:
|
119
119
|
- MIT
|
120
120
|
metadata: {}
|
@@ -124,18 +124,19 @@ require_paths:
|
|
124
124
|
- lib
|
125
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- -
|
127
|
+
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: 2.0.0
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
|
-
- -
|
132
|
+
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: 2.0.0
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.2.2
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: RubyGems plugin for comparing gem versions
|
141
141
|
test_files: []
|
142
|
+
has_rdoc:
|