bitly_quickly 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bitly_quickly/version.rb +1 -1
- data/lib/bitly_quickly.rb +4 -4
- data/spec/lib/bitly_quickly_spec.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63dd1b93398c8f64dfedb5fd187f74257d4b612d
|
4
|
+
data.tar.gz: 544f7bd45d92e35caaa34f859e20f198497a9b8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71141e4ae5b260e34aedd4f64caa75c374760a987d42d34c363ce229b7a303eccbae4bab153775eca41fda47b0acf89700cc56ce3da72242dbed87932a171f39
|
7
|
+
data.tar.gz: 87b4d282ffe2bf6aa10da60ee922a0f0403ac7fec294e59667add7c98a10b90c1115efbdac9ab60b1bcf03519d86e5d1cdfbb6431fa0c93d31da26d51fa53a8e
|
data/lib/bitly_quickly.rb
CHANGED
@@ -6,10 +6,10 @@ require 'bitly_quickly/version'
|
|
6
6
|
# V3 Wrapper
|
7
7
|
class BitlyQuickly
|
8
8
|
class BitlyError < StandardError; end
|
9
|
-
class RateLimitExceededError < BitlyError; end
|
10
|
-
class TemporarilyUnavailableError < BitlyError; end
|
11
|
-
class NotFoundError < BitlyError; end
|
12
|
-
class InvalidRequestOrResponseError < BitlyError; end
|
9
|
+
class RateLimitExceededError < BitlyError; end # 403
|
10
|
+
class TemporarilyUnavailableError < BitlyError; end # 503
|
11
|
+
class NotFoundError < BitlyError; end # 404
|
12
|
+
class InvalidRequestOrResponseError < BitlyError; end # 500
|
13
13
|
class UnknownError < BitlyError; end
|
14
14
|
|
15
15
|
DEFAULT_API_ADDRESS = 'https://api-ssl.bitly.com'
|
@@ -93,7 +93,7 @@ describe BitlyQuickly do
|
|
93
93
|
end
|
94
94
|
|
95
95
|
it 'raises an execption' do
|
96
|
-
expect { @client.shorten('http://example.org/403') }.to raise_error
|
96
|
+
expect { @client.shorten('http://example.org/403') }.to raise_error(BitlyQuickly::RateLimitExceededError)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -103,7 +103,7 @@ describe BitlyQuickly do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it 'raises an execption' do
|
106
|
-
expect { @client.shorten('http://example.org/503') }.to raise_error
|
106
|
+
expect { @client.shorten('http://example.org/503') }.to raise_error(BitlyQuickly::TemporarilyUnavailableError)
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -113,7 +113,7 @@ describe BitlyQuickly do
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'raises an execption' do
|
116
|
-
expect { @client.shorten('http://example.org/404') }.to raise_error
|
116
|
+
expect { @client.shorten('http://example.org/404') }.to raise_error(BitlyQuickly::NotFoundError)
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -123,7 +123,7 @@ describe BitlyQuickly do
|
|
123
123
|
end
|
124
124
|
|
125
125
|
it 'raises an execption' do
|
126
|
-
expect { @client.shorten('http://example.org/500') }.to raise_error
|
126
|
+
expect { @client.shorten('http://example.org/500') }.to raise_error(BitlyQuickly::InvalidRequestOrResponseError)
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
@@ -133,7 +133,7 @@ describe BitlyQuickly do
|
|
133
133
|
end
|
134
134
|
|
135
135
|
it 'raises an execption' do
|
136
|
-
expect { @client.shorten('http://example.org/666') }.to raise_error
|
136
|
+
expect { @client.shorten('http://example.org/666') }.to raise_error(BitlyQuickly::UnknownError)
|
137
137
|
end
|
138
138
|
end
|
139
139
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitly_quickly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oldrich Vetesnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|