v2gpti 0.2.0.6 → 0.2.0.7

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: 247e49b51d804014bf6e0f1c779a21ffc505197c
4
- data.tar.gz: 7f2bdb3539b7a6a28098429df5322adbca41aa3e
3
+ metadata.gz: ecf71964e0ddf7088c71da7c880b5c4b1c218c26
4
+ data.tar.gz: b0494ead697980ce42243f47344b0fe811af0394
5
5
  SHA512:
6
- metadata.gz: e7b6eec3f278b53223f0e76443abc07957c521bdff3865f20f0d26319f767eac420a8f9c4e119f09b1609c6d308a589019016a1d35abd9feb0e7a57ebd3eebb2
7
- data.tar.gz: 0c281281e883c0f913053ef1fac341d86347136e5072951a6ab59581c2402b893763eddaa26931f916172f32058190eece3d84da31def3cc5c279f7e495e8b3f
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 = (GitPivotalTrackerIntegration::Util::Shell.exec "git config --get git-pivotal-tracker-integration.feature-root 2>/dev/null", false).chomp
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.6
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-05-30 00:00:00.000000000 Z
12
+ date: 2014-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline