gemdiff 0.6.12 → 0.7.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: 343a5fa8e71fcac1992320d5f9c1b759509c8e05
4
- data.tar.gz: 6422b7b33074f0f2832b436d33b9f1f0951198c0
3
+ metadata.gz: 80e10c9bdcb66f4c19cd26e3c9f9ccb1810f7006
4
+ data.tar.gz: 06bbdbfb7da6cab122545d91ebc94ae4c56418ce
5
5
  SHA512:
6
- metadata.gz: 124c7f650aae3e29b4ff7ada2bf44fe69bfad99fe636eaf2ac2e2a486b736ef13dd335a3e74598c53bbe64af0237e8693eba68745562cd8f9c5b4e042fb74545
7
- data.tar.gz: f56c3139d47dcbd5f58394ada36a9e05679f2e284a64b3b25dd9d71abb32cb17bb42f48ce042685fdabf238a61d947bc6328f9997c6ea3fe7dce4a97e035bc04
6
+ metadata.gz: 9c2abd3e49411e4439e78e2410f6dc20b7bdd995094987320a1c9eabab524f35cbe8da125f4294cfc380073412d4f1a6f6c8ea595d86f317c154d5ece38dddb8
7
+ data.tar.gz: 6f2edf76411e2892ec007440092b5a873c48d1771bc9836ec23ccea178a95d98c34c93a26777bdd7bc5575ff884870ed562dfd4d14186da73bcdbef38aaeaced
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.2
3
+ - 2.1.3
4
4
  - 2.0.0
5
5
  - 1.9.3
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/gemdiff.svg)](http://rubygems.org/gems/gemdiff)
4
4
  [![Build Status](https://travis-ci.org/teeparham/gemdiff.svg?branch=master)](https://travis-ci.org/teeparham/gemdiff)
5
5
 
6
- `gemdiff` is a command-line utility to find and compare source code repositories
6
+ `gemdiff` is a command-line utility to find and compare source code
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
9
  `gemdiff` helps connect gem version management (rubygems + bundler) with source code (github).
@@ -12,14 +12,14 @@ between the current version of a gem in your bundle and the latest version of th
12
12
 
13
13
  You want to view the source code differences between versions of gems when your dependencies are updated.
14
14
  `gemdiff` does the source repository lookup, opens common GitHub pages, and simplifies your git workflow for a
15
- bundled project (see `outdated`, `update`).
15
+ bundled project.
16
16
 
17
17
  ### How?
18
18
 
19
19
  `gemdiff` finds a repository by inspecting the local or remote gemspec, or searching github if needed.
20
20
  It uses bundler to list your outdated gems. For each outdated gem, it determines your currently used version and
21
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.
22
+ It provides `update` for a simple `bundle update <gem>` and commit workflow.
23
23
 
24
24
  ## Install
25
25
 
@@ -32,7 +32,7 @@ gem install gemdiff
32
32
  ### `gemdiff outdated`
33
33
 
34
34
  Runs `bundle outdated --strict` in the current directory.
35
- For each outdated gem, you can open the compare view for that gem, skip it, or exit all prompts.
35
+ For each outdated gem, you can open the compare view for that gem, skip it, or exit.
36
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`.
@@ -174,13 +174,12 @@ is not helpful. Some gems' source code is not on GitHub. `gemdiff` could support
174
174
  2. The GitHub repository must have tagged releases to show compare views. If you find gems that do not tag
175
175
  releases, submit an issue to the gem maintainer to tag their releases.
176
176
 
177
- 3. The versions must be tagged using the standard name format of `v1.2.3`. If you find gems that follow
177
+ 3. The versions must be tagged using the standard format of `v1.2.3`. If you find gems that follow
178
178
  a non-standard format (such as `1.2.3`), please open an issue or submit a pull request.
179
179
  See [`lib/gemdiff/outdated_gem.rb`](https://github.com/teeparham/gemdiff/blob/master/lib/gemdiff/outdated_gem.rb).
180
180
 
181
- 4. Encourage gem maintainers to either enter the GitHub repository URL in the `homepage` field of their gemspec,
182
- or anywhere in the description. `gemdiff` is much faster if so, and if not, it guesses the best match using
183
- the GitHub search API. If you find exceptions, open an issue or submit a pull request.
181
+ 4. Encourage gem maintainers to enter the GitHub repository URL in the `homepage` field of their gemspec
182
+ or anywhere in the description. If you find exceptions, open an issue or submit a pull request.
184
183
  See [`lib/gemdiff/repo_finder.rb`](https://github.com/teeparham/gemdiff/blob/master/lib/gemdiff/repo_finder.rb).
185
184
 
186
185
  ### More Info
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "thor", "~> 0.19"
25
25
  spec.add_dependency "launchy", "~> 2.4"
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.5"
28
- spec.add_development_dependency "minitest", "~> 5.3"
29
- spec.add_development_dependency "mocha", "~> 1.0"
30
- spec.add_development_dependency "rake", "~> 10.1"
27
+ spec.add_development_dependency "bundler", "~> 1.6"
28
+ spec.add_development_dependency "minitest", "~> 5.4"
29
+ spec.add_development_dependency "mocha", "~> 1.1"
30
+ spec.add_development_dependency "rake", "~> 10.3"
31
31
  end
@@ -1,4 +1,5 @@
1
1
  require 'octokit'
2
+ require 'yaml'
2
3
 
3
4
  module Gemdiff
4
5
  module RepoFinder
@@ -16,7 +17,6 @@ module Gemdiff
16
17
  activemodel: 'rails/rails',
17
18
  activerecord: 'rails/rails',
18
19
  activesupport: 'rails/rails',
19
- color: 'halostatue/color',
20
20
  :"color-schemer" => 'Team-Sass/color-schemer',
21
21
  delayed_job: 'collectiveidea/delayed_job',
22
22
  ffi: 'ffi/ffi',
@@ -47,8 +47,10 @@ module Gemdiff
47
47
  if (full_name = REPO_EXCEPTIONS[gem_name.to_sym])
48
48
  return github_repo(full_name)
49
49
  end
50
- return nil unless (spec = gemspec(gem_name))
51
- match = spec.match(GITHUB_REPO_REGEX)
50
+ return nil unless (yaml = gemspec(gem_name))
51
+ spec = YAML.load(yaml)
52
+ return spec.homepage if spec.homepage =~ GITHUB_REPO_REGEX
53
+ match = spec.description.match(GITHUB_REPO_REGEX)
52
54
  match && match[0]
53
55
  end
54
56
 
@@ -82,7 +84,7 @@ module Gemdiff
82
84
  end
83
85
 
84
86
  def find_remote_gemspec(name)
85
- `gem spec -r #{name}`
87
+ `gem spec -r #{name}` if last_shell_command_success?
86
88
  end
87
89
  end
88
90
  end
@@ -1,3 +1,3 @@
1
1
  module Gemdiff
2
- VERSION = '0.6.12'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -4,7 +4,7 @@ module Gemdiff
4
4
  class RepoFinderTest < MiniTest::Spec
5
5
  describe ".github_url" do
6
6
  it "returns github url from local gemspec" do
7
- RepoFinder.stubs find_local_gemspec: "homepage: http://github.com/rails/arel"
7
+ RepoFinder.stubs find_local_gemspec: fake_gemspec("homepage: http://github.com/rails/arel")
8
8
  RepoFinder.stubs last_shell_command_success?: true
9
9
  assert_equal "http://github.com/rails/arel", RepoFinder.github_url("arel")
10
10
  end
@@ -12,19 +12,19 @@ module Gemdiff
12
12
  it "returns github url from remote gemspec" do
13
13
  RepoFinder.stubs find_local_gemspec: ""
14
14
  RepoFinder.stubs last_shell_command_success?: false
15
- RepoFinder.stubs find_remote_gemspec: "homepage: http://github.com/rails/arel"
15
+ RepoFinder.stubs find_remote_gemspec: fake_gemspec("homepage: http://github.com/rails/arel")
16
16
  assert_equal "http://github.com/rails/arel", RepoFinder.github_url("arel")
17
17
  end
18
18
 
19
19
  it "returns github url from github search" do
20
20
  RepoFinder.stubs octokit_client: mock_octokit("haml/haml")
21
- RepoFinder.stubs gemspec: ""
21
+ RepoFinder.stubs gemspec: fake_gemspec
22
22
  assert_equal "http://github.com/haml/haml", RepoFinder.github_url("haml")
23
23
  end
24
24
 
25
25
  it "returns nil when not found" do
26
26
  RepoFinder.stubs octokit_client: mock_octokit(nil)
27
- RepoFinder.stubs gemspec: ""
27
+ RepoFinder.stubs gemspec: fake_gemspec
28
28
  assert_nil RepoFinder.github_url("not_found")
29
29
  end
30
30
 
@@ -44,5 +44,17 @@ module Gemdiff
44
44
  end
45
45
  mock { stubs search_repositories: mock_items }
46
46
  end
47
+
48
+ FAKE_GEMSPEC = %(
49
+ --- !ruby/object:Gem::Specification
50
+ name: fake
51
+ version: !ruby/object:Gem::Version
52
+ version: 1.2.3
53
+ description: fake
54
+ )
55
+
56
+ def fake_gemspec(extra = "")
57
+ [FAKE_GEMSPEC, extra].compact.join("\n")
58
+ end
47
59
  end
48
60
  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.6.12
4
+ version: 0.7.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-09-24 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -58,56 +58,56 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.5'
61
+ version: '1.6'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.5'
68
+ version: '1.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '5.3'
75
+ version: '5.4'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '5.3'
82
+ version: '5.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mocha
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.0'
89
+ version: '1.1'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.0'
96
+ version: '1.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '10.1'
103
+ version: '10.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '10.1'
110
+ version: '10.3'
111
111
  description: Command-line utility to find source repositories for ruby gems, open
112
112
  common github pages, compare gem versions, and simplify gem update workflow in git
113
113
  email: