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 +4 -4
- data/lib/ghn/notification.rb +3 -5
- data/lib/ghn/version.rb +1 -1
- data/spec/fixtures/release.json +1 -1
- data/spec/lib/ghn/notification_spec.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 777baf21bcee5d1635cd624862a81a32d2ae871f
|
|
4
|
+
data.tar.gz: 14a209f4657fa0e616af339e46bb9b79e1f8d797
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f98bc9728e7a6860f6421e7bf39ef596d7426f012de1a960080c40bc879874c84bf53b117ffdcd36f6ac2e4f2a8a1aa847b4b9503abada6f0ea26c8179094dc9
|
|
7
|
+
data.tar.gz: 91a0125ba6b9d3eced99da090e360654696f33142943955bd2a7a03f0ae4c5097a38a91e0d4a89a5a26c4ce35ee2b63aff1801fdeac9e70a45276777c60706df
|
data/lib/ghn/notification.rb
CHANGED
|
@@ -67,11 +67,9 @@ class Ghn
|
|
|
67
67
|
|
|
68
68
|
class ReleaseNotification < Notification
|
|
69
69
|
def url
|
|
70
|
-
|
|
71
|
-
|
|
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
data/spec/fixtures/release.json
CHANGED
|
@@ -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": "
|
|
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/
|
|
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.
|
|
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-
|
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|