spacebunny 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spacebunny/exceptions.rb +16 -41
- data/lib/spacebunny/version.rb +1 -1
- data/spacebunny.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e843c628b58095462fa8abfb61b3da1ecc7ace8a80fb36d3d9d83e3104a34b8
|
4
|
+
data.tar.gz: 0ae2681708b26fd9de54623fa4b3949c1206ef45a5a85ffc98df99835c8b8e97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdc109e4f186794dcac69a24a66d35bdacbe5df10f8d5eb7e6edf84a00e3e38b0a30347a4ce99b68ff3dd334feef03cafcbb0d8fce19b0e40a47ddc03d3033dd
|
7
|
+
data.tar.gz: 6226b8696a98a1332a7466a04def9374d5d4e74ddab91d71c7e5fbd0f0ac501da47cfec0f0f26a0e51f5d1bb56e93fe817bae912c3b1115ffad3312a8e849271
|
@@ -1,65 +1,47 @@
|
|
1
1
|
module Spacebunny
|
2
|
-
class DeviceKeyOrClientAndSecretRequired <
|
2
|
+
class DeviceKeyOrClientAndSecretRequired < ArgumentError
|
3
3
|
def initialize(message = nil)
|
4
4
|
message = message || "A valid 'Api Key' or valid 'Client' and 'Secret' are required for auto-configuration"
|
5
5
|
super(message)
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
class
|
10
|
-
def initialize(message = nil)
|
11
|
-
message = message || 'Neither key or connection options provided!'
|
12
|
-
super(message)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class AckTypeError < Exception
|
9
|
+
class AckTypeError < ArgumentError
|
17
10
|
def initialize(message = nil)
|
18
11
|
message = message || "Ack type not valid. Use one of #{Spacebunny::AmqpClient::ACK_TYPES.map{ |t| ":#{t}" }.join(', ')}"
|
19
12
|
super(message)
|
20
13
|
end
|
21
14
|
end
|
22
15
|
|
23
|
-
class BlockRequired <
|
16
|
+
class BlockRequired < ArgumentError
|
24
17
|
def initialize(message = nil)
|
25
18
|
message = message || 'block missing. Please provide a block'
|
26
19
|
super(message)
|
27
20
|
end
|
28
21
|
end
|
29
22
|
|
30
|
-
class ChannelsMustBeAnArray <
|
23
|
+
class ChannelsMustBeAnArray < StandardError
|
31
24
|
def initialize
|
32
25
|
message = "channels option must be an Array. E.g. [:data, :alarms]"
|
33
26
|
super(message)
|
34
27
|
end
|
35
28
|
end
|
36
29
|
|
37
|
-
class
|
38
|
-
def initialize(channel = nil)
|
39
|
-
message = if channel
|
40
|
-
"Channel '#{channel}' does not exists. Is this channel enabled for the device or did you specified it on client initialization?"
|
41
|
-
else
|
42
|
-
'Channel does not exists'
|
43
|
-
end
|
44
|
-
super(message)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
class ClientRequired < Exception
|
30
|
+
class ClientRequired < ArgumentError
|
49
31
|
def initialize(message = nil)
|
50
32
|
message = message || "Missing mandatory 'client'. Spacebunny::LiveStream.new(:client => 'a_valid_client', :secret: 'a_valid_secret')"
|
51
33
|
super(message)
|
52
34
|
end
|
53
35
|
end
|
54
36
|
|
55
|
-
class LiveStreamFormatError <
|
37
|
+
class LiveStreamFormatError < StandardError
|
56
38
|
def initialize
|
57
39
|
message = "Live Stream not correctly formatted. It must be an Hash with at least 'name' and 'id' attributes"
|
58
40
|
super(message)
|
59
41
|
end
|
60
42
|
end
|
61
43
|
|
62
|
-
class LiveStreamNotFound <
|
44
|
+
class LiveStreamNotFound < StandardError
|
63
45
|
def initialize(name = nil)
|
64
46
|
message = if name
|
65
47
|
"Live Stream '#{name}' not found. Did you created and configured it?"
|
@@ -70,7 +52,7 @@ module Spacebunny
|
|
70
52
|
end
|
71
53
|
end
|
72
54
|
|
73
|
-
class LiveStreamParamError <
|
55
|
+
class LiveStreamParamError < StandardError
|
74
56
|
def initialize(live_stream_name, param_name)
|
75
57
|
live_stream_name = live_stream_name || 'no-name-provided'
|
76
58
|
"Live Stream '#{live_stream_name}' misses mandatory '#{param_name}' param"
|
@@ -78,63 +60,56 @@ module Spacebunny
|
|
78
60
|
end
|
79
61
|
end
|
80
62
|
|
81
|
-
class SecretRequired <
|
63
|
+
class SecretRequired < ArgumentError
|
82
64
|
def initialize(message = nil)
|
83
65
|
message = message || "Missing mandatory 'secret' Spacebunny::LiveStream.new(:client => 'a_valid_client', :secret: 'a_valid_secret')"
|
84
66
|
super(message)
|
85
67
|
end
|
86
68
|
end
|
87
69
|
|
88
|
-
class ClientNotConnected <
|
70
|
+
class ClientNotConnected < StandardError
|
89
71
|
def initialize(message = nil)
|
90
72
|
message = message || 'Client not connected! Check internet connection'
|
91
73
|
super(message)
|
92
74
|
end
|
93
75
|
end
|
94
76
|
|
95
|
-
class ClientNotSetup <
|
77
|
+
class ClientNotSetup < StandardError
|
96
78
|
def initialize(message = nil)
|
97
79
|
message = message || "'Client not setup. Did you call 'connect'?'"
|
98
80
|
super(message)
|
99
81
|
end
|
100
82
|
end
|
101
83
|
|
102
|
-
class DeviceIdMissing <
|
84
|
+
class DeviceIdMissing < ArgumentError
|
103
85
|
def initialize(message = nil)
|
104
86
|
message = message || "missing mandatory 'device_id' parameter. Please provide it on client initialization (see doc) or use auto-configuration"
|
105
87
|
super(message)
|
106
88
|
end
|
107
89
|
end
|
108
90
|
|
109
|
-
class EndpointError <
|
91
|
+
class EndpointError < StandardError
|
110
92
|
def initialize(message = nil)
|
111
93
|
message = message || 'Error while contacting endpoint for auto-configuration'
|
112
94
|
super(message)
|
113
95
|
end
|
114
96
|
end
|
115
97
|
|
116
|
-
class EndPointNotReachable <
|
98
|
+
class EndPointNotReachable < StandardError
|
117
99
|
def initialize(message = nil)
|
118
100
|
message = message || 'Endpoint not reachable'
|
119
101
|
super(message)
|
120
102
|
end
|
121
103
|
end
|
122
104
|
|
123
|
-
class
|
124
|
-
def initialize(protocol)
|
125
|
-
message = "protocol #{protocol} is not registered"
|
126
|
-
super(message)
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
class SchemeNotValid < Exception
|
105
|
+
class SchemeNotValid < ArgumentError
|
131
106
|
def initialize(scheme)
|
132
107
|
message = "Provided scheme #{scheme} is not valid"
|
133
108
|
super(message)
|
134
109
|
end
|
135
110
|
end
|
136
111
|
|
137
|
-
class StreamsMustBeAnArray <
|
112
|
+
class StreamsMustBeAnArray < StandardError
|
138
113
|
def initialize
|
139
114
|
message = "streams option must be an Array"
|
140
115
|
super(message)
|
data/lib/spacebunny/version.rb
CHANGED
data/spacebunny.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_ruby_version = '>= 1.9.3'
|
21
21
|
spec.add_runtime_dependency 'http', '~> 2.0.3'
|
22
|
-
spec.add_runtime_dependency 'bunny', '~> 2.
|
22
|
+
spec.add_runtime_dependency 'bunny', '~> 2.12.0'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spacebunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Verlato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.12.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.12.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.7.
|
142
|
+
rubygems_version: 2.7.7
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Space Bunny platform SDK
|