gemdiff 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/gemdiff/outdated_gem.rb +13 -3
- data/lib/gemdiff/version.rb +1 -1
- data/test/outdated_gem_test.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 787b7db5d33503357d64c6b78073fb118ff7fe4b
|
4
|
+
data.tar.gz: 59443dc79126b937f258ed67d4679ae5e26e2eff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45d4143f50286989cf7fe2b8dafcc4391fa12ae455c541e223545f590706ebcd3de76b26a653a3b3eaee75eacfb37c6c63c0503780526e89386bd13979b5de0b
|
7
|
+
data.tar.gz: aadbb1b076751d398ff25a54f39441e94020ab508e3d388883593d99fd4cd19bddf86666ecb423e96522a8151d4a7803a8751ce98ae7246a81c6e8ef63025599
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# gemdiff
|
2
2
|
|
3
|
-
[![Gem Version](
|
4
|
-
[![Build Status](
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/gemdiff.svg)](http://rubygems.org/gems/gemdiff)
|
4
|
+
[![Build Status](https://api.travis-ci.org/teeparham/gemdiff.svg)](https://travis-ci.org/teeparham/gemdiff)
|
5
5
|
|
6
6
|
`gemdiff` is a command-line utility to find and compare source code repositories
|
7
7
|
associated with ruby gems. It makes it easy to compare source code differences
|
data/lib/gemdiff/outdated_gem.rb
CHANGED
@@ -15,9 +15,7 @@ module Gemdiff
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def set_versions(v_old, v_new)
|
18
|
-
|
19
|
-
@old_version = v_old
|
20
|
-
@new_version = v_new
|
18
|
+
@old_version, @new_version = old_new(v_old, v_new)
|
21
19
|
end
|
22
20
|
|
23
21
|
def missing_versions?
|
@@ -98,5 +96,17 @@ module Gemdiff
|
|
98
96
|
:default
|
99
97
|
end
|
100
98
|
end
|
99
|
+
|
100
|
+
# swap versions if needed
|
101
|
+
def old_new(v_old, v_new)
|
102
|
+
return [v_old, v_new] unless v_old && v_new
|
103
|
+
if v_old == 'master' || (Gem::Version.new(v_old) > Gem::Version.new(v_new))
|
104
|
+
[v_new, v_old]
|
105
|
+
else
|
106
|
+
[v_old, v_new]
|
107
|
+
end
|
108
|
+
rescue ArgumentError
|
109
|
+
[v_old, v_new]
|
110
|
+
end
|
101
111
|
end
|
102
112
|
end
|
data/lib/gemdiff/version.rb
CHANGED
data/test/outdated_gem_test.rb
CHANGED
@@ -95,6 +95,20 @@ module Gemdiff
|
|
95
95
|
assert_equal "1.2.34", gem.old_version
|
96
96
|
assert_equal "2.34.56", gem.new_version
|
97
97
|
end
|
98
|
+
|
99
|
+
it "swaps versions over 10 in the wrong order" do
|
100
|
+
gem = OutdatedGem.new("x")
|
101
|
+
gem.set_versions "1.10.0", "1.9.3"
|
102
|
+
assert_equal "1.9.3", gem.old_version
|
103
|
+
assert_equal "1.10.0", gem.new_version
|
104
|
+
end
|
105
|
+
|
106
|
+
it "swaps versions with master" do
|
107
|
+
gem = OutdatedGem.new("x")
|
108
|
+
gem.set_versions "master", "1.9.3"
|
109
|
+
assert_equal "1.9.3", gem.old_version
|
110
|
+
assert_equal "master", gem.new_version
|
111
|
+
end
|
98
112
|
end
|
99
113
|
|
100
114
|
describe "#master" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tee Parham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|