v2gpti 0.2.0.6 → 0.2.0.7
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/git-pivotal-tracker-integration/command/base.rb +20 -0
- data/lib/git-pivotal-tracker-integration/command/deliver.rb +2 -0
- data/lib/git-pivotal-tracker-integration/command/finish.rb +1 -0
- data/lib/git-pivotal-tracker-integration/command/release.rb +2 -0
- data/lib/git-pivotal-tracker-integration/command/start.rb +8 -6
- data/lib/git-pivotal-tracker-integration/util/story.rb +1 -0
- 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: ecf71964e0ddf7088c71da7c880b5c4b1c218c26
|
4
|
+
data.tar.gz: b0494ead697980ce42243f47344b0fe811af0394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6223202ff1120d2d4193572a87b42b146f75221c21c3e65d810e28f874bbec9d8848d1a6ea224508cb6f61728b137ebe6830c33f6c608e604e70d99264d7dfd
|
7
|
+
data.tar.gz: c645e9aa6d8afac2da4e75159e00fb67e13b5bfe95b9daa355ff993836aee86b789fe4c009e0062cbff6cb8e97501f5e7a14e3d6b26401ee24cd4c38205cd54e
|
@@ -18,6 +18,8 @@ require 'git-pivotal-tracker-integration/command/configuration'
|
|
18
18
|
require 'git-pivotal-tracker-integration/util/git'
|
19
19
|
require 'pivotal-tracker'
|
20
20
|
require 'parseconfig'
|
21
|
+
require 'logger'
|
22
|
+
|
21
23
|
|
22
24
|
# An abstract base class for all commands
|
23
25
|
# @abstract Subclass and override {#run} to implement command functionality
|
@@ -30,6 +32,8 @@ class GitPivotalTrackerIntegration::Command::Base
|
|
30
32
|
# * all communication with Pivotal Tracker will be protected with SSL
|
31
33
|
# * the user has configured the project id for this repository
|
32
34
|
def initialize
|
35
|
+
self.start_logging
|
36
|
+
self.check_version
|
33
37
|
@repository_root = GitPivotalTrackerIntegration::Util::Git.repository_root
|
34
38
|
@configuration = GitPivotalTrackerIntegration::Command::Configuration.new
|
35
39
|
|
@@ -39,6 +43,22 @@ class GitPivotalTrackerIntegration::Command::Base
|
|
39
43
|
@project = PivotalTracker::Project.find @configuration.project_id
|
40
44
|
end
|
41
45
|
|
46
|
+
def start_logging
|
47
|
+
$LOG = Logger.new('/usr/local/v2gpti_local.log', 'weekly')
|
48
|
+
end
|
49
|
+
|
50
|
+
def check_version
|
51
|
+
gem_latest_version = (GitPivotalTrackerIntegration::Util::Shell.exec "gem list v2gpti --remote")[/\(.*?\)/].delete "()"
|
52
|
+
gem_installed_version = Gem.loaded_specs["v2gpti"].version
|
53
|
+
if (gem_installed_version == gem_latest_version)
|
54
|
+
$LOG.info("v2gpti verison #{gem_installed_version} is up to date.")
|
55
|
+
else
|
56
|
+
$LOG.fatal("Out of date")
|
57
|
+
abort "\n\nYou are using v2gpti version #{gem_installed_version}, but the current version is #{gem_latest_version}.\nPlease update your gem with the following command.\n\n sudo gem update v2gpti\n\n"
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
42
62
|
# The main entry point to the command's execution
|
43
63
|
# @abstract Override this method to implement command functionality
|
44
64
|
def run
|
@@ -34,8 +34,10 @@ class GitPivotalTrackerIntegration::Command::Deliver < GitPivotalTrackerIntegrat
|
|
34
34
|
# * +nil+
|
35
35
|
# @return [void]
|
36
36
|
def run(filter)
|
37
|
+
$LOG.debug("#{self.class} in project:#{@project.name} pwd:#{(GitPivotalTrackerIntegration::Util::Shell.exec 'pwd').chop} branch:#{GitPivotalTrackerIntegration::Util::Git.branch_name}")
|
37
38
|
self.check_branch
|
38
39
|
story = GitPivotalTrackerIntegration::Util::Story.select_release @project
|
40
|
+
$LOG.debug("story:#{story.name}")
|
39
41
|
|
40
42
|
GitPivotalTrackerIntegration::Util::Story.pretty_print story
|
41
43
|
|
@@ -28,6 +28,7 @@ class GitPivotalTrackerIntegration::Command::Finish < GitPivotalTrackerIntegrati
|
|
28
28
|
#
|
29
29
|
# @return [void]
|
30
30
|
def run(argument)
|
31
|
+
$LOG.debug("#{self.class} in project:#{@project.name} pwd:#{(GitPivotalTrackerIntegration::Util::Shell.exec 'pwd').chop} branch:#{GitPivotalTrackerIntegration::Util::Git.branch_name}")
|
31
32
|
no_complete = argument =~ /--no-complete/
|
32
33
|
|
33
34
|
GitPivotalTrackerIntegration::Util::Git.trivial_merge?
|
@@ -34,8 +34,10 @@ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegrat
|
|
34
34
|
# * +nil+
|
35
35
|
# @return [void]
|
36
36
|
def run(filter)
|
37
|
+
$LOG.debug("#{self.class} in project:#{@project.name} pwd:#{(GitPivotalTrackerIntegration::Util::Shell.exec 'pwd').chop} branch:#{GitPivotalTrackerIntegration::Util::Git.branch_name}")
|
37
38
|
story = GitPivotalTrackerIntegration::Util::Story.select_release(@project, filter.nil? ? 'v' : filter)
|
38
39
|
GitPivotalTrackerIntegration::Util::Story.pretty_print story
|
40
|
+
$LOG.debug("story:#{story.name}")
|
39
41
|
|
40
42
|
current_branch = GitPivotalTrackerIntegration::Util::Git.branch_name
|
41
43
|
|
@@ -34,14 +34,14 @@ class GitPivotalTrackerIntegration::Command::Start < GitPivotalTrackerIntegratio
|
|
34
34
|
# * +nil+
|
35
35
|
# @return [void]
|
36
36
|
def run(filter)
|
37
|
+
$LOG.debug("#{self.class} in project:#{@project.name} pwd:#{(GitPivotalTrackerIntegration::Util::Shell.exec 'pwd').chop} branch:#{GitPivotalTrackerIntegration::Util::Git.branch_name}")
|
37
38
|
self.check_branch
|
38
39
|
story = GitPivotalTrackerIntegration::Util::Story.select_story @project, filter
|
39
|
-
|
40
|
+
$LOG.debug("story:#{story.name}")
|
40
41
|
GitPivotalTrackerIntegration::Util::Story.pretty_print story
|
41
42
|
|
42
43
|
development_branch_name = development_branch_name story
|
43
44
|
GitPivotalTrackerIntegration::Util::Git.create_branch development_branch_name
|
44
|
-
@configuration.story = story
|
45
45
|
|
46
46
|
GitPivotalTrackerIntegration::Util::Git.add_hook 'prepare-commit-msg', File.join(File.dirname(__FILE__), 'prepare-commit-msg.sh')
|
47
47
|
|
@@ -51,14 +51,16 @@ class GitPivotalTrackerIntegration::Command::Start < GitPivotalTrackerIntegratio
|
|
51
51
|
def check_branch
|
52
52
|
|
53
53
|
current_branch = GitPivotalTrackerIntegration::Util::Git.branch_name
|
54
|
-
|
55
|
-
suggested_branch =
|
56
|
-
|
54
|
+
# suggested_branch = (GitPivotalTrackerIntegration::Util::Shell.exec "git config --get git-pivotal-tracker-integration.feature-root 2>/dev/null", false).chomp
|
55
|
+
suggested_branch = "develop"
|
56
|
+
|
57
57
|
if !suggested_branch.nil? && suggested_branch.length !=0 && current_branch != suggested_branch
|
58
|
+
$LOG.warn("Currently checked out branch is '#{current_branch}'.")
|
58
59
|
should_chage_branch = ask("Your currently checked out branch is '#{current_branch}'. Do you want to checkout '#{suggested_branch}' before starting?(Y/n)")
|
59
60
|
if should_chage_branch != "n"
|
61
|
+
$LOG.debug("Checking out branch '#{suggested_branch}'")
|
60
62
|
print "Checking out branch '#{suggested_branch}'...\n\n"
|
61
|
-
GitPivotalTrackerIntegration::Util::Shell.exec "git checkout --quiet #{suggested_branch}"
|
63
|
+
$LOG.debug(GitPivotalTrackerIntegration::Util::Shell.exec "git checkout --quiet #{suggested_branch}")
|
62
64
|
end
|
63
65
|
|
64
66
|
end
|
@@ -68,6 +68,7 @@ class GitPivotalTrackerIntegration::Util::Story
|
|
68
68
|
story = project.stories.find filter.to_i
|
69
69
|
if story.(story_type != "release")
|
70
70
|
story = nil
|
71
|
+
$LOG.fatal("Specified story##{filter} is not a valid release story")
|
71
72
|
puts "Specified story##{filter} is not a valid release story"
|
72
73
|
abort 'FAIL'
|
73
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: v2gpti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.7
|
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-
|
12
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: highline
|