stratify-github 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stratify-github (0.1.2)
4
+ stratify-github (0.1.3)
5
5
  actionpack (~> 3.2.0)
6
6
  railties (~> 3.2.0)
7
7
  rinku (~> 1.0.0)
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Stratify
2
2
  module GitHub
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -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.2
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-08-17 00:00:00.000000000 Z
12
+ date: 2012-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack