stratify-github 0.1.2 → 0.1.3
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.
- data/Gemfile.lock +1 -1
- data/lib/stratify-github/events.rb +1 -1
- data/lib/stratify-github/version.rb +1 -1
- data/spec/stratify-github/activity_spec.rb +13 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -193,7 +193,7 @@ module Stratify
|
|
193
193
|
activity.action = "pushed"
|
194
194
|
activity.ref = api_hash['payload']['ref']
|
195
195
|
activity.repository = api_hash['repository']['url'] rescue nil
|
196
|
-
activity.payload = api_hash['payload']['shas'][0][2]
|
196
|
+
activity.payload = api_hash['payload']['shas'][0][2] rescue nil
|
197
197
|
activity
|
198
198
|
end
|
199
199
|
def self.text(activity)
|
@@ -251,6 +251,19 @@ describe Stratify::GitHub::Activity do
|
|
251
251
|
event.payload.should == 'Fix all the things'
|
252
252
|
end
|
253
253
|
|
254
|
+
it 'produces correct fields for a PushEvent without SHAs' do
|
255
|
+
data = DM({'type' => 'PushEvent',
|
256
|
+
'payload' => {
|
257
|
+
'ref' => 'refs/head/master',
|
258
|
+
'shas' => []}})
|
259
|
+
event = Stratify::GitHub::Activity.from_api_hash(data)
|
260
|
+
event.action.should == 'pushed'
|
261
|
+
event.event_type.should == 'PushEvent'
|
262
|
+
event.ref.should == 'refs/head/master'
|
263
|
+
event.repository.should be_nil
|
264
|
+
event.payload.should be_nil
|
265
|
+
end
|
266
|
+
|
254
267
|
it 'produces correct fields for a WatchEvent' do
|
255
268
|
data = DM({'type' => 'WatchEvent'})
|
256
269
|
event = Stratify::GitHub::Activity.from_api_hash(data)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stratify-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|