socialcast-git-extensions 4.1.0 → 4.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/socialcast-git-extensions/github.rb +6 -1
- data/lib/socialcast-git-extensions/version.rb +1 -1
- data/spec/github_spec.rb +8 -3
- 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: b636e86e81a35a85a4709b288c1a5a0d157c19a8
|
4
|
+
data.tar.gz: 388e65e84fe941af1e7ccbdbda072bcc5de64ccf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56ab6b7a039596d9dd557cc1363af42484a63b513ca52dda4336e910b2123f850c221d2c6f71855cc0a3f6a4e84e2a766055b6567eea0a0d5e205e956b2f16b9
|
7
|
+
data.tar.gz: fa9fb632400f12020746ab92134771bfb08135714f4ab9e3de70a1bbe623197da89306dc14644e513ac5ba6143596ecbe30195b59146ac0bde42a0000be234e2
|
@@ -121,7 +121,12 @@ module Socialcast
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def github_api_request(method, path, payload = nil)
|
124
|
-
url = path.
|
124
|
+
url = if path.start_with?('http://') || path.start_with?('https://')
|
125
|
+
path
|
126
|
+
else
|
127
|
+
"https://api.github.com/#{path}"
|
128
|
+
end
|
129
|
+
|
125
130
|
JSON.parse RestClient::Request.new(:url => url, :method => method, :payload => payload, :headers => { :accept => :json, :content_type => :json, 'Authorization' => "token #{authorization_token}", :user_agent => 'socialcast-git-extensions' }).execute
|
126
131
|
rescue RestClient::Exception => e
|
127
132
|
process_error e
|
data/spec/github_spec.rb
CHANGED
@@ -33,7 +33,7 @@ describe Socialcast::Gitx::Github do
|
|
33
33
|
:body => body
|
34
34
|
}
|
35
35
|
end
|
36
|
-
let(:dummy_pr_created_response) { {
|
36
|
+
let(:dummy_pr_created_response) { { 'dummy' => 'response' } }
|
37
37
|
let(:body) { 'This is my pull request.' }
|
38
38
|
before do
|
39
39
|
allow(test_instance).to receive(:base_branch).and_return(base_branch)
|
@@ -44,9 +44,14 @@ describe Socialcast::Gitx::Github do
|
|
44
44
|
|
45
45
|
describe '#pull_requests_for_branch' do
|
46
46
|
subject { test_instance.send(:pull_requests_for_branch, repo, branch) }
|
47
|
-
let(:
|
47
|
+
let(:branch) { 'my-http-and-https-branch' }
|
48
|
+
let(:dummy_pr_list_response) { [{ 'dummy' => 'response' }] }
|
48
49
|
before do
|
49
|
-
|
50
|
+
allow(test_instance).to receive(:authorization_token).and_return('abc123')
|
51
|
+
expect_any_instance_of(RestClient::Request).to receive(:execute) do |instance|
|
52
|
+
expect(instance.url).to eq 'https://api.github.com/repos/ownername/projectname/pulls?head=ownername:my-http-and-https-branch'
|
53
|
+
'[{ "dummy": "response" }]'
|
54
|
+
end
|
50
55
|
end
|
51
56
|
it { is_expected.to eq dummy_pr_list_response }
|
52
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialcast-git-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Socialcast
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09
|
11
|
+
date: 2016-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|