bitbucket-pr-post 0.0.2 → 0.0.3
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.2.gem +0 -0
- data/lib/bitbucket/pr/post.rb +13 -11
- data/lib/bitbucket/pr/post/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f007cd6b37ff304ff37f6712db30c370d96b85d
|
4
|
+
data.tar.gz: 1e4acd1cf3bc85d5ffbb1493145703f21fe9b4b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 878573f347f416136d6fe3e87e4dd52d60f94011ce5c6a30e74b1c63be82342d0558b9303b777cba3b5a840f1599dde25fcbc68de3746456156d67b358953573
|
7
|
+
data.tar.gz: 5dce84076a7149e17f14e6dbac1920f1a2febfa7f140a8a230a1aa2270f0565cfc187864553956fbcf775eb5f45814e36d61720725ad15c177b37e802a9866b2
|
Binary file
|
data/lib/bitbucket/pr/post.rb
CHANGED
@@ -21,7 +21,8 @@ module Bitbucket
|
|
21
21
|
o = OptionParser.new
|
22
22
|
o.on('-p', '--pass=Bitbucket Password'){|v| @opts[:pass] = v }
|
23
23
|
o.on('-t', '--title=PR Title'){|v| @opts[:title] = v }
|
24
|
-
o.on('-
|
24
|
+
o.on('-ps', '--public-slug=SLUG(Public Repository Name)'){|v| @opts[:public_slug] = v }
|
25
|
+
o.on('-ms', '--master-slug=SLUG(MasterRepository Name)'){|v| @opts[:master_slug] = v }
|
25
26
|
o.on('-u', '--user=Bitbucket User'){|v| @opts[:user] = v }
|
26
27
|
o.on('-d', '--debug'){|v| @opts[:debug] = v }
|
27
28
|
o.on('-y', '--yes'){|v| @opts[:yes] = v }
|
@@ -41,11 +42,11 @@ module Bitbucket
|
|
41
42
|
end
|
42
43
|
|
43
44
|
if url[:pub]
|
44
|
-
dummy,domain,@pub_user,@
|
45
|
+
dummy,domain,@pub_user,@public_slug = url[:pub].split /[@:\/]/
|
45
46
|
end
|
46
47
|
|
47
48
|
if url[:master]
|
48
|
-
dummy,domain,@master_user,@
|
49
|
+
dummy,domain,@master_user,@master_slug = url[:master].split /[@:\/]/
|
49
50
|
@dst_user = @master_user
|
50
51
|
end
|
51
52
|
|
@@ -58,10 +59,11 @@ module Bitbucket
|
|
58
59
|
|
59
60
|
@user = @pub_user || @master_user
|
60
61
|
|
61
|
-
@user
|
62
|
-
@
|
63
|
-
@
|
64
|
-
@
|
62
|
+
@user = @opts[:user] || @user
|
63
|
+
@public_slug = @opts[:pubilc_slug] || @public_slug.sub('.git', '')
|
64
|
+
@master_slug = @opts[:master_slug] || @master_slug.sub('.git', '')
|
65
|
+
@branch = @opts[:branch] || `git branch | grep '*'`.split(" ")[1]
|
66
|
+
@dst_branch = @opts[:dst_branch] || 'master'
|
65
67
|
|
66
68
|
if @branch == 'master'
|
67
69
|
puts "Current Branch is master!"
|
@@ -84,10 +86,10 @@ module Bitbucket
|
|
84
86
|
puts <<-CONFIRM
|
85
87
|
title: #{@title}#{@notice}
|
86
88
|
description: #{@description}
|
87
|
-
src: #{@user}/#{@
|
89
|
+
src: #{@user}/#{@public_slug}/#{@branch}
|
88
90
|
v v v
|
89
91
|
v v v
|
90
|
-
dst: #{@dst_user}/#{@
|
92
|
+
dst: #{@dst_user}/#{@master_slug}/#{@dst_branch}
|
91
93
|
|
92
94
|
CONFIRM
|
93
95
|
|
@@ -107,7 +109,7 @@ description: #{@description}
|
|
107
109
|
description: @description,
|
108
110
|
source: {
|
109
111
|
branch: { name: @branch },
|
110
|
-
repository: { full_name: "#{@user}/#{@
|
112
|
+
repository: { full_name: "#{@user}/#{@public_slug}" }
|
111
113
|
},
|
112
114
|
destination: {
|
113
115
|
branch: { name: "master" },
|
@@ -129,7 +131,7 @@ description: #{@description}
|
|
129
131
|
-X #{method}
|
130
132
|
-H "Content-Type: application/json"
|
131
133
|
-u #{@user}:#{@pass}
|
132
|
-
https://api.bitbucket.org/2.0/repositories/#{@dst_user}/#{@
|
134
|
+
https://api.bitbucket.org/2.0/repositories/#{@dst_user}/#{@master_slug}/pullrequests/
|
133
135
|
-d '#{request_data}'
|
134
136
|
}
|
135
137
|
cmd = curl.join " "
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hiroshi kobayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- Rakefile
|
54
54
|
- bin/bit_bucket_pr_post
|
55
55
|
- bitbucket-pr-post-0.0.1.gem
|
56
|
+
- bitbucket-pr-post-0.0.2.gem
|
56
57
|
- bitbucket-pr-post.gemspec
|
57
58
|
- lib/bitbucket/pr/post.rb
|
58
59
|
- lib/bitbucket/pr/post/version.rb
|