ticketmaster-kanbanpad 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.1.0
@@ -31,6 +31,7 @@ module KanbanpadAPI
31
31
 
32
32
  class Base < ActiveResource::Base
33
33
  self.site = "http://www.kanbanpad.com/api/v1/"
34
+ self.format = :json
34
35
  def self.inherited(base)
35
36
  KanbanpadAPI.resources << base
36
37
  super
@@ -3,12 +3,23 @@ module TicketMaster::Provider
3
3
 
4
4
  module Kanbanpad
5
5
  include TicketMaster::Provider::Base
6
- TICKET_API = KanbanpadAPI::Task
6
+ TICKET_API = KanbanpadAPI::Task
7
7
  PROJECT_API = KanbanpadAPI::Project
8
8
 
9
9
  # This is for cases when you want to instantiate using TicketMaster::Provider::Kanbanpad.new(auth)
10
10
  def self.new(auth = {})
11
11
  TicketMaster.new(:kanbanpad, auth)
12
12
  end
13
+
14
+ # The authorize and initializer for this provider
15
+ def authorize(auth = {})
16
+ @authentication ||= TicketMaster::Authenticator.new(auth)
17
+ auth = @authentication
18
+ if (auth.username.blank? and auth.email.blank?) and (auth.token.blank? and auth.password.blank?)
19
+ raise "Please provide at least a set of username and password)"
20
+ end
21
+ ::KanbanpadAPI.authenticate((auth.username.blank? ? auth.email : auth.username), (auth.password.blank? ? auth.token : auth.password))
22
+ end
23
+
13
24
  end
14
25
  end
@@ -6,9 +6,6 @@ module TicketMaster::Provider
6
6
  class Project < TicketMaster::Provider::Base::Project
7
7
  # declare needed overloaded methods here
8
8
  API = KanbanpadAPI::Project
9
-
10
- alias_method :tasks, :tickets
11
- alias_method :task, :ticket
12
9
 
13
10
  # copy from this.copy(that) copies that into this
14
11
  def copy(project)
@@ -21,6 +18,27 @@ module TicketMaster::Provider
21
18
  end
22
19
  end
23
20
 
21
+ def id
22
+ self[:slug]
23
+ end
24
+
25
+ def created_at
26
+ begin
27
+ Time.parse(self[:created_at])
28
+ rescue
29
+ self[:created_at]
30
+ end
31
+ end
32
+
33
+ def updated_at
34
+ begin
35
+ Time.parse(self[:updated_at])
36
+ rescue
37
+ self[:updated_at]
38
+ end
39
+ end
40
+
41
+
24
42
  end
25
43
  end
26
44
  end
@@ -4,6 +4,41 @@ module TicketMaster::Provider
4
4
  #
5
5
  class Ticket < TicketMaster::Provider::Base::Ticket
6
6
  API = KanbanpadAPI::Task
7
+
8
+ def status
9
+ self.wip? ? 'in-progress' : 'queue'
10
+ end
11
+
12
+ def description
13
+ self.note
14
+ end
15
+
16
+ def assignee
17
+ self.assigned_to.first
18
+ end
19
+
20
+ def project_id
21
+ self.project_slug
22
+ end
23
+
24
+ #TODO?
25
+ def comments
26
+ warn 'Kanbanpad does not have comments. Perhaps you should leave feedback to request it?'
27
+ []
28
+ end
29
+
30
+ #TODO?
31
+ def comment
32
+ warn 'Kanbanpad does not have comments. Perhaps you should leave feedback to request it?'
33
+ nil
34
+ end
35
+
36
+ #TODO?
37
+ def comment!
38
+ warn 'Kanbanpad does not have comments. Perhaps you should leave feedback to request it?'
39
+ []
40
+ end
41
+
7
42
  end
8
43
  end
9
44
  end
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
3
+ # Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-kanbanpad}
8
- s.version = "0.0.1"
8
+ s.version = "0.1.0"
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-11-23}
12
+ s.date = %q{2010-12-01}
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 = [
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 0
9
8
  - 1
10
- version: 0.0.1
9
+ - 0
10
+ version: 0.1.0
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-11-23 00:00:00 -05:00
18
+ date: 2010-12-01 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency