alchemy-api-rb 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alchemy-api/base.rb +3 -7
- data/lib/alchemy-api/version.rb +1 -1
- data/spec/base_spec.rb +8 -0
- 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: 47d00fe473d1c644f02a63509e6e69d48b34b2d2
|
4
|
+
data.tar.gz: adcb5b0002019f2e8e9e6a9cca8b6093b6490ed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a8d70f0b5574d37fe09c00a323e202b5400612dc16c2dd05285f7f8e54d2c83cba2c5655a9dec84bc4b16af3e186244a4069fedffac264abf6f31e52ca86082
|
7
|
+
data.tar.gz: 2dc21773e4860fda1306086665c893e75e7c8d13f6dd2e7038350753d4a669b7873549336ba97612096ed17d68d1493bc8f639985b268b5856f1c84455d07494
|
data/lib/alchemy-api/base.rb
CHANGED
@@ -7,8 +7,9 @@ module AlchemyAPI
|
|
7
7
|
|
8
8
|
def search(opts)
|
9
9
|
check_options(opts)
|
10
|
+
body = { apikey: Config.apikey }.merge!(merged_options(options))
|
10
11
|
|
11
|
-
@response = connection.post(path,
|
12
|
+
@response = connection.post(path, body)
|
12
13
|
|
13
14
|
parsed_response
|
14
15
|
end
|
@@ -39,6 +40,7 @@ module AlchemyAPI
|
|
39
40
|
|
40
41
|
def connection
|
41
42
|
@connection ||= Faraday.new(url: BASE_URL) do |builder|
|
43
|
+
builder.request :url_encoded
|
42
44
|
builder.adapter :excon
|
43
45
|
end
|
44
46
|
end
|
@@ -66,11 +68,5 @@ module AlchemyAPI
|
|
66
68
|
def path
|
67
69
|
"#{mode}/#{web_method}"
|
68
70
|
end
|
69
|
-
|
70
|
-
def construct_body
|
71
|
-
body = { apikey: Config.apikey }.merge!(merged_options(options))
|
72
|
-
|
73
|
-
body.map { |e| e.join('=') }.join('&')
|
74
|
-
end
|
75
71
|
end
|
76
72
|
end
|
data/lib/alchemy-api/version.rb
CHANGED
data/spec/base_spec.rb
CHANGED
@@ -16,6 +16,14 @@ describe AlchemyAPI::Base do
|
|
16
16
|
.handlers
|
17
17
|
.must_include Faraday::Adapter::Excon
|
18
18
|
end
|
19
|
+
|
20
|
+
it 'form-encodes POST parameters' do
|
21
|
+
subject
|
22
|
+
.send(:connection)
|
23
|
+
.builder
|
24
|
+
.handlers
|
25
|
+
.must_include Faraday::Request::UrlEncoded
|
26
|
+
end
|
19
27
|
end
|
20
28
|
end
|
21
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-api-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|