cover_my_meds 3.2.6 → 3.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cover_my_meds.gemspec +1 -1
- data/lib/cover_my_meds/api_request.rb +7 -1
- data/lib/cover_my_meds/error.rb +4 -4
- data/lib/cover_my_meds/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90d48e240df3b84572410a5d5e7b31c6ba2cd2d1c19a7d3e6b67aa5ebe3df258
|
4
|
+
data.tar.gz: 270acc5b6c5848c40f90017d44f2d6bf43a7b09967e8553ef38edb485873530f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1fa46150f6b114918c0b36d94665060bfca384c2cf39394e43ec0b19f527f0e2bd28d0085da45f4671f26e74a00e2e666bafcd425408dc14c603660761276ba
|
7
|
+
data.tar.gz: 6826f771ae6e8447fc0ee78c24176491d9f0027043b759b4359285ec687f5cfb215e183c5bbe5444230270c0594af7e9efa72879a960bb4200d7b9393558bb88
|
data/cover_my_meds.gemspec
CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_runtime_dependency "typhoeus"
|
35
35
|
spec.add_runtime_dependency "mime-types"
|
36
36
|
spec.add_runtime_dependency "hashie", ">= 3.4.0"
|
37
|
-
spec.add_runtime_dependency "activesupport"
|
37
|
+
spec.add_runtime_dependency "activesupport", '>= 4.2.2'
|
38
38
|
end
|
@@ -38,7 +38,7 @@ module CoverMyMeds
|
|
38
38
|
request.headers.merge! headers
|
39
39
|
request.body = block_given? ? yield : {}
|
40
40
|
end
|
41
|
-
raise Error::HTTPError.new(response.status, response.body, http_method,
|
41
|
+
raise Error::HTTPError.new(response.status, response.body, http_method, url(host, path, params)) unless response.success?
|
42
42
|
|
43
43
|
parse_response response
|
44
44
|
end
|
@@ -49,5 +49,11 @@ module CoverMyMeds
|
|
49
49
|
rescue JSON::ParserError
|
50
50
|
response.body
|
51
51
|
end
|
52
|
+
|
53
|
+
def url(host, path, params)
|
54
|
+
"#{host}#{path}".tap do |url|
|
55
|
+
url << "?#{params.to_query}" if params.present?
|
56
|
+
end
|
57
|
+
end
|
52
58
|
end
|
53
59
|
end
|
data/lib/cover_my_meds/error.rb
CHANGED
@@ -2,22 +2,22 @@ module CoverMyMeds
|
|
2
2
|
module Error
|
3
3
|
class HTTPError < StandardError
|
4
4
|
|
5
|
-
def initialize status, message, http_method,
|
5
|
+
def initialize status, message, http_method, url
|
6
6
|
@status = status
|
7
7
|
@error_json = message
|
8
8
|
@http_method = http_method
|
9
|
-
@
|
9
|
+
@url = url
|
10
10
|
end
|
11
11
|
|
12
12
|
def message
|
13
13
|
<<-EOS.gsub(/^ {10}/, "")
|
14
14
|
#{@status}: #{@error_json}
|
15
15
|
in response to:
|
16
|
-
#{@http_method.upcase} #{@
|
16
|
+
#{@http_method.upcase} #{@url}
|
17
17
|
EOS
|
18
18
|
end
|
19
19
|
|
20
|
-
attr_reader :status, :error_json, :http_method, :
|
20
|
+
attr_reader :status, :error_json, :http_method, :url
|
21
21
|
|
22
22
|
end
|
23
23
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cover_my_meds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Rolston
|
@@ -23,7 +23,7 @@ authors:
|
|
23
23
|
autorequire:
|
24
24
|
bindir: exe
|
25
25
|
cert_chain: []
|
26
|
-
date:
|
26
|
+
date: 2019-04-23 00:00:00.000000000 Z
|
27
27
|
dependencies:
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
@@ -241,14 +241,14 @@ dependencies:
|
|
241
241
|
requirements:
|
242
242
|
- - ">="
|
243
243
|
- !ruby/object:Gem::Version
|
244
|
-
version:
|
244
|
+
version: 4.2.2
|
245
245
|
type: :runtime
|
246
246
|
prerelease: false
|
247
247
|
version_requirements: !ruby/object:Gem::Requirement
|
248
248
|
requirements:
|
249
249
|
- - ">="
|
250
250
|
- !ruby/object:Gem::Version
|
251
|
-
version:
|
251
|
+
version: 4.2.2
|
252
252
|
description: The public version of CoverMyMeds API
|
253
253
|
email:
|
254
254
|
- jrolston@covermymeds.com
|
@@ -313,8 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
313
313
|
- !ruby/object:Gem::Version
|
314
314
|
version: '0'
|
315
315
|
requirements: []
|
316
|
-
|
317
|
-
rubygems_version: 2.7.7
|
316
|
+
rubygems_version: 3.0.3
|
318
317
|
signing_key:
|
319
318
|
specification_version: 4
|
320
319
|
summary: CoverMyMeds Public API
|