gemdiff 0.4.0 → 0.4.1

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: 0a91837ca05f7dba3fc3eb2cefeac019346a9d3c
4
- data.tar.gz: efeb3363bdf56d03c5b545f7243f41868bb14bd8
3
+ metadata.gz: 5463d4ddf3bfc93d486f0e6fd5cb2d033645da88
4
+ data.tar.gz: 57931cb28d1aa6388c83e393dea6f2af9b098f4a
5
5
  SHA512:
6
- metadata.gz: 22961ac6e18e487fc6583291052c4ddecd19f584fc1a71055297a3f0bbfaf9311dc82ace8313378d353a09e56f8ed58143ff4e5796b6677262fdd71e06cbee1f
7
- data.tar.gz: 15a9367f60bc852519a2bd453a21b11d71d02f476f5fbd38289b570b758ac2db8e263d672a683ed148483b5b17f3531a9bbed2895f126a16701a6502d6d9df41
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
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1
4
+ - 2.0.0
5
+ - 1.9.3
data/Gemfile CHANGED
@@ -1,2 +1,9 @@
1
1
  source 'https://rubygems.org'
2
+
3
+ platform :mri_21 do
4
+ unless ENV['TRAVIS']
5
+ gem "pry-byebug", "~> 1.3"
6
+ end
7
+ end
8
+
2
9
  gemspec
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # gemdiff
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/gemdiff.png)](http://badge.fury.io/rb/gemdiff)
4
+ [![Build Status](https://api.travis-ci.org/teeparham/gemdiff.png)](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
@@ -28,5 +28,4 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "minitest", "~> 5.3"
29
29
  spec.add_development_dependency "mocha", "~> 1.0"
30
30
  spec.add_development_dependency "rake", "~> 10.1"
31
- spec.add_development_dependency "pry-byebug", "~> 1.3"
32
31
  end
@@ -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
- "http://github.com/#{result.items.first.full_name}"
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
@@ -1,3 +1,3 @@
1
1
  module Gemdiff
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -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
@@ -1,4 +1,9 @@
1
1
  require 'minitest/autorun'
2
2
  require 'mocha/setup'
3
- require 'pry-byebug'
4
3
  require 'gemdiff'
4
+
5
+ begin
6
+ require 'pry-byebug'
7
+ rescue LoadError
8
+ # ok
9
+ end
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.0
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