delighted 1.5.1 → 1.6.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/delighted.gemspec +1 -1
- data/lib/delighted/client.rb +2 -0
- data/lib/delighted/errors.rb +4 -0
- data/lib/delighted/utils.rb +2 -0
- data/lib/delighted/version.rb +1 -1
- data/test/delighted_test.rb +8 -0
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77e2093601991e7f8f6b9eec4652010b0fd7351e
|
4
|
+
data.tar.gz: 38e89bae518a39908070178da054fc42e0fc026a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca6be3ada16b93a311834767e0bd3548cdf57ec27948d74dd9ef4625e1cf2f9c77f87be09310165ddd2f1deb44e3db13cd8e4239ea5619e1bfb6a8c6dbaad6a0
|
7
|
+
data.tar.gz: 0524944ef28e1d24f53e8faa4a6ab73dcbee726ac58a5e26ecd48c13d53cda7e0b668b0231fadf4c597b9faaf404a744e313e5d4b10de8fa2be2417e189b8c08
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -166,7 +166,7 @@ Delighted.http_adapter # default: Delighted::HTTPAdapter.new
|
|
166
166
|
By default, a shared instance of `Delighted::Client` is created lazily in `Delighted.shared_client`. If you want to create your own client, perhaps for test or if you have multiple API keys, you can:
|
167
167
|
|
168
168
|
```ruby
|
169
|
-
# Create
|
169
|
+
# Create a custom client instance, and pass as last argument to resource actions
|
170
170
|
client = Delighted::Client.new(:api_key => 'API_KEY',
|
171
171
|
:api_base_url => 'https://api.delighted.com/v1',
|
172
172
|
:http_adapter => Delighted::HTTPAdapter.new)
|
data/delighted.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_dependency "multi_json"
|
21
|
-
spec.add_development_dependency "rake"
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
22
|
spec.add_development_dependency "minitest"
|
23
23
|
spec.add_development_dependency "mocha"
|
24
24
|
end
|
data/lib/delighted/client.rb
CHANGED
data/lib/delighted/errors.rb
CHANGED
data/lib/delighted/utils.rb
CHANGED
data/lib/delighted/version.rb
CHANGED
data/test/delighted_test.rb
CHANGED
@@ -5,6 +5,14 @@ class Delighted::ClientTest < Delighted::TestCase
|
|
5
5
|
assert_raises(ArgumentError) { Delighted::Client.new }
|
6
6
|
Delighted::Client.new(:api_key => '123abc')
|
7
7
|
end
|
8
|
+
|
9
|
+
def test_handles_rate_limited_response
|
10
|
+
response = Delighted::HTTPResponse.new(429, {}, Delighted::JSON.dump({ status: 429, message: "Too Many Requests" }
|
11
|
+
))
|
12
|
+
mock_http_adapter.stubs(:request).returns(response)
|
13
|
+
|
14
|
+
assert_raises(Delighted::RateLimitedError) { Delighted.shared_client.get_json("/foo") }
|
15
|
+
end
|
8
16
|
end
|
9
17
|
|
10
18
|
class Delighted::MetricsTest < Delighted::TestCase
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delighted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Dodwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '10.0'
|
34
34
|
type: :development
|
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: '0'
|
40
|
+
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mocha
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Delighted API Ruby Client.
|
@@ -73,8 +73,8 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
78
78
|
- CHANGELOG.md
|
79
79
|
- Gemfile
|
80
80
|
- LICENSE
|
@@ -113,17 +113,17 @@ require_paths:
|
|
113
113
|
- lib
|
114
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - ">"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
123
|
+
version: 1.3.1
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.6.13
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Delighted is the fastest and easiest way to gather actionable feedback from
|