gemdiff 0.9.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/gemdiff/cli.rb +1 -1
- data/lib/gemdiff/gem_updater.rb +22 -8
- data/lib/gemdiff/version.rb +1 -1
- 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: c363b38509d01526333a18f886e606eea6aa90d5
|
4
|
+
data.tar.gz: 3bd784defe3b4b3fe89e14f057258e07c278f43d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abbdfbe899cfc0dec0114f70e8e9b43bceff666d57e67770c311a141565277c4e8531a6a8f860477ed8b74c760df72236c73c7c2c53ef3bd4889b994665ed937
|
7
|
+
data.tar.gz: 73affd9ee6973ec6ac18bdfdba65e1dd083db5298353b763d2bf13315b02fc2021d138bfd75a39151a3b5ef91a671b2eeda3840dc4fd4b4670e8fb485ab3b902
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
`gemdiff` is a command-line tool to find source code for ruby gems.
|
7
7
|
You can compare source code differences between the current version of a gem in your bundle and
|
8
8
|
the latest version of the gem.
|
9
|
-
`gemdiff`
|
9
|
+
`gemdiff` connects gem version management (rubygems + bundler) with source code (GitHub).
|
10
10
|
|
11
11
|
### Why?
|
12
12
|
|
@@ -115,6 +115,8 @@ Author: Tee Parham
|
|
115
115
|
Date: Mon Mar 3 16:38:32 2014 -0700
|
116
116
|
|
117
117
|
Update haml to 4.0.5
|
118
|
+
|
119
|
+
https://github.com/haml/haml/compare/4.0.4...4.0.5
|
118
120
|
|
119
121
|
diff --git a/Gemfile.lock
|
120
122
|
```
|
@@ -157,11 +159,11 @@ $ gemdiff help
|
|
157
159
|
|
158
160
|
### Shortcuts
|
159
161
|
|
160
|
-
You can use abbreviations for any of the above commands. For example, this is equivalent to `gemdiff find
|
162
|
+
You can use abbreviations for any of the above commands. For example, this is equivalent to `gemdiff find pundit`:
|
161
163
|
|
162
164
|
```sh
|
163
|
-
$ gemdiff f
|
164
|
-
|
165
|
+
$ gemdiff f pundit
|
166
|
+
https://github.com/elabs/pundit
|
165
167
|
```
|
166
168
|
|
167
169
|
### What if it didn't work?
|
data/lib/gemdiff/cli.rb
CHANGED
@@ -87,7 +87,7 @@ DESC
|
|
87
87
|
response = ask("\nCommit? (c to commit, r to reset, else do nothing)")
|
88
88
|
if response == "c"
|
89
89
|
gem_updater.commit
|
90
|
-
puts "\n"
|
90
|
+
puts "\n" + colorize_git_output(gem_updater.show)
|
91
91
|
elsif response == "r"
|
92
92
|
puts gem_updater.reset
|
93
93
|
end
|
data/lib/gemdiff/gem_updater.rb
CHANGED
@@ -41,13 +41,15 @@ module Gemdiff
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def git_commit
|
44
|
-
|
45
|
-
|
46
|
-
version = added.split("\n").first.split(" ").last.gsub(/[()]/, "")
|
47
|
-
git_add_and_commit_lockfile version
|
44
|
+
return false if git_added_line.empty?
|
45
|
+
git_add_and_commit_lockfile
|
48
46
|
true
|
49
47
|
end
|
50
48
|
|
49
|
+
def version(changed_line)
|
50
|
+
changed_line.split("\n").first.split(" ").last.gsub(/[()]/, "")
|
51
|
+
end
|
52
|
+
|
51
53
|
# example returns:
|
52
54
|
# + rails (4.2.3)
|
53
55
|
# or
|
@@ -57,12 +59,24 @@ module Gemdiff
|
|
57
59
|
# + activejob (= 4.2.3)
|
58
60
|
# + activejob (4.2.3)
|
59
61
|
# + activejob (= 4.2.3)
|
60
|
-
def
|
61
|
-
`git diff | grep ' #{name} (' | grep '+ '`
|
62
|
+
def git_added_line
|
63
|
+
@added_line ||= `git diff | grep ' #{name} (' | grep '+ '`
|
64
|
+
end
|
65
|
+
|
66
|
+
# example returns:
|
67
|
+
# - json (1.8.1)
|
68
|
+
def git_removed_line
|
69
|
+
`git diff | grep ' #{name} (' | grep '\\- '`
|
70
|
+
end
|
71
|
+
|
72
|
+
def commit_message
|
73
|
+
new_version = version(git_added_line)
|
74
|
+
outdated = OutdatedGem.new(name, new_version, version(git_removed_line))
|
75
|
+
"Update #{name} to #{new_version}\n\n#{outdated.compare_url}"
|
62
76
|
end
|
63
77
|
|
64
|
-
def git_add_and_commit_lockfile
|
65
|
-
`git add Gemfile.lock && git commit -m '
|
78
|
+
def git_add_and_commit_lockfile
|
79
|
+
`git add Gemfile.lock && git commit -m '#{commit_message}'`
|
66
80
|
end
|
67
81
|
|
68
82
|
def git_reset
|
data/lib/gemdiff/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tee Parham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|