gemdiff 0.5.2 → 0.6.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 +27 -24
- data/gemdiff.gemspec +2 -2
- data/lib/gemdiff/cli.rb +6 -5
- data/lib/gemdiff/outdated_gem.rb +1 -1
- data/lib/gemdiff/version.rb +1 -1
- data/test/cli_test.rb +3 -3
- data/test/outdated_gem_test.rb +36 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9699f3b4b148ad62a7299fa51afe728287cff993
|
4
|
+
data.tar.gz: 2d5d1998b59ce66ed9f3d7949cb986a712a4b91d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc276dd4d4dee61f50a6ae2f3caff297a732d55e72cf82a0eb937c72d6980b5b8803369840f6c7ee38be1489fec43d1aec5081faf1c964070f04beb377c4a0a
|
7
|
+
data.tar.gz: bad1aef2a79b5070f6745b5a4370dc602903d19bad7795bb58cb871c73d257d8abfb6c824de00e47551295c22c4d0d02ae6f3079657144d2921179fa81341878
|
data/README.md
CHANGED
@@ -10,16 +10,16 @@ between the current version of a gem in your bundle and the latest version of th
|
|
10
10
|
|
11
11
|
#### Why?
|
12
12
|
|
13
|
-
You want to
|
14
|
-
|
15
|
-
|
13
|
+
You want to view the source code differences between versions of gems when your dependencies are updated.
|
14
|
+
`gemdiff` hides the complexity of the source repository lookup, provides commands to open common github
|
15
|
+
pages, and provides efficient workflow commands that work with a bundled project (see `outdated`, `update`).
|
16
16
|
|
17
17
|
#### How?
|
18
18
|
|
19
|
-
`gemdiff`
|
20
|
-
list your outdated gems. For each outdated gem, it determines your currently used version and
|
21
|
-
update to, and builds a compare view URL with the old and new version tags.
|
22
|
-
|
19
|
+
`gemdiff` finds a repository by inspecting the local (or remote) gemspec, then searching github if needed.
|
20
|
+
It uses bundler to list your outdated gems. For each outdated gem, it determines your currently used version and
|
21
|
+
the version you can update to, and builds a compare view URL with the old and new version tags.
|
22
|
+
It also provides `update` for a simple `bundle update <gem>` and commit workflow.
|
23
23
|
|
24
24
|
## Install
|
25
25
|
|
@@ -31,11 +31,11 @@ gem install gemdiff
|
|
31
31
|
|
32
32
|
### `outdated`
|
33
33
|
|
34
|
-
Runs `bundle outdated --strict`
|
35
|
-
For each outdated gem, it prompts you if you would like to open the compare view
|
36
|
-
|
34
|
+
Runs `bundle outdated --strict` in the current directory.
|
35
|
+
For each outdated gem, it prompts you if you would like to open the compare view for that gem.
|
36
|
+
Enter `y` to review.
|
37
37
|
|
38
|
-
|
38
|
+
`outdated` is the default task, so `gemdiff` with no arguments is the same as `gemdiff outdated`.
|
39
39
|
|
40
40
|
```sh
|
41
41
|
$ cd /your/ruby/project/using/bundler
|
@@ -50,22 +50,23 @@ Outdated gems included in the bundle:
|
|
50
50
|
* sprockets (2.11.0 > 2.10.1)
|
51
51
|
* webmock (1.17.4 > 1.17.3)
|
52
52
|
aws-sdk: 1.35.0 > 1.34.1
|
53
|
-
Open? (y to open, else skip)
|
53
|
+
Open? (y to open, x to exit, else skip)
|
54
54
|
sprockets: 2.11.0 > 2.10.1
|
55
|
-
Open? (y to open, else skip) y
|
55
|
+
Open? (y to open, x to exit, else skip) y
|
56
56
|
webmock: 1.17.4 > 1.17.3
|
57
|
-
Open? (y to open, else skip)
|
57
|
+
Open? (y to open, x to exit, else skip)
|
58
58
|
```
|
59
59
|
|
60
60
|
### `compare`
|
61
61
|
|
62
|
-
|
62
|
+
Open a compare view for an individual outdated gem in your bundle:
|
63
63
|
|
64
64
|
```sh
|
65
65
|
$ gemdiff compare haml
|
66
66
|
```
|
67
67
|
|
68
|
-
You can bypass bundler and query a gem by including the old and new version numbers.
|
68
|
+
You can bypass bundler and query a gem by including the old and new version numbers. This is faster since
|
69
|
+
the `bundle` command to check the versions is skipped.
|
69
70
|
|
70
71
|
For example, open the GitHub compare view in browser for difference between `haml` versions 4.0.4 and 4.0.5:
|
71
72
|
|
@@ -73,7 +74,7 @@ For example, open the GitHub compare view in browser for difference between `ham
|
|
73
74
|
$ gemdiff compare haml 4.0.4 4.0.5
|
74
75
|
```
|
75
76
|
|
76
|
-
You can compare
|
77
|
+
You can compare a version with a branch name:
|
77
78
|
|
78
79
|
```sh
|
79
80
|
$ gemdiff compare arel 4.0.2 master
|
@@ -81,7 +82,7 @@ $ gemdiff compare arel 4.0.2 master
|
|
81
82
|
|
82
83
|
### `find`
|
83
84
|
|
84
|
-
Lookup the repository URL using the gemspec. If a GitHub URL is not found,
|
85
|
+
Lookup the repository URL using the gemspec. If a GitHub URL is not found, query the GitHub search API.
|
85
86
|
|
86
87
|
```sh
|
87
88
|
$ gemdiff find haml
|
@@ -104,12 +105,12 @@ Open the repository's release history page:
|
|
104
105
|
$ gemdiff releases haml
|
105
106
|
```
|
106
107
|
|
107
|
-
### `
|
108
|
+
### `master`
|
108
109
|
|
109
110
|
Open the repository's master branch commit history page:
|
110
111
|
|
111
112
|
```sh
|
112
|
-
$ gemdiff
|
113
|
+
$ gemdiff master haml
|
113
114
|
```
|
114
115
|
|
115
116
|
### `update`
|
@@ -171,11 +172,13 @@ is not helpful.
|
|
171
172
|
|
172
173
|
2. The GitHub repository must have tagged releases to show compare views.
|
173
174
|
|
174
|
-
3. The versions must be tagged using the standard name format of v1.2.3. If you find
|
175
|
-
a non-standard
|
175
|
+
3. The versions must be tagged using the standard name format of v1.2.3. If you find gems that follow
|
176
|
+
a non-standard format (such as 1.2.3), please open an issue or submit a pull request.
|
177
|
+
See [`lib/gemdiff/outdated_gem.rb`](https://github.com/teeparham/gemdiff/blob/master/lib/gemdiff/outdated_gem.rb).
|
176
178
|
|
177
179
|
4. Encourage gem maintainers to either enter the GitHub repository URL in the `homepage` field of their gemspec,
|
178
180
|
or anywhere in the description. `gemdiff` is much faster if so, and if not, it guesses the best match using
|
179
|
-
the GitHub search API.
|
181
|
+
the GitHub search API. If you find exceptions, open an issue or submit a pull request.
|
182
|
+
See [`lib/gemdiff/repo_finder.rb`](https://github.com/teeparham/gemdiff/blob/master/lib/gemdiff/repo_finder.rb).
|
180
183
|
|
181
|
-
5. Some gems' source code is not on
|
184
|
+
5. Some gems' source code is not on GitHub (gasp!). `gemdiff` could support other source hosts. Submit a pull request!
|
data/gemdiff.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Gemdiff::VERSION
|
9
9
|
spec.authors = ["Tee Parham"]
|
10
10
|
spec.email = ["tee@neighborland.com"]
|
11
|
-
spec.summary = %q{
|
12
|
-
spec.description = %q{Command-line utility to find source
|
11
|
+
spec.summary = %q{Find source repositories for ruby gems. Open, compare, and update outdated gem versions}
|
12
|
+
spec.description = %q{Command-line utility to find source repositories for ruby gems, open common github pages, compare gem versions, and simplify gem update workflow in git}
|
13
13
|
spec.homepage = "https://github.com/teeparham/gemdiff"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/lib/gemdiff/cli.rb
CHANGED
@@ -34,13 +34,13 @@ module Gemdiff
|
|
34
34
|
gem.releases
|
35
35
|
end
|
36
36
|
|
37
|
-
desc '
|
38
|
-
def
|
37
|
+
desc 'master <gem>', 'Open the github master branch commits page for a gem'
|
38
|
+
def master(gem_name)
|
39
39
|
gem = find(gem_name)
|
40
|
-
gem.
|
40
|
+
gem.master
|
41
41
|
end
|
42
42
|
|
43
|
-
desc 'compare <gem> [<
|
43
|
+
desc 'compare <gem> [<old> <new>]', <<DESC
|
44
44
|
Compare gem versions. Opens the compare view between the specified new and old versions.
|
45
45
|
If versions are not specified, your bundle is inspected and the latest version of the
|
46
46
|
gem is compared with the current version in your bundle.
|
@@ -67,8 +67,9 @@ DESC
|
|
67
67
|
puts inspector.outdated
|
68
68
|
inspector.list.each do |gem|
|
69
69
|
puts gem.compare_message
|
70
|
-
response = ask("Open? (y to open, else skip)")
|
70
|
+
response = ask("Open? (y to open, x to exit, else skip)")
|
71
71
|
gem.compare if response == 'y'
|
72
|
+
return if response == 'x'
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
data/lib/gemdiff/outdated_gem.rb
CHANGED
data/lib/gemdiff/version.rb
CHANGED
data/test/cli_test.rb
CHANGED
@@ -38,12 +38,12 @@ module Gemdiff
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
describe "#
|
41
|
+
describe "#master" do
|
42
42
|
it "opens commits page" do
|
43
43
|
gem = mock_gem("haml")
|
44
44
|
@cli.expects(:puts).with("http://github.com/haml/haml")
|
45
|
-
gem.expects :
|
46
|
-
@cli.
|
45
|
+
gem.expects :master
|
46
|
+
@cli.master "haml"
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
data/test/outdated_gem_test.rb
CHANGED
@@ -96,5 +96,41 @@ module Gemdiff
|
|
96
96
|
assert_equal "2.34.56", gem.new_version
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
describe "#master" do
|
101
|
+
it "opens master commits url" do
|
102
|
+
gem = OutdatedGem.new("x")
|
103
|
+
gem.stubs repo: "http://github.com/x/x"
|
104
|
+
gem.expects(:open_url).with("http://github.com/x/x/commits/master")
|
105
|
+
gem.master
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "#releases" do
|
110
|
+
it "opens releases url" do
|
111
|
+
gem = OutdatedGem.new("x")
|
112
|
+
gem.stubs repo: "http://github.com/x/x"
|
113
|
+
gem.expects(:open_url).with("http://github.com/x/x/releases")
|
114
|
+
gem.releases
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe "#compare" do
|
119
|
+
it "opens compare url" do
|
120
|
+
gem = OutdatedGem.new("x", "1.2.3", "2.3.4")
|
121
|
+
gem.stubs repo: "http://github.com/x/x"
|
122
|
+
gem.expects(:open_url).with("http://github.com/x/x/compare/v1.2.3...v2.3.4")
|
123
|
+
gem.compare
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
describe "#open" do
|
128
|
+
it "opens repo url" do
|
129
|
+
gem = OutdatedGem.new("x")
|
130
|
+
gem.stubs repo: "http://github.com/x/x"
|
131
|
+
gem.expects(:open_url).with("http://github.com/x/x")
|
132
|
+
gem.open
|
133
|
+
end
|
134
|
+
end
|
99
135
|
end
|
100
136
|
end
|
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: 0.6.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: 2014-03-
|
11
|
+
date: 2014-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,8 +108,8 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '10.1'
|
111
|
-
description: Command-line utility to find source
|
112
|
-
|
111
|
+
description: Command-line utility to find source repositories for ruby gems, open
|
112
|
+
common github pages, compare gem versions, and simplify gem update workflow in git
|
113
113
|
email:
|
114
114
|
- tee@neighborland.com
|
115
115
|
executables:
|
@@ -163,7 +163,8 @@ rubyforge_project:
|
|
163
163
|
rubygems_version: 2.2.2
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
|
-
summary:
|
166
|
+
summary: Find source repositories for ruby gems. Open, compare, and update outdated
|
167
|
+
gem versions
|
167
168
|
test_files:
|
168
169
|
- test/bundle_inspector_test.rb
|
169
170
|
- test/cli_test.rb
|