bitbucket-pr-post 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bitbucket-pr-post-0.0.3.gem +0 -0
- data/lib/bitbucket/pr/post.rb +8 -5
- data/lib/bitbucket/pr/post/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b4555de2af9a29fb0b75cf86ecdc1fb0c0e80ac
|
4
|
+
data.tar.gz: 86c87cf6a12e2468253bd1e111c4d014d925039e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fdbdfec86adef46cb405b4c40e6054e8c92faed7dab46d3309ae3f946ce375826ac8ba10654b7826f7736c4adc2f8ca73bd4f10b7a397bacee5d1cc6efd87b6
|
7
|
+
data.tar.gz: 01853f7dfc39f40f6167bdfa187a5f1361744c6c6355ca24676297fb7e9c8f6ed69f1f516e2d6d2e5bf2f3971ff47be615383fe18356de12c9a1f30d87138221
|
Binary file
|
data/lib/bitbucket/pr/post.rb
CHANGED
@@ -26,7 +26,7 @@ module Bitbucket
|
|
26
26
|
o.on('-u', '--user=Bitbucket User'){|v| @opts[:user] = v }
|
27
27
|
o.on('-D', '--debug'){|v| @opts[:debug] = v }
|
28
28
|
o.on('-y', '--yes'){|v| @opts[:yes] = v }
|
29
|
-
o.on('-o', '--open-
|
29
|
+
o.on('-o', '--open-url'){|v| @opts[:open_url] = true}
|
30
30
|
o.on('-b', '--dst-branch=Destination Branch'){|v| @opts[:dst_branch] = v}
|
31
31
|
o.on('-U', '--update'){|v| @opts[:update] = v}
|
32
32
|
o.on('-d', '--description'){|v| @opts[:description] = v }
|
@@ -133,6 +133,9 @@ description: #{@description.gsub("\n", "\n ")}#{@description_notice}
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def post
|
136
|
+
tempfile = `mktemp`.strip
|
137
|
+
File.write tempfile, request_data.gsub("\n", "\r\n")
|
138
|
+
|
136
139
|
curl = %W{
|
137
140
|
curl
|
138
141
|
--silent
|
@@ -140,7 +143,7 @@ description: #{@description.gsub("\n", "\n ")}#{@description_notice}
|
|
140
143
|
-H "Content-Type: application/json"
|
141
144
|
-u #{@user}:#{@pass}
|
142
145
|
https://api.bitbucket.org/2.0/repositories/#{@dst_user}/#{@master_slug}/pullrequests/
|
143
|
-
-d
|
146
|
+
-d @#{tempfile}
|
144
147
|
}
|
145
148
|
cmd = curl.join " "
|
146
149
|
debug_print cmd
|
@@ -160,13 +163,13 @@ description: #{@description.gsub("\n", "\n ")}#{@description_notice}
|
|
160
163
|
if e = result_json['error']
|
161
164
|
print_response_error(e)
|
162
165
|
else
|
163
|
-
url = result_json['links']['
|
166
|
+
url = result_json['links']['html']['href']
|
164
167
|
puts 'OK!'
|
165
|
-
if @opts[:
|
168
|
+
if @opts[:open_url]
|
166
169
|
puts "Open Browser..."
|
167
170
|
`open #{url}`
|
168
171
|
else
|
169
|
-
puts "
|
172
|
+
puts "URL: #{url}"
|
170
173
|
end
|
171
174
|
end
|
172
175
|
rescue => e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitbucket-pr-post
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hiroshi kobayashi
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- bin/bit_bucket_pr_post
|
55
55
|
- bitbucket-pr-post-0.0.1.gem
|
56
56
|
- bitbucket-pr-post-0.0.2.gem
|
57
|
+
- bitbucket-pr-post-0.0.3.gem
|
57
58
|
- bitbucket-pr-post.gemspec
|
58
59
|
- lib/bitbucket/pr/post.rb
|
59
60
|
- lib/bitbucket/pr/post/version.rb
|