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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d03ef46afcfc0969830ab752604bd3a67be7423
4
- data.tar.gz: b46c1374c91d2da7146f5b5c014d14aee357f04e
3
+ metadata.gz: 9699f3b4b148ad62a7299fa51afe728287cff993
4
+ data.tar.gz: 2d5d1998b59ce66ed9f3d7949cb986a712a4b91d
5
5
  SHA512:
6
- metadata.gz: 97c2d88bd72ab65bf7fe68f5dd8f4a2e16cb6de8706ad12c21f4431abcc48237c745fdf047252b5bbdd0d18c32264987a370b3693d6f82d12c517900d2602cc5
7
- data.tar.gz: ec5ba5c1435ba9b5df82d18af889386facc6c4264a81acf99ec632765836e1d30dcc2d074e4603c843a468f94a3d95f586ff42ead9ded559cbf87c9e5d96bd64
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 quickly view the source code differences between versions of gems when your dependencies are updated.
14
- It is often not that easy, because finding the github repository for a gem often requires The Google since many
15
- gems do not have the source repository URL in their gemspec.
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` does the repository lookup by inspecting the gemspec, then searching github if needed. It uses bundler to
20
- list your outdated gems. For each outdated gem, it determines your currently used version and the version you can
21
- update to, and builds a compare view URL with the old and new version tags. It also provides `update` to assist in
22
- the `bundle update` and commit workflow.
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` on the project in the current directory.
35
- For each outdated gem, it prompts you if you would like to open the compare view
36
- for that gem. Enter 'y' to review or enter to skip.
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
- This is the default task so you can just run `gemdiff`.
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
- You can open a compare view for an individual outdated gem in your bundle:
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 an old version with a branch name:
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, hit the GitHub search API.
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
- ### `commits`
108
+ ### `master`
108
109
 
109
110
  Open the repository's master branch commit history page:
110
111
 
111
112
  ```sh
112
- $ gemdiff commits haml
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 exceptions that follow
175
- a non-standard pattern, please submit a pull request. See `lib/gemdiff/outdated_gem.rb`.
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 github (gasp!). `gemdiff` could support other source hosts. Submit a PR!
184
+ 5. Some gems' source code is not on GitHub (gasp!). `gemdiff` could support other source hosts. Submit a pull request!
@@ -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{Compare gem versions}
12
- spec.description = %q{Command-line utility to find source repository URLs related to ruby gems and compare gem versions}
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
 
@@ -34,13 +34,13 @@ module Gemdiff
34
34
  gem.releases
35
35
  end
36
36
 
37
- desc 'commits <gem>', 'Open the github master branch commits page for a gem'
38
- def commits(gem_name)
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.commits
40
+ gem.master
41
41
  end
42
42
 
43
- desc 'compare <gem> [<old_version> <new_version>]', <<DESC
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
 
@@ -56,7 +56,7 @@ module Gemdiff
56
56
  "#{repo}/compare/#{compare_part}"
57
57
  end
58
58
 
59
- def commits
59
+ def master
60
60
  open_url(commits_url) if repo?
61
61
  end
62
62
 
@@ -1,3 +1,3 @@
1
1
  module Gemdiff
2
- VERSION = '0.5.2'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -38,12 +38,12 @@ module Gemdiff
38
38
  end
39
39
  end
40
40
 
41
- describe "#commits" do
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 :commits
46
- @cli.commits "haml"
45
+ gem.expects :master
46
+ @cli.master "haml"
47
47
  end
48
48
  end
49
49
 
@@ -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.5.2
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-06 00:00:00.000000000 Z
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 repository URLs related to ruby gems
112
- and compare gem versions
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: Compare gem versions
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