socialcast-git-extensions 1.3.2 → 1.4.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2
1
+ 1.4.0
@@ -8,7 +8,7 @@ raise "Cannot release reserved branch" if %w{master staging}.include?(branch)
8
8
 
9
9
  tickets = assert_tickets_provided(ARGV, branch)
10
10
 
11
- exit unless HighLine.ask("This will release #{branch} to production. Are you sure (y/n)? ") == 'y'
11
+ exit unless HighLine.agree("Release #{branch} to production? (y/n)")
12
12
 
13
13
  run_cmd 'git update'
14
14
  integrate branch, 'master'
@@ -19,23 +19,23 @@ issues_with_no_branch = issues.reject do |issue|
19
19
  issue.customFieldValues.detect {|k| k.customfieldId == GIT_BRANCH_FIELD }
20
20
  end
21
21
  if issues_with_no_branch.any?
22
- puts "\n\nThe following tickets do not have a git branch configured:"
22
+ HighLine.say "\n<%= color('The following tickets do NOT have a git branch properly configured:', :red) %>"
23
23
  issues_with_no_branch.each do |issue|
24
- puts "#{issue.key} - #{issue.summary}"
24
+ print_issue issue
25
25
  end
26
26
  end
27
27
 
28
28
  branches.each do |branch|
29
- puts "\n\nChecking state of branch #{branch}:"
29
+ HighLine.say "\nThe changes on branch <%= color('#{branch}', :green) %> "
30
30
  if branches(:merged => true, :remote => true).include?(branch)
31
- puts "All changes in #{branch} have been merged into master"
31
+ HighLine.say "<%= color('HAVE', :green) %> been merged into master"
32
32
  releasable_tickets = tickets_from_branch(branch).select do |issue|
33
- puts "#{issue.key} - #{issue.summary}"
34
- HighLine.ask("Mark this issue as released? (y/n)? ") == 'y'
33
+ print_issue issue
34
+ HighLine.agree("Mark this issue as released? (y/n)")
35
35
  end
36
36
  release_tickets releasable_tickets
37
37
  else
38
- puts "#{branch} has NOT yet been merged into master"
38
+ HighLine.say "<%= color('HAVE NOT', :red) %> been merged into master"
39
39
  end
40
40
  end
41
41
 
@@ -5,7 +5,7 @@ include Socialcast
5
5
 
6
6
  branch = current_branch
7
7
 
8
- puts "updating #{branch} to have most recent changes from master"
8
+ HighLine.say "updating <%= color('#{branch}', :green) %> to have most recent changes from master"
9
9
  run_cmd "git pull origin #{branch}" rescue nil
10
10
  run_cmd 'git pull origin master'
11
11
  run_cmd 'git push origin HEAD'
@@ -35,7 +35,7 @@ module Socialcast
35
35
  @jira.login credentials[:username], credentials[:password]
36
36
  return @jira
37
37
  rescue => e
38
- puts "Error: #{e.message}"
38
+ print_error e
39
39
  File.delete config_file
40
40
  raise e
41
41
  end
@@ -59,14 +59,14 @@ module Socialcast
59
59
  end
60
60
  def update_tickets(tickets, options = {})
61
61
  tickets.each do |ticket|
62
- puts "Updating ticket: #{ticket.key} - #{ticket.summary}"
62
+ HighLine.say "Updating ticket: <%= color('#{ticket.key}', :green) %> - #{ticket.summary}"
63
63
  fields = []
64
64
  fields << Jira4R::V2::RemoteFieldValue.new(GIT_BRANCH_FIELD, [options[:branch]]) if options[:branch]
65
65
  fields << Jira4R::V2::RemoteFieldValue.new(IN_STAGING_FIELD, ['true']) if options[:in_staging]
66
66
  begin
67
67
  jira_server.updateIssue ticket.key, fields
68
68
  rescue => e
69
- puts "Error updating ticket: #{e.message}"
69
+ HighLine.say "<%= color('Error: #{e.message}', :red)"
70
70
  end
71
71
  end
72
72
  end
@@ -90,13 +90,19 @@ module Socialcast
90
90
  begin
91
91
  jira_server.progressWorkflowAction issue.key, action.to_s, []
92
92
  rescue => e
93
- puts "Error updating ticket: #{e.message}"
93
+ print_error e
94
94
  end
95
95
  end
96
96
  end
97
+ def print_issue(issue)
98
+ HighLine.say "<%= color('#{issue.key}', :green) - #{issue.summary}"
99
+ end
100
+ def print_error(e)
101
+ HighLine.say "<%= color('Error: #{e.message}', :red)"
102
+ end
97
103
 
98
104
  def run_cmd(cmd)
99
- puts "\nRunning: #{cmd}"
105
+ HighLine.say "\n> <%= color('#{cmd}', :red) %>"
100
106
  raise "#{cmd} failed" unless system cmd
101
107
  end
102
108
 
@@ -125,7 +131,7 @@ module Socialcast
125
131
  end
126
132
 
127
133
  def integrate(branch, destination_branch = 'staging')
128
- puts "integrating #{branch} into #{destination_branch}"
134
+ HighLine.say "integrating <%= color('#{branch}', :green) %> into <%= color('#{destination_branch}', :green) %>"
129
135
  run_cmd "git remote prune origin"
130
136
  unless destination_branch == 'master'
131
137
  run_cmd "git branch -D #{destination_branch}" rescue nil
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{socialcast-git-extensions}
8
- s.version = "1.3.2"
8
+ s.version = "1.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ryan Sonnek"]
12
- s.date = %q{2010-08-30}
12
+ s.date = %q{2010-09-09}
13
13
  s.description = %q{git extension scripts for socialcast workflow}
14
14
  s.email = %q{ryan@socialcast.com}
15
15
  s.executables = ["git-integrate", "git-promote", "git-prune-merged", "git-release", "git-release-pending", "git-reset-staging", "git-start", "git-track", "git-update", "git-wtf"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast-git-extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 3
9
- - 2
10
- version: 1.3.2
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-30 00:00:00 -05:00
18
+ date: 2010-09-09 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency