ruboty-github 0.1.1 → 0.1.2
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/CHANGELOG.md +4 -0
- data/lib/ruboty/github/version.rb +1 -1
- data/lib/ruboty/handlers/github.rb +4 -2
- data/spec/ruboty/handlers/github_spec.rb +5 -5
- 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: 858be07d2d4a6b4c7175e4ec8d6016106bfaecb1
|
4
|
+
data.tar.gz: e7f1756359a7903812438a6953a612bc67e819fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3649533a6835fc21a2600582359d40093eb6e54c388b13f9070ad1a536a6b19f348a68eb6da594af63d052a9f25d690a04a709c5bfc2bb3f2142958ee2613fa0
|
7
|
+
data.tar.gz: 853d6eabb9f68f4f3c2f4e2c5a3476e99442abb87ba374619579fa176c3d2a23ccad193b7eb780bd103056dff8cd0ca6133d5ec93fbf08ba98e8be885272a2ef
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Ruboty
|
2
2
|
module Handlers
|
3
3
|
class Github < Base
|
4
|
+
ISSUE_PATTERN = %r<(?:https?://[^/]+/)?(?<repo>.+)(?:#|/pull/|/issue/)(?<number>\d+) ?>
|
5
|
+
|
4
6
|
env :GITHUB_HOST, "Pass GitHub Host if needed (e.g. github.example.com)", optional: true
|
5
7
|
|
6
8
|
on(
|
@@ -16,7 +18,7 @@ module Ruboty
|
|
16
18
|
)
|
17
19
|
|
18
20
|
on(
|
19
|
-
/close issue
|
21
|
+
/close(?: issue)? #{ISSUE_PATTERN}\z/,
|
20
22
|
name: "close_issue",
|
21
23
|
description: "Close an issue",
|
22
24
|
)
|
@@ -28,7 +30,7 @@ module Ruboty
|
|
28
30
|
)
|
29
31
|
|
30
32
|
on(
|
31
|
-
/merge
|
33
|
+
/merge #{ISSUE_PATTERN}\z/,
|
32
34
|
name: "merge_pull_request",
|
33
35
|
description: "Merge pull request",
|
34
36
|
)
|
@@ -58,12 +58,12 @@ describe Ruboty::Handlers::Github do
|
|
58
58
|
|
59
59
|
describe "#create_issue" do
|
60
60
|
before do
|
61
|
-
stub_request(:post, "https://github.com/
|
61
|
+
stub_request(:post, "https://api.github.com/repos/#{user}/#{repository}/issues").
|
62
62
|
with(
|
63
63
|
body: {
|
64
|
-
labels:
|
64
|
+
labels: [],
|
65
65
|
title: title,
|
66
|
-
body:
|
66
|
+
body: "",
|
67
67
|
}.to_json,
|
68
68
|
headers: {
|
69
69
|
Authorization: "token #{github_access_token}"
|
@@ -91,7 +91,7 @@ describe Ruboty::Handlers::Github do
|
|
91
91
|
|
92
92
|
describe "#close_issue" do
|
93
93
|
before do
|
94
|
-
stub_request(:get, "https://github.com/
|
94
|
+
stub_request(:get, "https://api.github.com/repos/#{user}/#{repository}/issues/#{issue_number}").
|
95
95
|
with(
|
96
96
|
headers: {
|
97
97
|
Authorization: "token #{github_access_token}"
|
@@ -106,7 +106,7 @@ describe Ruboty::Handlers::Github do
|
|
106
106
|
"Content-Type" => "application/json",
|
107
107
|
},
|
108
108
|
)
|
109
|
-
stub_request(:patch, "https://github.com/
|
109
|
+
stub_request(:patch, "https://api.github.com/repos/#{user}/#{repository}/issues/#{issue_number}").
|
110
110
|
with(
|
111
111
|
body: {
|
112
112
|
state: "closed",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|