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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e246ed7320ac673c0e1d0b66720249cdd2ba47fe
4
- data.tar.gz: e3045c65de0dc31393243f6bb1fec4c8cdc5d3c9
3
+ metadata.gz: 4f007cd6b37ff304ff37f6712db30c370d96b85d
4
+ data.tar.gz: 1e4acd1cf3bc85d5ffbb1493145703f21fe9b4b1
5
5
  SHA512:
6
- metadata.gz: 763609183537f9398bbca609d9a11cfb73bb82af8a9bad530356336fb726bf676fe39480b06f7481dcecaf444142520e09f1f018da02e2703286ab21fe021bd5
7
- data.tar.gz: 97048dcbbb09f6b56855b1a505c43fb2207b0b684408f763369032da07d8005380bceff7ab3db120b57b129b800a60fcada6845f203ff00cc711ba91d9121ea0
6
+ metadata.gz: 878573f347f416136d6fe3e87e4dd52d60f94011ce5c6a30e74b1c63be82342d0558b9303b777cba3b5a840f1599dde25fcbc68de3746456156d67b358953573
7
+ data.tar.gz: 5dce84076a7149e17f14e6dbac1920f1a2febfa7f140a8a230a1aa2270f0565cfc187864553956fbcf775eb5f45814e36d61720725ad15c177b37e802a9866b2
@@ -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('-s', '--slug=SLUG(Repository Name)'){|v| @opts[:slug] = v }
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,@slug = url[:pub].split /[@:\/]/
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,@slug = url[:master].split /[@:\/]/
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 = @opts[:user] || @user
62
- @slug = @opts[:slug] || @slug.sub('.git', '')
63
- @branch = @opts[:branch] || `git branch | grep '*'`.split(" ")[1]
64
- @dst_branch = @opts[:dst_branch] || 'master'
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}/#{@slug}/#{@branch}
89
+ src: #{@user}/#{@public_slug}/#{@branch}
88
90
  v v v
89
91
  v v v
90
- dst: #{@dst_user}/#{@slug}/#{@dst_branch}
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}/#{@slug}" }
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}/#{@slug}/pullrequests/
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 " "
@@ -1,7 +1,7 @@
1
1
  module Bitbucket
2
2
  module Pr
3
3
  class Post
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
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.2
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-25 00:00:00.000000000 Z
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