gemdiff 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +7 -0
- data/README.md +3 -0
- data/gemdiff.gemspec +0 -1
- data/lib/gemdiff/repo_finder.rb +20 -1
- data/lib/gemdiff/version.rb +1 -1
- data/test/repo_finder_test.rb +4 -0
- data/test/test_helper.rb +6 -1
- metadata +3 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5463d4ddf3bfc93d486f0e6fd5cb2d033645da88
|
4
|
+
data.tar.gz: 57931cb28d1aa6388c83e393dea6f2af9b098f4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89c2404fe14a7f67a1e14d0fd73c0623e553c1b8ae402b1d8c2f115a7a9106cad010aca45ac7008f5b3b0676bc5cc011d73c8c20cc86d0346133383f44b96082
|
7
|
+
data.tar.gz: e896906326420353d6fd8fcbbad6246597a8a96d4189b2f2a42854b8d82629d7ba76296efbf505720f8ce5c1d7505df84b9a7a1bb47da1a23ca438fb3fd484f5
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.1.1
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# gemdiff
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/gemdiff)
|
4
|
+
[](https://travis-ci.org/teeparham/gemdiff)
|
5
|
+
|
3
6
|
`gemdiff` is a command-line utility to find and compare source code repositories
|
4
7
|
associated with ruby gems. It makes it easy to compare source code differences
|
5
8
|
between the current version of a gem in your bundle and the latest version of the gem.
|
data/gemdiff.gemspec
CHANGED
data/lib/gemdiff/repo_finder.rb
CHANGED
@@ -4,6 +4,18 @@ module Gemdiff
|
|
4
4
|
module RepoFinder
|
5
5
|
GITHUB_REPO_REGEX = /(https?):\/\/(www.)?github\.com\/([\w._%-]*)\/([\w._%-]*)/
|
6
6
|
|
7
|
+
# rails builds several gems that are not individual projects
|
8
|
+
REPO_EXCEPTIONS =
|
9
|
+
{
|
10
|
+
:'actionmailer' => 'rails/rails',
|
11
|
+
:'actionpack' => 'rails/rails',
|
12
|
+
:'actionview' => 'rails/rails',
|
13
|
+
:'activemodel' => 'rails/rails',
|
14
|
+
:'activerecord' => 'rails/rails',
|
15
|
+
:'activesupport' => 'rails/rails',
|
16
|
+
:'railties' => 'rails/rails',
|
17
|
+
}
|
18
|
+
|
7
19
|
class << self
|
8
20
|
# Try to get the homepage from the gemspec
|
9
21
|
# If not found, search github
|
@@ -16,6 +28,9 @@ module Gemdiff
|
|
16
28
|
private
|
17
29
|
|
18
30
|
def gemspec_homepage(gem_name)
|
31
|
+
if (full_name = REPO_EXCEPTIONS[gem_name.to_sym])
|
32
|
+
return github_repo(full_name)
|
33
|
+
end
|
19
34
|
homepage = find_homepage_in_spec(gem_name)
|
20
35
|
match = homepage.match(GITHUB_REPO_REGEX)
|
21
36
|
match && match[0]
|
@@ -26,7 +41,11 @@ module Gemdiff
|
|
26
41
|
result = octokit_client.search_repositories(query)
|
27
42
|
return nil if result.items.empty?
|
28
43
|
result.items
|
29
|
-
|
44
|
+
github_repo result.items.first.full_name
|
45
|
+
end
|
46
|
+
|
47
|
+
def github_repo(full_name)
|
48
|
+
"http://github.com/#{full_name}"
|
30
49
|
end
|
31
50
|
|
32
51
|
def octokit_client
|
data/lib/gemdiff/version.rb
CHANGED
data/test/repo_finder_test.rb
CHANGED
@@ -19,6 +19,10 @@ module Gemdiff
|
|
19
19
|
RepoFinder.stubs find_homepage_in_spec: ""
|
20
20
|
assert_nil RepoFinder.github_url("not_found")
|
21
21
|
end
|
22
|
+
|
23
|
+
it "returns exception url" do
|
24
|
+
assert_equal "http://github.com/rails/rails", RepoFinder.github_url('activerecord')
|
25
|
+
end
|
22
26
|
end
|
23
27
|
|
24
28
|
private
|
data/test/test_helper.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tee Parham
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '10.1'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: pry-byebug
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.3'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.3'
|
125
111
|
description: Command-line utility to find source repository URLs related to ruby gems
|
126
112
|
and compare gem versions
|
127
113
|
email:
|
@@ -132,6 +118,8 @@ extensions: []
|
|
132
118
|
extra_rdoc_files: []
|
133
119
|
files:
|
134
120
|
- ".gitignore"
|
121
|
+
- ".ruby-version"
|
122
|
+
- ".travis.yml"
|
135
123
|
- Gemfile
|
136
124
|
- LICENSE.txt
|
137
125
|
- README.md
|