gemdiff 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gemdiff.gemspec +0 -1
- data/lib/gemdiff/cli.rb +13 -2
- data/lib/gemdiff/gem_updater.rb +4 -0
- data/lib/gemdiff/repo_finder.rb +1 -0
- data/lib/gemdiff/version.rb +1 -1
- data/test/cli_test.rb +1 -0
- data/test/gem_updater_test.rb +15 -0
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d99d8f54e658c4b0e91ba163f040ea78949b8f87
|
4
|
+
data.tar.gz: a463b1e9ff73296086f5634df1d7d64655a01fd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70491a4633618f6d4e6ea23a931980d2ab37a58c580389dc9115989195c3662adb3e56cd8b00681fc52d39dd74154a4b7db40519e789670e3a9f90def9d0c496
|
7
|
+
data.tar.gz: 76d6ebb39cb15f2f137bb9e05de68e98af6e629ed63b6dc199ffb8f9de035847c26f5084524fcfcc01621cf3bf3f577259b5eae2e9b88a9f45bd306ce3e22e5e
|
data/gemdiff.gemspec
CHANGED
data/lib/gemdiff/cli.rb
CHANGED
@@ -2,11 +2,14 @@ require 'thor'
|
|
2
2
|
|
3
3
|
module Gemdiff
|
4
4
|
class CLI < Thor
|
5
|
+
include Thor::Actions
|
5
6
|
include Colorize
|
6
7
|
|
7
8
|
default_task :outdated
|
8
9
|
|
9
10
|
CHECKING_FOR_OUTDATED = "Checking for outdated gems in your bundle..."
|
11
|
+
NOTHING_TO_UPDATE = "Nothing to update."
|
12
|
+
WORKING_DIRECTORY_IS_NOT_CLEAN = "Your working directory is not clean. Please commit or stash before updating."
|
10
13
|
|
11
14
|
desc 'find <gem>', 'Find the github repository URL for a gem'
|
12
15
|
def find(gem_name)
|
@@ -71,10 +74,18 @@ DESC
|
|
71
74
|
|
72
75
|
desc 'update <gem>', 'Update a gem, show a git diff of the update, and commit or reset'
|
73
76
|
def update(name)
|
74
|
-
puts "Updating #{name}..."
|
75
77
|
gem = GemUpdater.new(name)
|
78
|
+
unless gem.clean?
|
79
|
+
puts WORKING_DIRECTORY_IS_NOT_CLEAN
|
80
|
+
end
|
81
|
+
puts "Updating #{name}..."
|
76
82
|
gem.update
|
77
|
-
|
83
|
+
diff_output = colorize_git_output(gem.diff)
|
84
|
+
puts diff_output
|
85
|
+
if diff_output.empty?
|
86
|
+
puts NOTHING_TO_UPDATE
|
87
|
+
return
|
88
|
+
end
|
78
89
|
response = ask("\nCommit? (c to commit, r to reset, else do nothing)")
|
79
90
|
if response == 'c'
|
80
91
|
gem.commit
|
data/lib/gemdiff/gem_updater.rb
CHANGED
data/lib/gemdiff/repo_finder.rb
CHANGED
data/lib/gemdiff/version.rb
CHANGED
data/test/cli_test.rb
CHANGED
data/test/gem_updater_test.rb
CHANGED
@@ -42,5 +42,20 @@ module Gemdiff
|
|
42
42
|
updater.show
|
43
43
|
end
|
44
44
|
end
|
45
|
+
|
46
|
+
describe "#clean?" do
|
47
|
+
it "returns true for empty diff" do
|
48
|
+
updater = GemUpdater.new("x")
|
49
|
+
updater.stubs git_diff: ""
|
50
|
+
assert updater.clean?
|
51
|
+
end
|
52
|
+
|
53
|
+
it "returns false for non-empty diff" do
|
54
|
+
updater = GemUpdater.new("x")
|
55
|
+
updater.stubs git_diff: "something"
|
56
|
+
refute updater.clean?
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
45
60
|
end
|
46
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tee Parham
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: highline
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.6'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.6'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: octokit
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|