bitbucket-pr-post 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8ef01f033c2f913b2749bfc3223255355f9b2bb
4
- data.tar.gz: 3efa94e41b45eefce0d8d14d3ea796b6e1270f17
3
+ metadata.gz: 6b4555de2af9a29fb0b75cf86ecdc1fb0c0e80ac
4
+ data.tar.gz: 86c87cf6a12e2468253bd1e111c4d014d925039e
5
5
  SHA512:
6
- metadata.gz: 6bd2284a6ba2fb438d31c61bea16b3dffee864c2a1d8661bd9be87ce1b9921d4897ed1bfac481a3b511891dce1f7950fe588536549c9182b43fad24c62085b27
7
- data.tar.gz: 57275eb28a7325306e9eb819ece761602e1e061c9086ee35a4764330adf4cea93f61d9c9892c54453046403eaf5e94e4a76d9533a18fd4b833d9fe4b9e55971f
6
+ metadata.gz: 6fdbdfec86adef46cb405b4c40e6054e8c92faed7dab46d3309ae3f946ce375826ac8ba10654b7826f7736c4adc2f8ca73bd4f10b7a397bacee5d1cc6efd87b6
7
+ data.tar.gz: 01853f7dfc39f40f6167bdfa187a5f1361744c6c6355ca24676297fb7e9c8f6ed69f1f516e2d6d2e5bf2f3971ff47be615383fe18356de12c9a1f30d87138221
@@ -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-diff-url'){|v| @opts[:open_diff_url] = v}
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 '#{request_data.gsub("'"){"\\'"}}'
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']['diff']['href']
166
+ url = result_json['links']['html']['href']
164
167
  puts 'OK!'
165
- if @opts[:open_diff_url]
168
+ if @opts[:open_url]
166
169
  puts "Open Browser..."
167
170
  `open #{url}`
168
171
  else
169
- puts "Diff URL: #{url}"
172
+ puts "URL: #{url}"
170
173
  end
171
174
  end
172
175
  rescue => e
@@ -1,7 +1,7 @@
1
1
  module Bitbucket
2
2
  module Pr
3
3
  class Post
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  end
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
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