pivotal-integration 1.6.0.2 → 1.6.0.3

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDA0MzQ0NjdkMTNiN2ViMTViM2Y0MGU2YmYzN2M5Nzg4OGRmMjAxYw==
4
+ ZGUzMzE5YTYzZWZmNDU1MTdmOTgwNTUxNjY4OWEwZDVhZGZmZTg0MA==
5
5
  data.tar.gz: !binary |-
6
- ZDI5NmVkMTI4YWRhZjk0M2M4NzgzODg2MTg3MDBlMTAzZDI5ZWY1OQ==
6
+ MTA3MTFlNGJjYjk1NDUzMDQ1ZDhjMmQyNzE1ZjdmZjVhMDZhNjM1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDc3OWNmMzYzMzg4YzMyOWE2NzQ3OGFjNjBmMWYxODNiZGIwMTQ5ZmRlNTk4
10
- NDBhN2VmYjcwYTM4NzU4ZDFhOGVkYzBiZWI4NWMwNjIzNTcwNGJkOWU3OWFi
11
- YjI5M2Y0NWViMGRmOTFlZTE2NGYyNTc5OTE2NThjZjkyZTAzMzA=
9
+ NjUwYzc3MmZjZGViNzA2ZmQyNTc3OWJjMWYxMDBjMDhhYjA0MjhjZDJkM2I1
10
+ YzNhMmY2OGJlYWY5ZmE2NDZiZmY0MDdiMmYyNjI4N2VlNTQ2YTA3NTc0M2Fk
11
+ Yjg1YjdlODIxMzg3ZWE5MTFlY2Y2MzQwN2E0NTA5ZjQ5NDYwMmQ=
12
12
  data.tar.gz: !binary |-
13
- YjEzODE1ODdkMTU4ODk0Nzc1NjdhMjQ3Y2YwZmVlZjQ4ZmY3YmIwNmRjYTZh
14
- NDlhZTUyZjFiY2YwYzliMTgwYTVmZWI2ODg5NjBlOTk4ODk5NGUwMGFhMDMw
15
- ZWRmN2U4M2RmMjIwZDlkODM1YWQwNjUwZmViYTcyNmUzNzk0MmE=
13
+ MjZkY2FlMTEwNjFmNDg0NTQzMjAwMTc5ZjhlNjZlN2VlMDU0OTlmNzI2ZTNj
14
+ NGFiYWJjOTRlZDZiOTAyMzUzNGYzYjc1ZDUyZjU1MTJkZTczM2RmNTJhYzA1
15
+ YTUzYzY1MzY2ODY3NjEyYzFmZDQxZWU5M2FiNDIzZDJkZTcyODY=
data/bin/pivotal CHANGED
@@ -91,7 +91,7 @@ begin
91
91
  command_class = PivotalIntegration::Command.const_get(command.classify)
92
92
  command_class.new(options).run(*ARGV)
93
93
 
94
- elsif ARGV.empty?
94
+ elsif ARGV.empty? || ARGV.first == 'help'
95
95
  show_help
96
96
 
97
97
  else
@@ -33,8 +33,11 @@ class PivotalIntegration::Command::Finish < PivotalIntegration::Command::Base
33
33
  pull_request = @options.fetch(:pull_request, false) || PivotalIntegration::Util::Git.finish_mode == :pull_request
34
34
 
35
35
  if pull_request
36
+ root_branch = PivotalIntegration::Util::Git.get_config('root-branch', :branch)
37
+ root_branch = nil if root_branch == 'master'
38
+
36
39
  PivotalIntegration::Util::Git.push PivotalIntegration::Util::Git.branch_name
37
- PivotalIntegration::Util::Git.create_pull_request(@configuration.story)
40
+ PivotalIntegration::Util::Git.create_pull_request(@configuration.story, root_branch)
38
41
  PivotalIntegration::Util::Story.mark(@configuration.story, :finished)
39
42
  return
40
43
  end
@@ -0,0 +1,7 @@
1
+ class PivotalIntegration::Command::Version < PivotalIntegration::Command::Base
2
+ desc "Show the version of this utility"
3
+
4
+ def run(*arguments)
5
+ puts PivotalIntegration::VERSION
6
+ end
7
+ end
@@ -171,13 +171,22 @@ class PivotalIntegration::Util::Git
171
171
  end
172
172
  end
173
173
 
174
- def self.create_pull_request(story)
174
+ def self.create_pull_request(story, to_branch = nil)
175
175
  case get_config_with_default('pivotal.pull-request-editor', :web).to_sym
176
176
  when :web
177
177
  # Open the PR editor in a web browser
178
178
  repo = get_config('remote.origin.url')[/(?<=git@github.com:)[a-z0-9_-]+\/[a-z0-9_-]+/]
179
- title = CGI::escape("[##{story.id}] #{story.name}]")
180
- Launchy.open "https://github.com/#{repo}/compare/#{branch_name}?expand=1&pull_request[title]=#{title}"
179
+ title = CGI::escape("[##{story.id}] #{story.name}")
180
+
181
+ url = "https://github.com/#{repo}/compare/"
182
+
183
+ if to_branch
184
+ upstream = get_config('remote.upstream.url')[/(?<=git@github.com:)[a-z0-9_-]+/]
185
+ url << "#{upstream}:#{to_branch}..."
186
+ end
187
+
188
+ url << "#{branch_name}?expand=1&pull_request[title]=#{title}"
189
+ Launchy.open url
181
190
 
182
191
  else
183
192
  print 'Checking for hub installation... '
@@ -15,5 +15,5 @@
15
15
 
16
16
  # The root module for the project
17
17
  module PivotalIntegration
18
- VERSION = '1.6.0.2'
18
+ VERSION = '1.6.0.3'
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0.2
4
+ version: 1.6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hale
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-27 00:00:00.000000000 Z
12
+ date: 2014-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime
@@ -177,6 +177,7 @@ files:
177
177
  - lib/pivotal-integration/command/release.rb
178
178
  - lib/pivotal-integration/command/start.rb
179
179
  - lib/pivotal-integration/command/switch.rb
180
+ - lib/pivotal-integration/command/version.rb
180
181
  - lib/pivotal-integration/util/git.rb
181
182
  - lib/pivotal-integration/util/label.rb
182
183
  - lib/pivotal-integration/util/shell.rb