ticketmaster-zendesk 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.8.7@ticketmaster-zendesk --create
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -36,7 +36,7 @@ module TicketMaster::Provider
36
36
 
37
37
  def tickets(*options)
38
38
  if options.empty?
39
- Ticket.find_all(self.name).collect { |ticket| Ticket.new [ticket, self.name]}
39
+ Ticket.find_all(self.name)
40
40
  elsif options.first.is_a? Array
41
41
  Ticket.find_all(self.name).select { |ticket| ticket if options.first.any? { |ticket_id| ticket_id == ticket.id }}
42
42
  elsif options.first.is_a? Hash
@@ -47,7 +47,7 @@ module TicketMaster::Provider
47
47
  def ticket(*options)
48
48
  if options.first.is_a? Fixnum
49
49
  ticket_id = options.first
50
- Ticket.find_by_id(ticket_id)
50
+ Ticket.find_by_id(self.name, ticket_id)
51
51
  elsif options.first.is_a? Hash
52
52
  Ticket.find_by_attributes(self.name, options.first).first
53
53
  else
@@ -56,7 +56,7 @@ module TicketMaster::Provider
56
56
  end
57
57
 
58
58
  def ticket!(*options)
59
- Ticket.new [ZendeskAPI::Ticket.create(options.first), self.name]
59
+ Ticket.new ZendeskAPI::Ticket.create(options.first), self.name
60
60
  end
61
61
 
62
62
  end
@@ -9,6 +9,7 @@ module TicketMaster::Provider
9
9
  API = ZendeskAPI::Ticket
10
10
 
11
11
  def initialize(*object)
12
+ return super(object.first) if object.first.is_a? Hash
12
13
  if object.first
13
14
  args = object.first
14
15
  object = args.shift
@@ -42,13 +43,11 @@ module TicketMaster::Provider
42
43
 
43
44
  def self.find_all(*options)
44
45
  project_id = options.first
45
- SEARCH_API.find(:all, :params => {:query => "status:open"}).collect { |ticket| self.new [ticket, project_id]}
46
+ SEARCH_API.find(:all, :params => {:query => "status:open"}).collect { |ticket| self.new([ticket, project_id])}
46
47
  end
47
48
 
48
- def self.find_by_id(*options)
49
- id = options.shift
50
- project_id = options.shift
51
- self.new [API.find(id), project_id]
49
+ def self.find_by_id(project_id, ticket_id)
50
+ self.new [API.find(ticket_id), project_id]
52
51
  end
53
52
 
54
53
  def self.find_by_attributes(project_id, attributes = {})
@@ -0,0 +1,88 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{ticketmaster-zendesk}
8
+ s.version = "0.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Rafael George"]
12
+ s.date = %q{2011-04-26}
13
+ s.description = %q{Allows ticketmaster to interact with Your System.}
14
+ s.email = %q{george.rafael@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".DS_Store",
21
+ ".rvmrc",
22
+ "LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/.DS_Store",
27
+ "lib/provider/comment.rb",
28
+ "lib/provider/project.rb",
29
+ "lib/provider/ticket.rb",
30
+ "lib/provider/zendesk.rb",
31
+ "lib/ticketmaster-zendesk.rb",
32
+ "lib/zendesk/zendesk-api.rb",
33
+ "spec/.DS_Store",
34
+ "spec/comments_spec.rb",
35
+ "spec/fixtures/.DS_Store",
36
+ "spec/fixtures/ticket.json",
37
+ "spec/fixtures/tickets.json",
38
+ "spec/fixtures/tickets.xml",
39
+ "spec/fixtures/tickets/2.xml",
40
+ "spec/fixtures/tickets/5.xml",
41
+ "spec/fixtures/tickets/create.xml",
42
+ "spec/projects_spec.rb",
43
+ "spec/spec.opts",
44
+ "spec/spec_helper.rb",
45
+ "spec/ticketmaster-zendesk_spec.rb",
46
+ "spec/tickets_spec.rb",
47
+ "ticketmaster-zendesk.gemspec"
48
+ ]
49
+ s.homepage = %q{http://bandw.tumblr.com}
50
+ s.require_paths = ["lib"]
51
+ s.rubygems_version = %q{1.6.1}
52
+ s.summary = %q{Ticketmaster Provider for Zendesk}
53
+ s.test_files = [
54
+ "spec/comments_spec.rb",
55
+ "spec/projects_spec.rb",
56
+ "spec/spec_helper.rb",
57
+ "spec/ticketmaster-zendesk_spec.rb",
58
+ "spec/tickets_spec.rb"
59
+ ]
60
+
61
+ if s.respond_to? :specification_version then
62
+ s.specification_version = 3
63
+
64
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
65
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
66
+ s.add_runtime_dependency(%q<ticketmaster>, [">= 0.1.0"])
67
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3.2"])
68
+ s.add_runtime_dependency(%q<activeresource>, [">= 2.3.2"])
69
+ s.add_runtime_dependency(%q<addressable>, [">= 2.1.2"])
70
+ s.add_runtime_dependency(%q<i18n>, [">= 0"])
71
+ else
72
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
73
+ s.add_dependency(%q<ticketmaster>, [">= 0.1.0"])
74
+ s.add_dependency(%q<activesupport>, [">= 2.3.2"])
75
+ s.add_dependency(%q<activeresource>, [">= 2.3.2"])
76
+ s.add_dependency(%q<addressable>, [">= 2.1.2"])
77
+ s.add_dependency(%q<i18n>, [">= 0"])
78
+ end
79
+ else
80
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
81
+ s.add_dependency(%q<ticketmaster>, [">= 0.1.0"])
82
+ s.add_dependency(%q<activesupport>, [">= 2.3.2"])
83
+ s.add_dependency(%q<activeresource>, [">= 2.3.2"])
84
+ s.add_dependency(%q<addressable>, [">= 2.1.2"])
85
+ s.add_dependency(%q<i18n>, [">= 0"])
86
+ end
87
+ end
88
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-zendesk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
4
+ hash: 27
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
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-02-07 00:00:00 +00:00
18
+ date: 2011-04-26 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -123,6 +123,7 @@ extra_rdoc_files:
123
123
  - README.md
124
124
  files:
125
125
  - .DS_Store
126
+ - .rvmrc
126
127
  - LICENSE
127
128
  - README.md
128
129
  - Rakefile
@@ -148,6 +149,7 @@ files:
148
149
  - spec/spec_helper.rb
149
150
  - spec/ticketmaster-zendesk_spec.rb
150
151
  - spec/tickets_spec.rb
152
+ - ticketmaster-zendesk.gemspec
151
153
  has_rdoc: true
152
154
  homepage: http://bandw.tumblr.com
153
155
  licenses: []
@@ -178,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
180
  requirements: []
179
181
 
180
182
  rubyforge_project:
181
- rubygems_version: 1.3.7
183
+ rubygems_version: 1.6.1
182
184
  signing_key:
183
185
  specification_version: 3
184
186
  summary: Ticketmaster Provider for Zendesk