socialcast-git-extensions 4.1.0 → 4.1.1

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: 15c1ec40dbe8a2b80701e60dcad382fc1d151a70
4
- data.tar.gz: e3ddfaa87901257a06a9aeb846c406e1e7cd9ea6
3
+ metadata.gz: b636e86e81a35a85a4709b288c1a5a0d157c19a8
4
+ data.tar.gz: 388e65e84fe941af1e7ccbdbda072bcc5de64ccf
5
5
  SHA512:
6
- metadata.gz: e2bddfe8501060bcc653d6f2492b5565020424189690f79f9fb72e99bd3379de2b548d179e8dece8cea81a758aa71f91ae710a57756dd4cbe89dabd6dab7e8da
7
- data.tar.gz: 3685ff147e5ec0ac69d172d1450e028321de02bf72df3a0b3441af4285676ed42af86a7f624cdfff4367057e9db79c19f4e80696d1eff75091ca167dee2a30cb
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.include?('http') ? path : "https://api.github.com/#{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
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module Gitx
3
- VERSION = "4.1.0"
3
+ VERSION = "4.1.1"
4
4
  end
5
5
  end
@@ -33,7 +33,7 @@ describe Socialcast::Gitx::Github do
33
33
  :body => body
34
34
  }
35
35
  end
36
- let(:dummy_pr_created_response) { { :dummy => :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(:dummy_pr_list_response) { [{ :dummy => :response }] }
47
+ let(:branch) { 'my-http-and-https-branch' }
48
+ let(:dummy_pr_list_response) { [{ 'dummy' => 'response' }] }
48
49
  before do
49
- expect(test_instance).to receive(:github_api_request).with('GET', 'repos/ownername/projectname/pulls?head=ownername:my-branch').and_return(dummy_pr_list_response)
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.0
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-22 00:00:00.000000000 Z
11
+ date: 2016-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged