compare_linker 1.1.3 → 1.1.4

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: 03a8e45120ce9acd530974de67bf9e08329e551b
4
- data.tar.gz: c236ca342f8fff2a4cc1afea5220df4d3847a669
3
+ metadata.gz: 47654b7ad39f88145694628f36f54bf1a0063a5d
4
+ data.tar.gz: cff0a2c629e0a4050d83a30e74f58c4738ed357b
5
5
  SHA512:
6
- metadata.gz: 528e3fe8278e10c4aedc42cf2ea5bc6dc5f40e5ad65fafc8c823cafccc839f3ea98b3cdbe0bc25ea8c6961f5f0ab30a597a17bb581901ea963aa5fff6caeb8af
7
- data.tar.gz: 1d3ffc81e46478a980ed61e4857818f8e2ffd017ef34aa0bc6bcd9c0ef99f645f7d3fd2eacc2e688851f57f29d972f05a4e58523a7151c0ea254910a09e02584
6
+ metadata.gz: aa2743c90967af73d6ac6fb7506871d35dd908e80e23703dc5d9c765d0ba7d85f584e54d93858f69e6538bc4bdbde3d49c8ab5f6fa10b61fd28f74e52017f2a3
7
+ data.tar.gz: 821f8334ea9caffe17e689fa7c66a3eab847471557b231440cfed1b5aa82b0e47f399273bbb3f6816c759fdcbca672ff162d4c0c5ea7a82ab074711cc190fae6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- compare_linker (1.1.3)
4
+ compare_linker (1.1.4)
5
5
  httpclient
6
6
  octokit
7
7
 
@@ -26,6 +26,9 @@ class CompareLinker
26
26
  github_url = redirect_url(github_url)
27
27
  _, @repo_owner, @repo_name = github_url.match(%r!github\.com/([^/]+)/([^/]+)!).to_a
28
28
  end
29
+
30
+ rescue JSON::ParserError
31
+ @homepage_uri = "https://rubygems.org/gems/#{gem_name}"
29
32
  end
30
33
 
31
34
  def repo_full_name
@@ -1,3 +1,3 @@
1
1
  class CompareLinker
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -0,0 +1 @@
1
+ This rubygem could not be found.
@@ -28,5 +28,16 @@ describe CompareLinker::GithubLinkFinder do
28
28
  expect(subject.repo_name).to eq "webtranslateit"
29
29
  end
30
30
  end
31
+
32
+ context "if gem not found on rubygems.org" do
33
+ before do
34
+ allow(HTTPClient).to receive_message_chain(:get, :body).and_return load_fixture("not_found.json")
35
+ end
36
+
37
+ it "extracts homepage_uri" do
38
+ subject.find("not_found")
39
+ expect(subject.homepage_uri).to eq "https://rubygems.org/gems/not_found"
40
+ end
41
+ end
31
42
  end
32
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compare_linker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kensuke Nagae
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-14 00:00:00.000000000 Z
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -110,6 +110,7 @@ files:
110
110
  - lib/compare_linker/webhook_payload.rb
111
111
  - payload.rb
112
112
  - runner.rb
113
+ - spec/fixtures/not_found.json
113
114
  - spec/fixtures/rails.json
114
115
  - spec/fixtures/web_translate_it.json
115
116
  - spec/lib/compare_linker/github_link_finder_spec.rb
@@ -140,6 +141,7 @@ signing_key:
140
141
  specification_version: 4
141
142
  summary: Create GitHub's compare view URLs for pull request
142
143
  test_files:
144
+ - spec/fixtures/not_found.json
143
145
  - spec/fixtures/rails.json
144
146
  - spec/fixtures/web_translate_it.json
145
147
  - spec/lib/compare_linker/github_link_finder_spec.rb