ticketmaster-kanbanpad 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -62,6 +62,10 @@ module KanbanpadAPI
62
62
  def steps(options = {})
63
63
  Step.find(:all, :params => options.update(:project_id => slug))
64
64
  end
65
+
66
+ def comments(options = {})
67
+ ProjectComment.find(:all, :params => options.update(:project_id => slug))
68
+ end
65
69
  end
66
70
 
67
71
  class Task < Base
@@ -75,8 +79,8 @@ module KanbanpadAPI
75
79
  find(:all, :params => options.merge(:slug => project_id), :from => :backlog)
76
80
  end
77
81
 
78
- def comments
79
- self.note
82
+ def comments(options = {})
83
+ TaskComment.find(:all, :params => options.merge(prefix_options).update(:id => id))
80
84
  end
81
85
  end
82
86
 
@@ -84,8 +88,17 @@ module KanbanpadAPI
84
88
  self.site += 'projects/:project_id/'
85
89
 
86
90
  def tickets(options = {})
87
- Task.find(:all, :params => options.merge(prefix_options).update(:q => %{slug:"#{project_id}"}))
91
+ Task.find(:all, :params => options.merge(prefix_options))
88
92
  end
89
93
  end
90
-
94
+
95
+ class ProjectComment < Base
96
+ self.site += 'projects/:project_id/'
97
+ self.element_name = 'comment'
98
+ end
99
+
100
+ class TaskComment < Base
101
+ self.site += 'projects/:project_id/tasks/:id'
102
+ self.element_name = 'comment'
103
+ end
91
104
  end
@@ -0,0 +1,8 @@
1
+ [
2
+ {"email":"sonia@g.com", "id":"7e2cad4b3cbe5954950c","slug":"7e2cad4b3cbe5954950c","name":"project1",
3
+ "wip_limit":"10", "organization_id":"4cd428da96f0734eef000008", "collaborator_ids":"4cd428da96f0734eef000009",
4
+ "privacy":"0"},
5
+ {"email":"jhon@g.com", "id":"be74b643b64e3dc79aa0","slug":"be74b643b64e3dc79aa0","name":"project2",
6
+ "wip_limit":"10", "organization_id":"4cd428da96f0734eef000008", "collaborator_ids":"4cd428da96f0734eef000009",
7
+ "privacy":"0"}
8
+ ]
@@ -0,0 +1,2 @@
1
+ {"email":"crist@g.com", "id":"be74b643b64e3dc79aa0","slug":"be74b643b64e3dc79aa0","name":"Untitled",
2
+ "wip_limit":"10", "privacy":"0"}
@@ -0,0 +1,7 @@
1
+ [{"id":"4cd428c496f0734eef000007","title":"Configure app","assigned_to":"jhon",
2
+ "note":"","wip":"false","project_slug":"7e2cad4b3cbe5954950c",
3
+ "project_id":"7e2cad4b3cbe5954950c","backlog":"false","finished":"false"},
4
+ {"id":"4cd428c496f0734eef000008","title":"Fix issue","assigned_to":"james",
5
+ "note":"","wip":"false","project_slug":"7e2cad4b3cbe5954950c",
6
+ "project_id":"7e2cad4b3cbe5954950c","backlog":"false","finished":"true"}
7
+ ]
@@ -0,0 +1,3 @@
1
+ {"id":"4cd428c496f0734eef000007","title":"Fix UI detail","assigned_to":"jhon",
2
+ "note":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.","wip":"false","project_slug":"be74b643b64e3dc79aa0",
3
+ "project_id":"be74b643b64e3dc79aa0","backlog":"false","finished":"false"}
@@ -0,0 +1,3 @@
1
+ {"id":"4cd428c496f0734eef000008","title":"Fix bug","assigned_to":"chris",
2
+ "note":"","wip":"false","project_slug":"be74b643b64e3dc79aa0",
3
+ "project_id":"be74b643b64e3dc79aa0","backlog":"false","finished":"true"}
@@ -2,17 +2,18 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "Ticketmaster::Provider::Kanbanpad::Project" do
4
4
  before(:all) do
5
- headers = {}
5
+ headers = {'Authorization' => 'Basic YWJjQGcuY29tOmllODIzZDYzanM='}
6
+ wheaders = headers.merge('Accept' => 'application/json')
6
7
  @project_id = 'be74b643b64e3dc79aa0'
7
8
  ActiveResource::HttpMock.respond_to do |mock|
8
- mock.get '/api/v1/projects.xml', headers, fixture_for('projects'), 200
9
- mock.get '/api/v1/projects/be74b643b64e3dc79aa0.xml', headers, fixture_for('projects/be74b643b64e3dc79aa0'), 200
9
+ mock.get '/api/v1/projects.json', wheaders, fixture_for('projects'), 200
10
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0.json', wheaders, fixture_for('projects/be74b643b64e3dc79aa0'), 200
10
11
  #mock.get '/api/v1/projects/create.xml', headers, fixture_for('projects/create'), 200
11
12
  end
12
13
  end
13
14
 
14
15
  before(:each) do
15
- @ticketmaster = TicketMaster.new(:kanbanpad, {})
16
+ @ticketmaster = TicketMaster.new(:kanbanpad, :username => 'abc@g.com', :password => 'ie823d63js')
16
17
  @klass = TicketMaster::Provider::Kanbanpad::Project
17
18
  end
18
19
 
data/spec/spec_helper.rb CHANGED
@@ -11,6 +11,6 @@ Spec::Runner.configure do |config|
11
11
  end
12
12
 
13
13
  def fixture_for(name)
14
- File.read(File.dirname(__FILE__) + '/fixtures/' + name + '.xml')
14
+ File.read(File.dirname(__FILE__) + '/fixtures/' + name + '.json')
15
15
  end
16
16
 
data/spec/tickets_spec.rb CHANGED
@@ -2,18 +2,19 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "Ticketmaster::Provider::Kanbanpad::Ticket" do
4
4
  before(:all) do
5
- headers = {}
5
+ headers = {'Authorization' => 'Basic YWJjQGcuY29tOmllODIzZDYzanM='}
6
+ wheaders = headers.merge('Accept' => 'application/json')
6
7
  ActiveResource::HttpMock.respond_to do |mock|
7
- mock.get '/api/v1/projects/be74b643b64e3dc79aa0.xml', headers, fixture_for('projects/be74b643b64e3dc79aa0'), 200
8
- mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks.xml', headers, fixture_for('tasks'), 200
9
- mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks/4cd428c496f0734eef000007.xml', headers, fixture_for('tasks/4cd428c496f0734eef000007'), 200
8
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0.json', wheaders, fixture_for('projects/be74b643b64e3dc79aa0'), 200
9
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks.json', wheaders, fixture_for('tasks'), 200
10
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks/4cd428c496f0734eef000007.json', wheaders, fixture_for('tasks/4cd428c496f0734eef000007'), 200
10
11
  end
11
12
  @project_id = 'be74b643b64e3dc79aa0'
12
13
  @ticket_id = '4cd428c496f0734eef000007'
13
14
  end
14
15
 
15
16
  before(:each) do
16
- @ticketmaster = TicketMaster.new(:kanbanpad, {})
17
+ @ticketmaster = TicketMaster.new(:kanbanpad, :username => 'abc@g.com', :password => 'ie823d63js')
17
18
  @project = @ticketmaster.project(@project_id)
18
19
  @klass = TicketMaster::Provider::Kanbanpad::Ticket
19
20
  @comment_klass = TicketMaster::Provider::Kanbanpad::Comment
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-kanbanpad}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["HybridGroup"]
12
- s.date = %q{2010-12-15}
12
+ s.date = %q{2011-01-21}
13
13
  s.description = %q{Allows ticketmaster to interact with kanbanpad.}
14
14
  s.email = %q{sonia@hybridgroup.com}
15
15
  s.extra_rdoc_files = [
@@ -29,11 +29,16 @@ Gem::Specification.new do |s|
29
29
  "lib/ticketmaster-kanbanpad.rb",
30
30
  "rakefile",
31
31
  "spec/comments_spec.rb",
32
+ "spec/fixtures/projects.json",
32
33
  "spec/fixtures/projects.xml",
34
+ "spec/fixtures/projects/be74b643b64e3dc79aa0.json",
33
35
  "spec/fixtures/projects/be74b643b64e3dc79aa0.xml",
34
36
  "spec/fixtures/projects/create.xml",
37
+ "spec/fixtures/tasks.json",
35
38
  "spec/fixtures/tasks.xml",
39
+ "spec/fixtures/tasks/4cd428c496f0734eef000007.json",
36
40
  "spec/fixtures/tasks/4cd428c496f0734eef000007.xml",
41
+ "spec/fixtures/tasks/4cd428c496f0734eef000008.json",
37
42
  "spec/fixtures/tasks/4cd428c496f0734eef000008.xml",
38
43
  "spec/fixtures/tasks/create.xml",
39
44
  "spec/projects_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: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
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: 2010-12-15 00:00:00 -08:00
18
+ date: 2011-01-21 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -56,11 +56,16 @@ files:
56
56
  - lib/ticketmaster-kanbanpad.rb
57
57
  - rakefile
58
58
  - spec/comments_spec.rb
59
+ - spec/fixtures/projects.json
59
60
  - spec/fixtures/projects.xml
61
+ - spec/fixtures/projects/be74b643b64e3dc79aa0.json
60
62
  - spec/fixtures/projects/be74b643b64e3dc79aa0.xml
61
63
  - spec/fixtures/projects/create.xml
64
+ - spec/fixtures/tasks.json
62
65
  - spec/fixtures/tasks.xml
66
+ - spec/fixtures/tasks/4cd428c496f0734eef000007.json
63
67
  - spec/fixtures/tasks/4cd428c496f0734eef000007.xml
68
+ - spec/fixtures/tasks/4cd428c496f0734eef000008.json
64
69
  - spec/fixtures/tasks/4cd428c496f0734eef000008.xml
65
70
  - spec/fixtures/tasks/create.xml
66
71
  - spec/projects_spec.rb