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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5947e1c39193afb380390949a140d77ad47b2560
4
- data.tar.gz: 7d507ef3ae947730dedf9c7969adf2bbec5c701b
3
+ metadata.gz: 47d00fe473d1c644f02a63509e6e69d48b34b2d2
4
+ data.tar.gz: adcb5b0002019f2e8e9e6a9cca8b6093b6490ed8
5
5
  SHA512:
6
- metadata.gz: c96aed8ce6d1770a399d722438742ab0268e0fbb41469f422edc0d34952699ce7c876c0e95c98f28351a98a641abae7489ae75de519d10b81a16ccfff28f76dc
7
- data.tar.gz: 213975afa00c3d1f68579c82bbcea016060e4e3c2d306f5169d6cda2de0d8360fcf96465f64d3926ccc9da62743626d6f5a837de33379f0a858e629e0d6b51c7
6
+ metadata.gz: 3a8d70f0b5574d37fe09c00a323e202b5400612dc16c2dd05285f7f8e54d2c83cba2c5655a9dec84bc4b16af3e186244a4069fedffac264abf6f31e52ca86082
7
+ data.tar.gz: 2dc21773e4860fda1306086665c893e75e7c8d13f6dd2e7038350753d4a669b7873549336ba97612096ed17d68d1493bc8f639985b268b5856f1c84455d07494
@@ -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, construct_body)
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
@@ -1,3 +1,3 @@
1
1
  module AlchemyAPI
2
- VERSION = '0.5.3'
2
+ VERSION = '0.5.4'
3
3
  end
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.3
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-25 00:00:00.000000000 Z
11
+ date: 2015-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday