socialcast-git-extensions 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,4 +18,9 @@ repo = `git config -z --get remote.origin.url`.strip
18
18
  # ex: git@github.com:socialcast/socialcast-git-extensions.git
19
19
  repo = repo.scan(/:(.+\/.+)\./).first.first
20
20
  url = create_pull_request username, password, branch, repo
21
- share "@SocialcastDevelopers #reviewrequest for #{branch} #scgitx", {:url => url, :message_type => 'review_request'}
21
+
22
+ if url
23
+ share "@SocialcastDevelopers #reviewrequest for #{branch} #scgitx", {:url => url, :message_type => 'review_request'}
24
+ else
25
+ puts "Skipping socialcast announcement"
26
+ end
@@ -5,9 +5,17 @@ module Socialcast
5
5
  module Github
6
6
  def create_pull_request(username, password, branch, repo)
7
7
  payload = {:title => branch, :base => 'master', :head => branch}.to_json
8
- response = RestClient::Request.new(:url => "https://api.github.com/repos/#{repo}/pulls", :method => "POST", :user => username, :password => password, :payload => payload, :headers => {:accept => :json, :content_type => :json}).execute
9
- data = JSON.parse response.body
10
- url = data['html_url']
8
+ begin
9
+ puts "Creating pull request for #{branch} against master in #{repo}"
10
+ response = RestClient::Request.new(:url => "https://api.github.com/repos/#{repo}/pulls", :method => "POST", :user => username, :password => password, :payload => payload, :headers => {:accept => :json, :content_type => :json}).execute
11
+ data = JSON.parse response.body
12
+ url = data['html_url']
13
+ rescue RestClient::Exception => e
14
+ data = JSON.parse e.http_body
15
+ puts "Failed to create pull request: #{data['message']}"
16
+ false
17
+ end
11
18
  end
12
19
  end
13
20
  end
21
+
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module Gitx
3
- VERSION = "2.3.0"
3
+ VERSION = "2.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast-git-extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 0
10
- version: 2.3.0
9
+ - 1
10
+ version: 2.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek
@@ -15,10 +15,12 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-05 00:00:00 Z
18
+ date: 2012-01-13 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
21
+ name: grit
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
22
24
  none: false
23
25
  requirements:
24
26
  - - ">="
@@ -27,12 +29,12 @@ dependencies:
27
29
  segments:
28
30
  - 0
29
31
  version: "0"
30
- requirement: *id001
31
- prerelease: false
32
- name: grit
33
32
  type: :runtime
33
+ version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
35
+ name: git_remote_branch
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
36
38
  none: false
37
39
  requirements:
38
40
  - - ">="
@@ -41,12 +43,12 @@ dependencies:
41
43
  segments:
42
44
  - 0
43
45
  version: "0"
44
- requirement: *id002
45
- prerelease: false
46
- name: git_remote_branch
47
46
  type: :runtime
47
+ version_requirements: *id002
48
48
  - !ruby/object:Gem::Dependency
49
- version_requirements: &id003 !ruby/object:Gem::Requirement
49
+ name: highline
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
50
52
  none: false
51
53
  requirements:
52
54
  - - ">="
@@ -55,12 +57,12 @@ dependencies:
55
57
  segments:
56
58
  - 0
57
59
  version: "0"
58
- requirement: *id003
59
- prerelease: false
60
- name: highline
61
60
  type: :runtime
61
+ version_requirements: *id003
62
62
  - !ruby/object:Gem::Dependency
63
- version_requirements: &id004 !ruby/object:Gem::Requirement
63
+ name: socialcast
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
64
66
  none: false
65
67
  requirements:
66
68
  - - ">="
@@ -71,12 +73,12 @@ dependencies:
71
73
  - 3
72
74
  - 4
73
75
  version: 0.3.4
74
- requirement: *id004
75
- prerelease: false
76
- name: socialcast
77
76
  type: :runtime
77
+ version_requirements: *id004
78
78
  - !ruby/object:Gem::Dependency
79
- version_requirements: &id005 !ruby/object:Gem::Requirement
79
+ name: rest-client
80
+ prerelease: false
81
+ requirement: &id005 !ruby/object:Gem::Requirement
80
82
  none: false
81
83
  requirements:
82
84
  - - ">="
@@ -87,12 +89,12 @@ dependencies:
87
89
  - 4
88
90
  - 0
89
91
  version: 1.4.0
90
- requirement: *id005
91
- prerelease: false
92
- name: rest-client
93
92
  type: :runtime
93
+ version_requirements: *id005
94
94
  - !ruby/object:Gem::Dependency
95
- version_requirements: &id006 !ruby/object:Gem::Requirement
95
+ name: json_pure
96
+ prerelease: false
97
+ requirement: &id006 !ruby/object:Gem::Requirement
96
98
  none: false
97
99
  requirements:
98
100
  - - ">="
@@ -101,12 +103,12 @@ dependencies:
101
103
  segments:
102
104
  - 0
103
105
  version: "0"
104
- requirement: *id006
105
- prerelease: false
106
- name: json_pure
107
106
  type: :runtime
107
+ version_requirements: *id006
108
108
  - !ruby/object:Gem::Dependency
109
- version_requirements: &id007 !ruby/object:Gem::Requirement
109
+ name: rake
110
+ prerelease: false
111
+ requirement: &id007 !ruby/object:Gem::Requirement
110
112
  none: false
111
113
  requirements:
112
114
  - - "="
@@ -118,12 +120,12 @@ dependencies:
118
120
  - 2
119
121
  - 2
120
122
  version: 0.9.2.2
121
- requirement: *id007
122
- prerelease: false
123
- name: rake
124
123
  type: :development
124
+ version_requirements: *id007
125
125
  - !ruby/object:Gem::Dependency
126
- version_requirements: &id008 !ruby/object:Gem::Requirement
126
+ name: shoulda
127
+ prerelease: false
128
+ requirement: &id008 !ruby/object:Gem::Requirement
127
129
  none: false
128
130
  requirements:
129
131
  - - "="
@@ -134,10 +136,8 @@ dependencies:
134
136
  - 11
135
137
  - 3
136
138
  version: 2.11.3
137
- requirement: *id008
138
- prerelease: false
139
- name: shoulda
140
139
  type: :development
140
+ version_requirements: *id008
141
141
  description: GIT it done!
142
142
  email:
143
143
  - ryan@socialcast.com