ticketevolution-ruby 0.7.0 → 0.7.1
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/README.markdown +5 -1
- data/lib/docs/objects.markdown +4 -0
- data/lib/ticket_evolution/core/collection.rb +2 -1
- data/lib/ticket_evolution/core/connection.rb +2 -2
- data/lib/ticket_evolution/core/model.rb +4 -5
- data/lib/ticket_evolution/version.rb +1 -1
- data/spec/lib/ticket_evolution/core/api_error_spec.rb +6 -0
- data/spec/lib/ticket_evolution/core/collection_spec.rb +2 -4
- data/spec/lib/ticket_evolution/core/connection_spec.rb +4 -0
- data/spec/lib/ticket_evolution/core/model_spec.rb +2 -9
- data/ticketevolution-ruby.gemspec +1 -1
- metadata +24 -24
data/README.markdown
CHANGED
@@ -62,6 +62,10 @@ Each set of API credentials can be combined with a mode and api version to creat
|
|
62
62
|
# is valid. EX: Logger.new('log/te_api.log')
|
63
63
|
})
|
64
64
|
|
65
|
+
Behind the scenes we use [Faraday](https://github.com/technoweenie/faraday) with the [:net_http](https://github.com/technoweenie/faraday/blob/master/lib/faraday/adapter/net_http.rb) adapter to process connections. You can change this [adapter](https://github.com/technoweenie/faraday/tree/master/lib/faraday/adapter) by setting it on the connection class _before_ you instantiate your connection object.
|
66
|
+
|
67
|
+
TicketEvolution::Connection.adapter = :typhoeus
|
68
|
+
|
65
69
|
**Endpoint objects**
|
66
70
|
|
67
71
|
These are always (except in the case of Search) pluralized class names and match the endpoints listed at [http://developer.ticketevolution.com](http://developer.ticketevolution.com/). To instantiate an endpoint instance, create a connection object and then call the endpoints name, underscored, as a method on the connection object.
|
@@ -256,7 +260,7 @@ Click on the links next to each endpoint for more detail.
|
|
256
260
|
@venue = @connection.venues.show(id)
|
257
261
|
|
258
262
|
|
259
|
-
######ticketevolution-ruby v0.7.
|
263
|
+
######ticketevolution-ruby v0.7.1
|
260
264
|
|
261
265
|
License
|
262
266
|
-------
|
data/lib/docs/objects.markdown
CHANGED
@@ -20,6 +20,10 @@ Each set of API credentials can be combined with a mode and api version to creat
|
|
20
20
|
# is valid. EX: Logger.new('log/te_api.log')
|
21
21
|
})
|
22
22
|
|
23
|
+
Behind the scenes we use [Faraday](https://github.com/technoweenie/faraday) with the [:net_http](https://github.com/technoweenie/faraday/blob/master/lib/faraday/adapter/net_http.rb) adapter to process connections. You can change this [adapter](https://github.com/technoweenie/faraday/tree/master/lib/faraday/adapter) by setting it on the connection class _before_ you instantiate your connection object.
|
24
|
+
|
25
|
+
TicketEvolution::Connection.adapter = :typhoeus
|
26
|
+
|
23
27
|
**Endpoint objects**
|
24
28
|
|
25
29
|
These are always (except in the case of Search) pluralized class names and match the endpoints listed at [http://developer.ticketevolution.com](http://developer.ticketevolution.com/). To instantiate an endpoint instance, create a connection object and then call the endpoints name, underscored, as a method on the connection object.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module TicketEvolution
|
2
2
|
class Connection < Base
|
3
|
-
cattr_reader :default_options, :expected_options, :oldest_version_in_service
|
4
|
-
cattr_accessor :protocol, :url_base
|
3
|
+
cattr_reader :default_options, :expected_options, :oldest_version_in_service
|
4
|
+
cattr_accessor :protocol, :url_base, :adapter
|
5
5
|
|
6
6
|
@@oldest_version_in_service = 8
|
7
7
|
|
@@ -16,7 +16,7 @@ module TicketEvolution
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def plural_class
|
19
|
-
self.plural_class_name.constantize
|
19
|
+
self.plural_class_name.constantize rescue nil
|
20
20
|
end
|
21
21
|
|
22
22
|
def attributes
|
@@ -78,10 +78,9 @@ module TicketEvolution
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def method_missing(method, *args)
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
else
|
81
|
+
begin
|
82
|
+
"#{plural_class_name}::#{method.to_s.camelize}".constantize.new(:parent => plural_class.new(:parent => @connection, :id => self.id))
|
83
|
+
rescue
|
85
84
|
super
|
86
85
|
end
|
87
86
|
end
|
@@ -30,10 +30,8 @@ describe TicketEvolution::Collection do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "#all" do
|
33
|
-
it "should
|
34
|
-
subject.entries
|
35
|
-
|
36
|
-
subject.all
|
33
|
+
it "should alias entries" do
|
34
|
+
subject.all.should == subject.entries
|
37
35
|
end
|
38
36
|
end
|
39
37
|
|
@@ -47,6 +47,10 @@ describe TicketEvolution::Connection do
|
|
47
47
|
it "should be an available Faraday adapter" do
|
48
48
|
Faraday::Adapter.constants.collect{|a| a.to_s.underscore.to_sym}.should include subject
|
49
49
|
end
|
50
|
+
|
51
|
+
it "should be settable at a class level" do
|
52
|
+
klass.should respond_to :adapter=
|
53
|
+
end
|
50
54
|
end
|
51
55
|
|
52
56
|
describe "#initialize" do
|
@@ -137,16 +137,9 @@ describe TicketEvolution::Model do
|
|
137
137
|
end
|
138
138
|
|
139
139
|
describe "#method_missing" do
|
140
|
-
context "when the
|
141
|
-
it "should attempt to find a class which matches the missing method, scoped to it's plural namespace" do
|
142
|
-
instance.plural_class.should_receive(:const_defined?).with(:NoObjects)
|
143
|
-
instance.no_objects
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
context "when the method does not end in 's'" do
|
140
|
+
context "when the missing class is not found" do
|
148
141
|
it "should fall back on the default functionality" do
|
149
|
-
expect { instance.
|
142
|
+
expect { instance.no_objects }.to_not raise_error
|
150
143
|
end
|
151
144
|
end
|
152
145
|
|
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ['Ticket Evolution']
|
9
9
|
s.email = ['dev@ticketevolution.com']
|
10
|
-
s.homepage = 'https://github.com/
|
10
|
+
s.homepage = 'https://github.com/ticketevolution/ticketevolution-ruby'
|
11
11
|
s.summary = 'Integration gem for Ticket Evolution\'s API'
|
12
12
|
s.description = 'Provides Ruby wrappers for the Ticket Evolution API (http://developer.ticketevolution.com). Ticket Evolution is the industry leader in software for the Ticket Broker industry.'
|
13
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ticketevolution-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-23 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70181057522720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70181057522720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: faraday
|
27
|
-
requirement: &
|
27
|
+
requirement: &70181057521780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.7.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70181057521780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: yajl-ruby
|
38
|
-
requirement: &
|
38
|
+
requirement: &70181057540900 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.7.7
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70181057540900
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: multi_json
|
49
|
-
requirement: &
|
49
|
+
requirement: &70181057545340 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.0.4
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70181057545340
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: nokogiri
|
60
|
-
requirement: &
|
60
|
+
requirement: &70181057549480 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.4.3
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70181057549480
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: &
|
71
|
+
requirement: &70181057553060 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 2.7.1
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70181057553060
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: vcr
|
82
|
-
requirement: &
|
82
|
+
requirement: &70181057556000 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70181057556000
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: webmock
|
93
|
-
requirement: &
|
93
|
+
requirement: &70181061812160 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -101,10 +101,10 @@ dependencies:
|
|
101
101
|
version: 1.8.0
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
|
-
version_requirements: *
|
104
|
+
version_requirements: *70181061812160
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: awesome_print
|
107
|
-
requirement: &
|
107
|
+
requirement: &70181062357560 !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
110
110
|
- - ! '>='
|
@@ -112,10 +112,10 @@ dependencies:
|
|
112
112
|
version: '0'
|
113
113
|
type: :development
|
114
114
|
prerelease: false
|
115
|
-
version_requirements: *
|
115
|
+
version_requirements: *70181062357560
|
116
116
|
- !ruby/object:Gem::Dependency
|
117
117
|
name: rake
|
118
|
-
requirement: &
|
118
|
+
requirement: &70181062709940 !ruby/object:Gem::Requirement
|
119
119
|
none: false
|
120
120
|
requirements:
|
121
121
|
- - ! '>='
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
version: '0'
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
|
-
version_requirements: *
|
126
|
+
version_requirements: *70181062709940
|
127
127
|
description: Provides Ruby wrappers for the Ticket Evolution API (http://developer.ticketevolution.com).
|
128
128
|
Ticket Evolution is the industry leader in software for the Ticket Broker industry.
|
129
129
|
email:
|
@@ -288,7 +288,7 @@ files:
|
|
288
288
|
- spec/support/connection.rb
|
289
289
|
- spec/support/vcr.rb
|
290
290
|
- ticketevolution-ruby.gemspec
|
291
|
-
homepage: https://github.com/
|
291
|
+
homepage: https://github.com/ticketevolution/ticketevolution-ruby
|
292
292
|
licenses: []
|
293
293
|
post_install_message:
|
294
294
|
rdoc_options: []
|
@@ -302,7 +302,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
302
302
|
version: '0'
|
303
303
|
segments:
|
304
304
|
- 0
|
305
|
-
hash:
|
305
|
+
hash: 3800414316783008053
|
306
306
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
307
307
|
none: false
|
308
308
|
requirements:
|