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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f7e261523b147248e2f35ab4b15e6f03a12a73b
4
- data.tar.gz: 3f698da159dd70d2946b94f53dae8f90dd697cd7
3
+ metadata.gz: fdfdf184ff5c8adf45d12bd4a112a778846b0de3
4
+ data.tar.gz: f191f447401e874a43b078daa3632f73b5074d0d
5
5
  SHA512:
6
- metadata.gz: 760fa57013b4c92894ef4ec4a993249c19370affa9f4c4c1f18f0ed1f36172bcfcbdd1c23614c24096b1bdc97f919fce7efc097dbd74042e60ae7a677164ec2b
7
- data.tar.gz: b3ef20d96057c89b906fcaaff3e2585ca442cf2bc6fdf62cded6b990eee5f7e874e3ed2b2ff5780e07c74bd32f1e7f6bb42cd3e0afeaaf1514e1606817ae284c
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'
@@ -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
- versions = expand_versions(gem_name, versions)
69
-
70
- error 'Only one version specified. Specify at lease two versions.' \
71
- if versions.size == 1
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 = versions
79
+ @compared_versions = compared_versions
75
80
 
76
- versions.each do |version|
81
+ compared_versions.each do |version|
77
82
  download_gems? ?
78
83
  get_package(gem_name, version) :
79
84
  get_specification(gem_name, version)
@@ -96,7 +96,7 @@ class Gem::Comparator
96
96
  file_has_shebang = DirUtils.file_has_shebang? file
97
97
 
98
98
  if file_has_shebang
99
- " (!) Shebang found: #{DirUtils.file_first_line(file)}"
99
+ " (!) Shebang found: #{DirUtils.file_first_line(file)}"
100
100
  else
101
101
  ''
102
102
  end
@@ -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]+\d{0,1}){0,1}\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
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: 2014-09-30 00:00:00.000000000 Z
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/strzibny/gem-compare
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.1.9
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: