ticketmaster-kanbanpad 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -87,7 +87,7 @@ module KanbanpadAPI
87
87
 
88
88
  class Step < Base
89
89
  self.site += 'projects/:project_id/'
90
-
90
+
91
91
  def tickets(options = {})
92
92
  Task.find(:all, :params => options.merge(prefix_options))
93
93
  end
@@ -4,9 +4,12 @@ module TicketMaster::Provider
4
4
  #
5
5
  class Ticket < TicketMaster::Provider::Base::Ticket
6
6
  API = KanbanpadAPI::Task
7
+ STEP_API = KanbanpadAPI::Step
7
8
 
8
9
  def status
9
- self.wip? ? 'in-progress' : 'queue'
10
+ return "Finished" if self.finished
11
+ return "Backlog" if self.backlog
12
+ self.wip? ? "#{step_name} - In-Progress" : "#{step_name} - Queue"
10
13
  end
11
14
 
12
15
  def description
@@ -36,7 +39,7 @@ module TicketMaster::Provider
36
39
  def self.create(*options)
37
40
  if options.first.is_a? Hash
38
41
  options.first.merge!(:assigned_to => options.first.delete('assignee'),
39
- :note => options.first[:description])
42
+ :note => options.first[:description])
40
43
  task = API.new(options.first)
41
44
  ticket = self.new task
42
45
  task.save
@@ -78,6 +81,11 @@ module TicketMaster::Provider
78
81
  []
79
82
  end
80
83
 
84
+ private
85
+ def step_name
86
+ STEP_API.find(self.step_id, :params => {:project_id => self.project_id}).name
87
+ end
88
+
81
89
  end
82
90
  end
83
91
  end
@@ -0,0 +1 @@
1
+ {"name":"Planning","queue_name":null,"wip_name":null,"id":"4dc312f49bd0ff6c37000040","wip_limit":null,"all_limit":null}
@@ -1,3 +1,3 @@
1
1
  {"id":"4cd428c496f0734eef000007","title":"Fix UI detail","assigned_to":"jhon",
2
2
  "note":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.","wip":"false","project_slug":"be74b643b64e3dc79aa0",
3
- "project_id":"be74b643b64e3dc79aa0","backlog":"false","finished":"false"}
3
+ "project_id":"be74b643b64e3dc79aa0","backlog":"false","finished":"false", "step_id":"4dc312f49bd0ff6c37000040"}
data/spec/tickets_spec.rb CHANGED
@@ -10,6 +10,7 @@ describe "Ticketmaster::Provider::Kanbanpad::Ticket" do
10
10
  mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks.json', wheaders, fixture_for('tasks'), 200
11
11
  mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks.json?backlog=yes&finished=yes', wheaders, fixture_for('tasks'), 200
12
12
  mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks/4cd428c496f0734eef000007.json', wheaders, fixture_for('tasks/4cd428c496f0734eef000007'), 200
13
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/steps/4dc312f49bd0ff6c37000040.json', wheaders, fixture_for('steps/4dc312f49bd0ff6c37000040'), 200
13
14
  end
14
15
  @project_id = 'be74b643b64e3dc79aa0'
15
16
  @ticket_id = '4cd428c496f0734eef000007'
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-kanbanpad}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["HybridGroup"]
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
35
35
  "spec/fixtures/projects/be74b643b64e3dc79aa0.json",
36
36
  "spec/fixtures/projects/be74b643b64e3dc79aa0.xml",
37
37
  "spec/fixtures/projects/create.xml",
38
+ "spec/fixtures/steps/4dc312f49bd0ff6c37000040.json",
38
39
  "spec/fixtures/tasks.json",
39
40
  "spec/fixtures/tasks.xml",
40
41
  "spec/fixtures/tasks/4cd428c496f0734eef000007.json",
@@ -51,7 +52,7 @@ Gem::Specification.new do |s|
51
52
  ]
52
53
  s.homepage = %q{http://github.com/hybridgroup/ticketmaster-kanbanpad}
53
54
  s.require_paths = ["lib"]
54
- s.rubygems_version = %q{1.6.0}
55
+ s.rubygems_version = %q{1.6.1}
55
56
  s.summary = %q{Ticketmaster Provider for Kanbanpad}
56
57
  s.test_files = [
57
58
  "spec/comments_spec.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-kanbanpad
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - HybridGroup
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-05 00:00:00 +00:00
18
+ date: 2011-05-05 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -62,6 +62,7 @@ files:
62
62
  - spec/fixtures/projects/be74b643b64e3dc79aa0.json
63
63
  - spec/fixtures/projects/be74b643b64e3dc79aa0.xml
64
64
  - spec/fixtures/projects/create.xml
65
+ - spec/fixtures/steps/4dc312f49bd0ff6c37000040.json
65
66
  - spec/fixtures/tasks.json
66
67
  - spec/fixtures/tasks.xml
67
68
  - spec/fixtures/tasks/4cd428c496f0734eef000007.json
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  requirements: []
106
107
 
107
108
  rubyforge_project:
108
- rubygems_version: 1.6.0
109
+ rubygems_version: 1.6.1
109
110
  signing_key:
110
111
  specification_version: 3
111
112
  summary: Ticketmaster Provider for Kanbanpad