socialcast-git-extensions 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  gem.email = "ryan@socialcast.com"
11
11
  gem.homepage = "http://github.com/wireframe/socialcast-git-extensions"
12
12
  gem.authors = ["Ryan Sonnek"]
13
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
13
+ gem.add_development_dependency "shoulda", ">= 0"
14
14
  gem.add_runtime_dependency "grit", ">= 0"
15
15
  gem.add_runtime_dependency "wireframe-jira4r", ">= 0"
16
16
  gem.add_runtime_dependency "activesupport", ">= 0"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
1
+ 2.0.3
@@ -36,7 +36,7 @@ module Socialcast
36
36
  @jira.login credentials[:username], credentials[:password]
37
37
  return @jira
38
38
  rescue => e
39
- print_error e
39
+ print_error e.message
40
40
  File.delete config_file
41
41
  raise e
42
42
  end
@@ -68,39 +68,48 @@ module Socialcast
68
68
  begin
69
69
  jira_server.updateIssue ticket.key, fields
70
70
  rescue => e
71
- HighLine.say "<%= color('Error: #{e.message}', :red) %>"
71
+ print_error e.message
72
72
  end
73
73
  end
74
74
  end
75
+ STANDARD_WORKFLOW_TYPES = []
76
+ STANDARD_WORKFLOW_TYPES << 1 #bug
77
+ STANDARD_WORKFLOW_TYPES << 2 #feature
78
+ STANDARD_WORKFLOW_TYPES << 9 #story
79
+
80
+ WORKFLOW_MAPPINGS = {
81
+ :start => {:standard => 11, :other => 21},
82
+ :resolve => {:standard => 21, :other => nil},
83
+ :release => {:standard => 101, :other => 31}
84
+ }
75
85
  def start_tickets(tickets)
76
- tickets.each do |ticket|
77
- transition_ticket_if_has_status ticket, 1, 11
78
- end
86
+ transition_tickets tickets, :start
79
87
  end
80
88
  def resolve_tickets(tickets)
81
- tickets.each do |ticket|
82
- transition_ticket_if_has_status ticket, 3, 21
83
- end
89
+ start_tickets tickets
90
+ transition_tickets tickets, :resolve
84
91
  end
85
92
  def release_tickets(tickets)
86
- tickets.each do |ticket|
87
- transition_ticket_if_has_status ticket, 5, 101
88
- end
93
+ resolve_tickets tickets
94
+ transition_tickets tickets, :release
89
95
  end
90
- def transition_ticket_if_has_status(issue, status, action)
91
- if issue.status == status.to_s
96
+ def transition_tickets(tickets, action)
97
+ tickets.each do |ticket|
92
98
  begin
93
- jira_server.progressWorkflowAction issue.key, action.to_s, []
99
+ mappings = WORKFLOW_MAPPINGS[action]
100
+ transition = STANDARD_WORKFLOW_TYPES.include?(ticket.type.to_i) ? mappings[:standard] : mappings[:other]
101
+ next unless transition
102
+ jira_server.progressWorkflowAction ticket.key, transition.to_s, []
94
103
  rescue => e
95
- print_error e
104
+ print_error "Unable to transition issue #{ticket.key} to #{action}"
96
105
  end
97
106
  end
98
107
  end
99
108
  def print_issue(issue)
100
109
  HighLine.say "<%= color('#{issue.key}', :green) %> - #{issue.summary}"
101
110
  end
102
- def print_error(e)
103
- HighLine.say "<%= color('Error: #{e.message}', :red)"
111
+ def print_error(message)
112
+ HighLine.say "<%= color('Error: ', :red) %> - #{message}"
104
113
  end
105
114
 
106
115
  def run_cmd(cmd)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{socialcast-git-extensions}
8
- s.version = "2.0.2"
8
+ s.version = "2.0.3"
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{2011-01-12}
12
+ s.date = %q{2011-02-02}
13
13
  s.description = %q{git extension scripts for socialcast workflow}
14
14
  s.email = %q{ryan@socialcast.com}
15
15
  s.executables = ["git-release-staging", "git-track", "git-start", "git-reset-prototype", "git-integrate", "git-update", "git-wtf", "git-reset-staging", "git-release", "git-prune-merged", "git-promote"]
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  ]
42
42
  s.homepage = %q{http://github.com/wireframe/socialcast-git-extensions}
43
43
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.4.2}
44
+ s.rubygems_version = %q{1.5.0}
45
45
  s.summary = %q{git extension scripts for socialcast workflow}
46
46
  s.test_files = [
47
47
  "test/helper.rb",
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
52
52
  s.specification_version = 3
53
53
 
54
54
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
55
- s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
55
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
56
56
  s.add_runtime_dependency(%q<grit>, [">= 0"])
57
57
  s.add_runtime_dependency(%q<wireframe-jira4r>, [">= 0"])
58
58
  s.add_runtime_dependency(%q<activesupport>, [">= 0"])
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
60
60
  s.add_runtime_dependency(%q<highline>, [">= 0"])
61
61
  s.add_runtime_dependency(%q<socialcast>, [">= 0.3.3"])
62
62
  else
63
- s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
63
+ s.add_dependency(%q<shoulda>, [">= 0"])
64
64
  s.add_dependency(%q<grit>, [">= 0"])
65
65
  s.add_dependency(%q<wireframe-jira4r>, [">= 0"])
66
66
  s.add_dependency(%q<activesupport>, [">= 0"])
@@ -69,7 +69,7 @@ Gem::Specification.new do |s|
69
69
  s.add_dependency(%q<socialcast>, [">= 0.3.3"])
70
70
  end
71
71
  else
72
- s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
72
+ s.add_dependency(%q<shoulda>, [">= 0"])
73
73
  s.add_dependency(%q<grit>, [">= 0"])
74
74
  s.add_dependency(%q<wireframe-jira4r>, [">= 0"])
75
75
  s.add_dependency(%q<activesupport>, [">= 0"])
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 2
10
- version: 2.0.2
9
+ - 3
10
+ version: 2.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek
@@ -15,11 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-12 00:00:00 -06:00
18
+ date: 2011-02-02 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: thoughtbot-shoulda
22
+ name: shoulda
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  requirements: []
189
189
 
190
190
  rubyforge_project:
191
- rubygems_version: 1.4.2
191
+ rubygems_version: 1.5.0
192
192
  signing_key:
193
193
  specification_version: 3
194
194
  summary: git extension scripts for socialcast workflow