ghn 2.1.0 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd7dc86da789c42cd537f64004c0a5e644094b73
4
- data.tar.gz: d466cb5126eed061a205204f9eadb1508108d4d3
3
+ metadata.gz: 777baf21bcee5d1635cd624862a81a32d2ae871f
4
+ data.tar.gz: 14a209f4657fa0e616af339e46bb9b79e1f8d797
5
5
  SHA512:
6
- metadata.gz: baa4ec0020c19f9bd464b4f5bd7b487497baa4f434f40eaec27b4033afbd679b12c3594cedcb68055a8c6f9f8afeb9a64e491eca5e915ab3216db46d40520a04
7
- data.tar.gz: 158384d2303d32765708bc144ae4902e3d193de1e822b30b029034eed55228d980a833fd59b8a3d9cfc3c9de8b3ab4df2c8b904d56510933df384bbecf335113
6
+ metadata.gz: f98bc9728e7a6860f6421e7bf39ef596d7426f012de1a960080c40bc879874c84bf53b117ffdcd36f6ac2e4f2a8a1aa847b4b9503abada6f0ea26c8179094dc9
7
+ data.tar.gz: 91a0125ba6b9d3eced99da090e360654696f33142943955bd2a7a03f0ae4c5097a38a91e0d4a89a5a26c4ce35ee2b63aff1801fdeac9e70a45276777c60706df
@@ -67,11 +67,9 @@ class Ghn
67
67
 
68
68
  class ReleaseNotification < Notification
69
69
  def url
70
- "https://github.com/#{repo_full_name}/releases/tag/#{tag}"
71
- end
72
-
73
- def tag
74
- notification[:subject][:title].split(" ")[-1]
70
+ url = notification[:subject][:url]
71
+ result = JSON.parse(Net::HTTP.get(URI.parse(url)))
72
+ result['html_url']
75
73
  end
76
74
  end
77
75
 
data/lib/ghn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Ghn
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "subject": {
70
70
  "latest_comment_url": "https://api.github.com/repos/yandod/candycane/releases/510313",
71
- "title": "CandyCane v0.9.4",
71
+ "title": "Release v2.0.0: add `-p` option",
72
72
  "type": "Release",
73
73
  "url": "https://api.github.com/repos/yandod/candycane/releases/510313"
74
74
  },
@@ -117,10 +117,15 @@ describe Ghn::Notification do
117
117
 
118
118
  describe Ghn::ReleaseNotification do
119
119
  describe '#url' do
120
+ before do
121
+ allow(Net::HTTP).
122
+ to receive(:get).and_return '{"html_url":"https://github.com/yandod/candycane/releases/tag/v2.1.0"}'
123
+ end
124
+
120
125
  it do
121
126
  expect(
122
127
  Ghn::ReleaseNotification.new(fixture('release.json'), false).url
123
- ).to eq 'https://github.com/yandod/candycane/releases/tag/v0.9.4'
128
+ ).to eq 'https://github.com/yandod/candycane/releases/tag/v2.1.0'
124
129
  end
125
130
  end
126
131
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghn
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kensuke Nagae
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-15 00:00:00.000000000 Z
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor