gemdiff 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -8
- data/lib/gemdiff/repo_finder.rb +9 -7
- data/lib/gemdiff/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc214f225c1bbd5fef32d2b947619749e273b8bc
|
4
|
+
data.tar.gz: 904f23562cccfe197c6a1d450923dc8b2c209e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ecec46cf1587b64cacaef6f6988d8ba54907c9066a239ced2b4cd60fd39a7fdb536b3e0e0fe8df3ddf868350d0c150437de7db15841116b14bbf2dbf5608e15
|
7
|
+
data.tar.gz: 3d76155252b0f58223c9e1773d523c761d69c3782d979050e78fa616285f3d8f7191f48018c698ccdc510825c4549b4e062d41a2ee403fca3db0675d12d20639
|
data/README.md
CHANGED
@@ -6,12 +6,20 @@
|
|
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
|
8
8
|
between the current version of a gem in your bundle and the latest version of the gem.
|
9
|
+
`gemdiff` helps connect gem version management (rubygems + bundler) with source code (github).
|
9
10
|
|
10
|
-
|
11
|
+
#### Why?
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
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.
|
16
|
+
|
17
|
+
#### How?
|
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.
|
15
23
|
|
16
24
|
## Install
|
17
25
|
|
@@ -33,17 +41,31 @@ This is the default task so you can just run `gemdiff`.
|
|
33
41
|
$ cd /your/ruby/project/using/bundler
|
34
42
|
$ gemdiff
|
35
43
|
Checking for outdated gems in your bundle...
|
44
|
+
Fetching gem metadata from https://rubygems.org/.......
|
45
|
+
Fetching additional metadata from https://rubygems.org/..
|
46
|
+
Resolving dependencies...
|
47
|
+
|
48
|
+
Outdated gems included in the bundle:
|
49
|
+
* aws-sdk (1.35.0 > 1.34.1)
|
50
|
+
* sprockets (2.11.0 > 2.10.1)
|
51
|
+
* webmock (1.17.4 > 1.17.3)
|
36
52
|
aws-sdk: 1.35.0 > 1.34.1
|
37
53
|
Open? (y to open, else skip)
|
38
|
-
webmock: 1.17.4 > 1.17.3
|
39
|
-
Open? (y to open, else skip) y
|
40
54
|
sprockets: 2.11.0 > 2.10.1
|
55
|
+
Open? (y to open, else skip) y
|
56
|
+
webmock: 1.17.4 > 1.17.3
|
41
57
|
Open? (y to open, else skip)
|
42
58
|
```
|
43
59
|
|
44
60
|
### `compare`
|
45
61
|
|
46
|
-
You can
|
62
|
+
You can open a compare view for an individual outdated gem in your bundle:
|
63
|
+
|
64
|
+
```sh
|
65
|
+
$ gemdiff compare haml
|
66
|
+
```
|
67
|
+
|
68
|
+
You can also bypass bundler and query a gem by entering explicit version numbers.
|
47
69
|
|
48
70
|
For example, open the GitHub compare view in browser for difference between `haml` versions 4.0.4 and 4.0.5:
|
49
71
|
|
@@ -125,7 +147,7 @@ $ gemdiff commits haml
|
|
125
147
|
$ gemdiff help
|
126
148
|
```
|
127
149
|
|
128
|
-
|
150
|
+
### It didn't work
|
129
151
|
|
130
152
|
`gemdiff` operates on a few assumptions:
|
131
153
|
|
@@ -140,3 +162,5 @@ a non-standard pattern, please submit a pull request. See `lib/gemdiff/outdated_
|
|
140
162
|
4. Encourage gem maintainers to either enter the GitHub repository URL in the `homepage` field of their gemspec,
|
141
163
|
or anywhere in the description. `gemdiff` is much faster if so, and if not, it guesses the best match using
|
142
164
|
the GitHub search API.
|
165
|
+
|
166
|
+
5. Some gems' source code is not on github (gasp!). `gemdiff` could support other source hosts. Submit a PR!
|
data/lib/gemdiff/repo_finder.rb
CHANGED
@@ -5,15 +5,17 @@ module Gemdiff
|
|
5
5
|
GITHUB_REPO_REGEX = /(https?):\/\/(www.)?github\.com\/([\w._%-]*)\/([\w._%-]*)/
|
6
6
|
|
7
7
|
# rails builds several gems that are not individual projects
|
8
|
+
# some repos move and the old repo page still exists
|
8
9
|
REPO_EXCEPTIONS =
|
9
10
|
{
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
11
|
+
actionmailer: 'rails/rails',
|
12
|
+
actionpack: 'rails/rails',
|
13
|
+
actionview: 'rails/rails',
|
14
|
+
activemodel: 'rails/rails',
|
15
|
+
activerecord: 'rails/rails',
|
16
|
+
activesupport: 'rails/rails',
|
17
|
+
railties: 'rails/rails',
|
18
|
+
resque: 'resque/resque',
|
17
19
|
}
|
18
20
|
|
19
21
|
class << self
|
data/lib/gemdiff/version.rb
CHANGED