github-pivotal-flow 0.0.1 → 0.0.2

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: a4e63d5c7d9eda8c218b536bf973127a9ed3fd48
4
- data.tar.gz: fcc22c50ee4958a67ffdad288bd13bdb86adaa90
3
+ metadata.gz: 41d93212c015bebe3e118fae331f0dbae4f0629b
4
+ data.tar.gz: 3a1c6280059635bac3eb3e88b5fcfe89ada37a80
5
5
  SHA512:
6
- metadata.gz: 85fb6cea0fbc88c4abd12b1622557378db19758037bb495b3132471fd01403a66fbfd7a724918a6316655d9a19bd455adbf2037ab34970be48a9828b45011df1
7
- data.tar.gz: bec91a2d14f3cc3e597a0de10e03917ff8eef9efb8d65a3378d1c249a4a084a4c387775952eafa6bf0d0b3b3950e132f5d731ff051a36d7298ed11a8ab15b65f
6
+ metadata.gz: fdda8f5bae9595d3cfa1e78e436daa5dd8794b938fccb856e026072fc1cdc8f3a6504127d9255ba07fab38b326bb86ddce2f1853d70ab495cc955d3b6b21ce47
7
+ data.tar.gz: b2d8b5fa2d673009dca2d83171a918048c6b4257ddd6296c2902c47721e4e0f5fc74084b55197850531e9f35f7061250645196a18ccd8c2bbb4c90a10d31835c
data/LICENSE CHANGED
@@ -1,14 +1,19 @@
1
- # Git Pivotal Tracker Integration
2
- # Copyright (c) 2013 the original author or authors.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
1
+ # Copyright (c) 2014 Donald Piret.
2
+ Permission is hereby granted, free of charge, to any person obtaining
3
+ a copy of this software and associated documentation files (the
4
+ "Software"), to deal in the Software without restriction, including
5
+ without limitation the rights to use, copy, modify, merge, publish,
6
+ distribute, sublicense, and/or sell copies of the Software, and to
7
+ permit persons to whom the Software is furnished to do so, subject to
8
+ the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be
11
+ included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -17,7 +17,7 @@ module GithubPivotalFlow
17
17
  @options[:args] = args
18
18
 
19
19
  @repository_root = Git.repository_root
20
- @configuration = Configuration.new
20
+ @configuration = Configuration.new(@options)
21
21
 
22
22
  PivotalTracker::Client.token = @configuration.api_token
23
23
  PivotalTracker::Client.use_ssl = true
@@ -29,6 +29,7 @@ module GithubPivotalFlow
29
29
  @configuration.master_branch
30
30
  @configuration.feature_prefix
31
31
  @configuration.hotfix_prefix
32
+ @configuration.release_prefix
32
33
  end
33
34
 
34
35
  # The main entry point to the command's execution
@@ -44,14 +45,8 @@ module GithubPivotalFlow
44
45
  opts.banner = "Usage: git start <feature|chore|bug|story_id> | git finish"
45
46
  opts.on("-t", "--api-token=", "Pivotal Tracker API key") { |k| options[:api_token] = k }
46
47
  opts.on("-p", "--project-id=", "Pivotal Tracker project id") { |p| options[:project_id] = p }
47
- opts.on("-n", "--full-name=", "Your Pivotal Tracker full name") { |n| options[:full_name] = n }
48
48
  opts.on_tail("-h", "--help", "This usage guide") { put opts.to_s; exit 0 }
49
49
  end.parse!(args)
50
50
  end
51
-
52
- def current_branch_name
53
- Git.branch_name
54
- end
55
-
56
51
  end
57
52
  end
@@ -4,7 +4,8 @@ require 'uri'
4
4
  module GithubPivotalFlow
5
5
  # A class that exposes configuration that commands can use
6
6
  class Configuration
7
- def initialize
7
+ def initialize(options = {})
8
+ @options = options
8
9
  @github_password_cache = {}
9
10
  end
10
11
 
@@ -15,7 +16,7 @@ module GithubPivotalFlow
15
16
  #
16
17
  # @return [String] The user's Pivotal Tracker API token
17
18
  def api_token
18
- api_token = Git.get_config KEY_API_TOKEN, :inherited
19
+ api_token = @options[:api_token] || Git.get_config(KEY_API_TOKEN, :inherited)
19
20
 
20
21
  if api_token.empty?
21
22
  api_token = ask('Pivotal API Token (found at https://www.pivotaltracker.com/profile): ').strip
@@ -33,7 +34,7 @@ module GithubPivotalFlow
33
34
  #
34
35
  # @return [String] The repository's Pivotal Tracker project id
35
36
  def project_id
36
- project_id = Git.get_config KEY_PROJECT_ID, :inherited
37
+ project_id = @options[:project_id] || Git.get_config(KEY_PROJECT_ID, :inherited)
37
38
 
38
39
  if project_id.empty?
39
40
  project_id = choose do |menu|
@@ -22,7 +22,6 @@ module GithubPivotalFlow
22
22
  opts.banner = "Usage: git finish [options]"
23
23
  opts.on("-t", "--api-token=", "Pivotal Tracker API key") { |k| options[:api_token] = k }
24
24
  opts.on("-p", "--project-id=", "Pivotal Tracker project id") { |p| options[:project_id] = p }
25
- opts.on("-n", "--full-name=", "Your Pivotal Tracker full name") { |n| options[:full_name] = n }
26
25
  opts.on("-m", "--message=", "Specify a commit message") { |m| options[:commit_message] = m }
27
26
 
28
27
  opts.on("--no-complete", "Do not mark the story completed on Pivotal Tracker") { options[:no_complete] = true }
@@ -1,17 +1,9 @@
1
- # Utilities for dealing with the shell
2
1
  module GithubPivotalFlow
3
2
  class Shell
4
-
5
- # Executes a command
6
- #
7
- # @param [String] command the command to execute
8
- # @param [Boolean] abort_on_failure whether to +Kernel#abort+ with +FAIL+ as
9
- # the message when the command's +Status#existstatus+ is not +0+
10
- # @return [String] the result of the command
11
3
  def self.exec(command, abort_on_failure = true)
12
4
  result = `#{command}`
13
5
  if $?.exitstatus != 0 && abort_on_failure
14
- puts "Failed command: #{command}"
6
+ print "Failed command: #{command} "
15
7
  abort 'FAIL'
16
8
  end
17
9
 
@@ -31,7 +31,6 @@ module GithubPivotalFlow
31
31
  opts.banner = "Usage: git start <feature|chore|bug|story_id>"
32
32
  opts.on("-t", "--api-token=", "Pivotal Tracker API key") { |k| options[:api_token] = k }
33
33
  opts.on("-p", "--project-id=", "Pivotal Tracker project id") { |p| options[:project_id] = p }
34
- opts.on("-n", "--full-name=", "Your Pivotal Tracker full name") { |n| options[:full_name] = n }
35
34
 
36
35
  opts.on_tail("-h", "--help", "This usage guide") { put opts.to_s; exit 0 }
37
36
  end.parse!(args)
@@ -31,11 +31,5 @@ module GithubPivotalFlow
31
31
 
32
32
  @start.run!
33
33
  end
34
-
35
- describe "create_branch" do
36
- pending
37
- #Git.should_receive(:get_config).with('user.name').and_return('test_owner')
38
-
39
- end
40
34
  end
41
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-pivotal-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Piret
@@ -155,7 +155,7 @@ files:
155
155
  - spec/github_pivotal_flow/story_spec.rb
156
156
  homepage: https://github.com/roomorama/github-pivotal-flow
157
157
  licenses:
158
- - Apache 2.0
158
+ - MIT
159
159
  metadata: {}
160
160
  post_install_message:
161
161
  rdoc_options: []