ticketmaster-lighthouse 0.5.4 → 0.5.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.5.4
1
+ 0.5.5
@@ -30,12 +30,19 @@ module TicketMaster::Provider
30
30
  @@allowed_states = ['new', 'open', 'resolved', 'hold', 'invalid']
31
31
  attr_accessor :prefix_options
32
32
  API = ::Lighthouse::Ticket
33
-
33
+
34
34
  # Lighthouse limits us to a 100 ticket limit per page...
35
- # might have to implement paging later...
35
+ # Since the paging sucks...we probably want to store this rather than do a call each time
36
36
  def self.search(project_id, options = {}, limit = 1000)
37
- tickets = ::Lighthouse::Ticket.find(:all, :params => {:project_id => project_id, :limit => 100}).collect { |ticket| self.new ticket }
38
- search_by_attribute(tickets, options, limit)
37
+ page = 1
38
+ tickets = ::Lighthouse::Ticket.find(:all, :params => {:project_id => project_id, :limit => 100, :page => page})
39
+ result = []
40
+ while tickets.length > 0 and page <= 3 #limit to page 3 since lighthouse is so slow...
41
+ result += tickets.collect { |ticket| self.new ticket }
42
+ page += 1
43
+ tickets = ::Lighthouse::Ticket.find(:all, :params => {:project_id => project_id, :limit => 100, :page => page})
44
+ end
45
+ search_by_attribute(result, options, limit)
39
46
  end
40
47
 
41
48
  # This is to get the ticket id
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-lighthouse}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Hong"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-lighthouse
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 4
10
- version: 0.5.4
9
+ - 5
10
+ version: 0.5.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Hong