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 +4 -4
- data/LICENSE +19 -14
- data/lib/github_pivotal_flow/command.rb +2 -7
- data/lib/github_pivotal_flow/configuration.rb +4 -3
- data/lib/github_pivotal_flow/finish.rb +0 -1
- data/lib/github_pivotal_flow/shell.rb +1 -9
- data/lib/github_pivotal_flow/start.rb +0 -1
- data/spec/github_pivotal_flow/start_spec.rb +0 -6
- 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: 41d93212c015bebe3e118fae331f0dbae4f0629b
|
4
|
+
data.tar.gz: 3a1c6280059635bac3eb3e88b5fcfe89ada37a80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdda8f5bae9595d3cfa1e78e436daa5dd8794b938fccb856e026072fc1cdc8f3a6504127d9255ba07fab38b326bb86ddce2f1853d70ab495cc955d3b6b21ce47
|
7
|
+
data.tar.gz: b2d8b5fa2d673009dca2d83171a918048c6b4257ddd6296c2902c47721e4e0f5fc74084b55197850531e9f35f7061250645196a18ccd8c2bbb4c90a10d31835c
|
data/LICENSE
CHANGED
@@ -1,14 +1,19 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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 =
|
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
|
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
|
-
|
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)
|
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.
|
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
|
-
-
|
158
|
+
- MIT
|
159
159
|
metadata: {}
|
160
160
|
post_install_message:
|
161
161
|
rdoc_options: []
|