bitbucket-pr-post 0.0.3 → 0.0.4
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 +4 -4
- data/lib/bitbucket/pr/post.rb +17 -9
- data/lib/bitbucket/pr/post/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8ef01f033c2f913b2749bfc3223255355f9b2bb
|
4
|
+
data.tar.gz: 3efa94e41b45eefce0d8d14d3ea796b6e1270f17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bd2284a6ba2fb438d31c61bea16b3dffee864c2a1d8661bd9be87ce1b9921d4897ed1bfac481a3b511891dce1f7950fe588536549c9182b43fad24c62085b27
|
7
|
+
data.tar.gz: 57275eb28a7325306e9eb819ece761602e1e061c9086ee35a4764330adf4cea93f61d9c9892c54453046403eaf5e94e4a76d9533a18fd4b833d9fe4b9e55971f
|
data/lib/bitbucket/pr/post.rb
CHANGED
@@ -24,11 +24,12 @@ module Bitbucket
|
|
24
24
|
o.on('-ps', '--public-slug=SLUG(Public Repository Name)'){|v| @opts[:public_slug] = v }
|
25
25
|
o.on('-ms', '--master-slug=SLUG(MasterRepository Name)'){|v| @opts[:master_slug] = v }
|
26
26
|
o.on('-u', '--user=Bitbucket User'){|v| @opts[:user] = v }
|
27
|
-
o.on('-
|
27
|
+
o.on('-D', '--debug'){|v| @opts[:debug] = v }
|
28
28
|
o.on('-y', '--yes'){|v| @opts[:yes] = v }
|
29
29
|
o.on('-o', '--open-diff-url'){|v| @opts[:open_diff_url] = v}
|
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
|
+
o.on('-d', '--description'){|v| @opts[:description] = v }
|
32
33
|
|
33
34
|
o.parse!(argv)
|
34
35
|
|
@@ -75,17 +76,23 @@ module Bitbucket
|
|
75
76
|
@notice = ''
|
76
77
|
else
|
77
78
|
@title = `git log --summary --shortstat -1 --format="%s" --no-color --no-notes | head -1`.strip
|
78
|
-
@
|
79
|
+
@title_notice = "\n ^ This is Last Commit Mesasge. Use Option `--title` If You Want Change."
|
80
|
+
end
|
81
|
+
|
82
|
+
if @opts[:description]
|
83
|
+
@description = @opts[:description]
|
84
|
+
else
|
85
|
+
@description = `git log --summary -1 --format="%b" --no-color --no-notes`.strip
|
86
|
+
@description_notice = "\n ^ This is Last Commit Mesasge. Use Option `--description` If You Want Change."
|
79
87
|
end
|
80
|
-
@description = @opts[:description] || ''
|
81
88
|
|
82
89
|
debug_print @opts
|
83
90
|
end
|
84
91
|
|
85
92
|
def confirm
|
86
93
|
puts <<-CONFIRM
|
87
|
-
title: #{@title}#{@
|
88
|
-
description: #{@description}
|
94
|
+
title: #{@title}#{@title_notice}
|
95
|
+
description: #{@description.gsub("\n", "\n ")}#{@description_notice}
|
89
96
|
src: #{@user}/#{@public_slug}/#{@branch}
|
90
97
|
v v v
|
91
98
|
v v v
|
@@ -105,15 +112,16 @@ description: #{@description}
|
|
105
112
|
|
106
113
|
def request_data
|
107
114
|
data = {
|
108
|
-
title: @title
|
109
|
-
description: @description,
|
115
|
+
title: @title,
|
116
|
+
description: "#{@description}",
|
110
117
|
source: {
|
111
118
|
branch: { name: @branch },
|
112
119
|
repository: { full_name: "#{@user}/#{@public_slug}" }
|
113
120
|
},
|
114
121
|
destination: {
|
115
122
|
branch: { name: "master" },
|
116
|
-
}
|
123
|
+
},
|
124
|
+
"close_source_branch": true
|
117
125
|
}
|
118
126
|
|
119
127
|
debug_print(JSON.pretty_generate data)
|
@@ -132,7 +140,7 @@ description: #{@description}
|
|
132
140
|
-H "Content-Type: application/json"
|
133
141
|
-u #{@user}:#{@pass}
|
134
142
|
https://api.bitbucket.org/2.0/repositories/#{@dst_user}/#{@master_slug}/pullrequests/
|
135
|
-
-d '#{request_data}'
|
143
|
+
-d '#{request_data.gsub("'"){"\\'"}}'
|
136
144
|
}
|
137
145
|
cmd = curl.join " "
|
138
146
|
debug_print cmd
|
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.4
|
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-
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|