magnum-payload 0.3.4 → 0.3.5

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: c913ae966a34c495971151a1d01b8f42881d05b1
4
- data.tar.gz: a0ae86fa239990cb949c7e6d7402958e6a7e540a
3
+ metadata.gz: 558f53b2e50b86aef9690d16883a12a1f1c8f5e8
4
+ data.tar.gz: a6197cb92a200599ee7a666324fae0e50fa8c8a4
5
5
  SHA512:
6
- metadata.gz: 3a6cf68affc2203d60975ccc84d004f3be56bdb1188ea8066db34040a70c1897d154ac47f55692603d20f82d7d18051d97e957e02cca70e79951c021806e7024
7
- data.tar.gz: feb1211463ab6c41e9ae16382c76cc8c9d315f7536e38a5601b8e813596376bd3ff8353d8e78fb8318656e15315f2205228dc6de825329e1b322eb87072ac6fe
6
+ metadata.gz: ac086b98433c9514ca56c2bdcd48a8d7dc9b297e7b4d87540bb281a818d4e2cf082986b5616aa084d2285d44fbb4dd72c9671929050676cc49b77875721c7472
7
+ data.tar.gz: 90b05ffc95d67e791df3530468ad3f009e60a5e1ae1fba1f6206de932b3f67d82a5a291789f4a78fa280fcdaa0320812b68616fb0100785da59416aaaeb52475
data/README.md CHANGED
@@ -6,7 +6,7 @@ It accepts any commits payloads and transforms them into identical data structur
6
6
  If you need to integrate web-hooks from Github, Bitbucket or Gitlab this is definitely
7
7
  worth checking out. Check examples for details.
8
8
 
9
- [![build status](https://magnum-ci.com/status/1f87bb33961c21de5940142e86a741f1.png)](https://magnum-ci.com/public/0cb3a398347ebeeb90fb/builds)
9
+ [![Build Status](https://magnum-ci.com/status/1f87bb33961c21de5940142e86a741f1.png)](https://magnum-ci.com/public/0cb3a398347ebeeb90fb/builds) [![Code Climate](https://codeclimate.com/github/magnumci/magnum-payload.png)](https://codeclimate.com/github/magnumci/magnum-payload)
10
10
 
11
11
  ## Supported platforms
12
12
 
@@ -106,4 +106,4 @@ The MIT License (MIT)
106
106
 
107
107
  Copyright (c) 2013-2014 Dan Sosedoff, <dan.sosedoff@gmail.com>
108
108
 
109
- Copyright (c) 2013-2014 Magnum CI, <support@magnum-ci.com>
109
+ Copyright (c) 2013-2014 Magnum CI, <support@magnum-ci.com>
@@ -19,8 +19,9 @@ module Magnum
19
19
  end
20
20
 
21
21
  def skip_payload?
22
- @skip = true if head_deleted? || last_commit.nil?
23
- @skip = true if data.ref =~ /tags/
22
+ return @skip = true if data.zen
23
+ @skip = true if head_deleted? || last_commit.nil?
24
+ @skip = true if data.ref =~ /tags/
24
25
 
25
26
  @skip
26
27
  end
@@ -1,5 +1,5 @@
1
1
  module Magnum
2
2
  module Payload
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
@@ -0,0 +1,4 @@
1
+ {
2
+ "zen": "Half measures are as bad as nothing at all.",
3
+ "hook_id": 12345
4
+ }
@@ -1,73 +1,81 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Magnum::Payload::Github do
4
- describe '#parse!' do
5
- let(:data) { fixture('github.json') }
4
+ describe "#parse!" do
5
+ let(:data) { fixture("github.json") }
6
6
  let(:payload) { Magnum::Payload::Github.new(data) }
7
7
 
8
- it 'sets commit sha' do
9
- payload.commit.should eq '9d227f327e725164c3266be74cf5c00678edad13'
8
+ it "sets commit sha" do
9
+ expect(payload.commit).to eq "9d227f327e725164c3266be74cf5c00678edad13"
10
10
  end
11
11
 
12
- it 'sets commit branch' do
13
- payload.branch.should eq 'master'
12
+ it "sets commit branch" do
13
+ expect(payload.branch).to eq "master"
14
14
  end
15
15
 
16
- it 'sets commit message' do
17
- payload.message.should eq 'Remove jruby from test matrix'
16
+ it "sets commit message" do
17
+ expect(payload.message).to eq "Remove jruby from test matrix"
18
18
  end
19
19
 
20
- it 'sets author' do
21
- payload.committer.should eq 'Dan Sosedoff'
22
- payload.committer_email.should eq 'dan.sosedoff@gmail.com'
20
+ it "sets author" do
21
+ expect(payload.committer).to eq "Dan Sosedoff"
22
+ expect(payload.committer_email).to eq "dan.sosedoff@gmail.com"
23
23
  end
24
24
 
25
- it 'sets committer' do
26
- payload.author.should eq 'Dan Sosedoff'
27
- payload.author_email.should eq 'dan.sosedoff@gmail.com'
25
+ it "sets committer" do
26
+ expect(payload.author).to eq "Dan Sosedoff"
27
+ expect(payload.author_email).to eq "dan.sosedoff@gmail.com"
28
28
  end
29
29
 
30
- it 'sets commit view url' do
31
- payload.commit_url.should eq 'https://github.com/sosedoff/lxc-ruby/commit/9d227f327e725164c3266be74cf5c00678edad13'
30
+ it "sets commit view url" do
31
+ expect(payload.commit_url).to eq "https://github.com/sosedoff/lxc-ruby/commit/9d227f327e725164c3266be74cf5c00678edad13"
32
32
  end
33
33
 
34
- it 'sets commit compare url' do
35
- payload.compare_url.should eq 'https://github.com/sosedoff/lxc-ruby/compare/0e46f019e391...9d227f327e72'
34
+ it "sets commit compare url" do
35
+ expect(payload.compare_url).to eq "https://github.com/sosedoff/lxc-ruby/compare/0e46f019e391...9d227f327e72"
36
36
  end
37
37
 
38
- context 'when push is forced' do
39
- let(:data) { fixture 'github/forced.json' }
38
+ context "when push is forced" do
39
+ let(:data) { fixture "github/forced.json" }
40
40
 
41
- it 'parses head commit' do
42
- payload.commit.should eq 'e7508c4c70d2c5afc1e6c2f3a42ecc098f435103'
41
+ it "parses head commit" do
42
+ expect(payload.commit).to eq "e7508c4c70d2c5afc1e6c2f3a42ecc098f435103"
43
43
  end
44
44
  end
45
45
 
46
- context 'for deleted branch' do
47
- let(:data) { fixture 'github/deleted.json' }
46
+ context "for deleted branch" do
47
+ let(:data) { fixture "github/deleted.json" }
48
48
 
49
- it 'marks payload as skipped' do
50
- payload.skip.should be_true
49
+ it "marks payload as skipped" do
50
+ expect(payload.skip).to be_true
51
51
  end
52
52
  end
53
53
 
54
- context 'for new branch' do
55
- let(:data) { fixture 'github/new_branch.json' }
54
+ context "for new branch" do
55
+ let(:data) { fixture "github/new_branch.json" }
56
56
 
57
- it 'sets commit sha' do
58
- payload.commit.should eq 'd9cc46f9e7e6aa65df696d8d1efe86de755b46ae'
57
+ it "sets commit sha" do
58
+ expect(payload.commit).to eq "d9cc46f9e7e6aa65df696d8d1efe86de755b46ae"
59
59
  end
60
60
 
61
- it 'sets branch' do
62
- payload.branch.should eq 'hello'
61
+ it "sets branch" do
62
+ expect(payload.branch).to eq "hello"
63
63
  end
64
64
  end
65
65
 
66
- context 'for new tag' do
67
- let(:data) { fixture 'github/new_tag.json' }
66
+ context "for new tag" do
67
+ let(:data) { fixture "github/new_tag.json" }
68
68
 
69
- it 'marks payload as skipped' do
70
- payload.skip.should be_true
69
+ it "marks payload as skipped" do
70
+ expect(payload.skip).to be_true
71
+ end
72
+ end
73
+
74
+ context "for ping payload" do
75
+ let(:data) { fixture "github/test.json" }
76
+
77
+ it "marks payload as skipped" do
78
+ expect(payload.skip).to be_true
71
79
  end
72
80
  end
73
81
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magnum-payload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Sosedoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-06 00:00:00.000000000 Z
11
+ date: 2014-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -117,6 +117,7 @@ files:
117
117
  - spec/fixtures/github/forced.json
118
118
  - spec/fixtures/github/new_branch.json
119
119
  - spec/fixtures/github/new_tag.json
120
+ - spec/fixtures/github/test.json
120
121
  - spec/fixtures/gitlab/branch_with_slash.json
121
122
  - spec/fixtures/gitlab/commits.json
122
123
  - spec/fixtures/gitlab/create_branch.json
@@ -168,6 +169,7 @@ test_files:
168
169
  - spec/fixtures/github/forced.json
169
170
  - spec/fixtures/github/new_branch.json
170
171
  - spec/fixtures/github/new_tag.json
172
+ - spec/fixtures/github/test.json
171
173
  - spec/fixtures/gitlab/branch_with_slash.json
172
174
  - spec/fixtures/gitlab/commits.json
173
175
  - spec/fixtures/gitlab/create_branch.json