ticketmaster-trac 0.3.4 → 0.3.5

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
- 0.3.4
1
+ 0.3.5
@@ -69,10 +69,9 @@ module TicketMaster::Provider
69
69
 
70
70
  def self.find_all(ticket_id)
71
71
  comments = CommentUtil.new(ticket_id,TicketMaster::Provider::Trac.api).comments
72
- unless comments.empty?
73
- comments = comments.collect { |comment| TicketMaster::Provider::Trac::Comment.new comment }
72
+ comments.select { |comment| !comment.nil? }.collect do |comment|
73
+ TicketMaster::Provider::Trac::Comment.new comment
74
74
  end
75
- comments
76
75
  end
77
76
 
78
77
  end
@@ -51,7 +51,7 @@ module TicketMaster::Provider
51
51
  options = options.first
52
52
  trac = TicketMaster::Provider::Trac.api
53
53
  if options.is_a? Hash
54
- TicketMaster::Provider::Trac::Ticket.find_by_id(trac[:trac].tickets.query(options).first, self[:name])
54
+ Ticket.find_by_id(trac[:trac].tickets.query(options).first, self[:name])
55
55
  end
56
56
  else
57
57
  TicketMaster::Provider::Trac::Ticket
@@ -60,26 +60,11 @@ module TicketMaster::Provider
60
60
 
61
61
  def ticket!(*options)
62
62
  options = options.first
63
- TicketMaster::Provider::Trac::Ticket.create options
63
+ Ticket.create options
64
64
  end
65
65
 
66
66
  def tickets(*options)
67
- mode = options.first
68
- trac = TicketMaster::Provider::Trac.api
69
- if options.empty?
70
- collect_tickets(trac[:trac].tickets.list)
71
- elsif mode.is_a? Array
72
- collect_tickets(mode)
73
- elsif mode.is_a? Hash
74
- collect_tickets(trac[:trac].tickets.query(mode))
75
- end
76
- end
77
-
78
- private
79
- def collect_tickets(tickets)
80
- tickets.collect do |ticket_id|
81
- TicketMaster::Provider::Trac::Ticket.find_by_id(ticket_id, self[:name])
82
- end
67
+ Ticket.find(self.name, options)
83
68
  end
84
69
 
85
70
  end
@@ -54,6 +54,24 @@ module TicketMaster::Provider
54
54
  end
55
55
  end
56
56
 
57
+ def self.find(project_id, *options)
58
+ mode = options[0].first
59
+ trac = TicketMaster::Provider::Trac.api
60
+ if options[0].empty?
61
+ self.find_all(project_id, trac[:trac].tickets.list)
62
+ elsif mode.is_a? Array
63
+ self.find_all(project_id, mode)
64
+ elsif mode.is_a? Hash
65
+ self.find_all(project_id, trac[:trac].tickets.query(mode))
66
+ end
67
+ end
68
+
69
+ def self.find_all(project_id, tickets)
70
+ tickets.collect do |ticket_id|
71
+ self.find_by_id(ticket_id, project_id)
72
+ end
73
+ end
74
+
57
75
  def self.create(*options)
58
76
  mandatory = options.shift
59
77
  attributes = {}
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-trac}
8
- s.version = "0.3.4"
8
+ s.version = "0.3.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rafael George"]
12
- s.date = %q{2011-04-20}
12
+ s.date = %q{2011-05-24}
13
13
  s.description = %q{Allows ticketmaster to interact with Your System.}
14
14
  s.email = %q{rafael@hybridgroup.com}
15
15
  s.extra_rdoc_files = [
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  ]
42
42
  s.homepage = %q{http://github.com/hybridgroup/ticketmaster-trac}
43
43
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.6.1}
44
+ s.rubygems_version = %q{1.6.0}
45
45
  s.summary = %q{Ticketmaster Provider for Trac}
46
46
  s.test_files = [
47
47
  "spec/comments_spec.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-trac
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- version: 0.3.4
9
+ - 5
10
+ version: 0.3.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rafael George
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-20 00:00:00 -04:00
18
+ date: 2011-05-24 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  requirements: []
188
188
 
189
189
  rubyforge_project:
190
- rubygems_version: 1.6.1
190
+ rubygems_version: 1.6.0
191
191
  signing_key:
192
192
  specification_version: 3
193
193
  summary: Ticketmaster Provider for Trac