capitan 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/capitan.gemspec +1 -1
- data/lib/capitan.rb +14 -0
- data/lib/capitan/exceptions/connection_error.rb +16 -13
- metadata +2 -2
data/capitan.gemspec
CHANGED
data/lib/capitan.rb
CHANGED
@@ -1,4 +1,18 @@
|
|
1
1
|
module Capitan
|
2
|
+
require 'capitan/object_initializer'
|
3
|
+
require 'capitan/exceptions/connection_error'
|
4
|
+
require 'capitan/show_methods'
|
5
|
+
require 'capitan/connection'
|
6
|
+
require 'capitan/exhibition'
|
7
|
+
require 'capitan/non_ticketed_event'
|
8
|
+
require 'capitan/performance'
|
9
|
+
require 'capitan/production'
|
10
|
+
require 'capitan/shows'
|
11
|
+
require 'capitan/venue'
|
12
|
+
require 'capitan/calendar/calendar_show'
|
13
|
+
require 'capitan/calendar/day'
|
14
|
+
require 'capitan/calendar/monthly'
|
15
|
+
require 'capitan/calendar/week'
|
2
16
|
|
3
17
|
|
4
18
|
end
|
@@ -1,20 +1,23 @@
|
|
1
|
-
|
1
|
+
module Exceptions
|
2
|
+
class ConnectionError < StandardError
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
def initialize(error)
|
5
|
+
message = error.message
|
6
|
+
message = socket_error_message if error.class == SocketError
|
7
|
+
message = unauthorized_message if error.class == RestClient::Unauthorized
|
8
|
+
super(message)
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
+
private
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def socket_error_message
|
14
|
+
"Unable to connect to CAPI. Be sure that you have the correct base_url set in config.yml."
|
15
|
+
end
|
16
|
+
|
17
|
+
def unauthorized_message
|
18
|
+
"Invalid API key. Make sure a valid key is set for api_key in config.yml."
|
19
|
+
end
|
15
20
|
|
16
|
-
def unauthorized_message
|
17
|
-
"Invalid API key. Make sure a valid key is set for api_key in config.yml."
|
18
21
|
end
|
19
22
|
|
20
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capitan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|