mad_cart 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b654cd78298e2634901fbc20f1a7584b3a8ad64
4
- data.tar.gz: d7b9143821eb8f3a0911603c6ae4f28634d00c89
3
+ metadata.gz: d1ed7a36224e604c2d21fbeb24428cd76250588f
4
+ data.tar.gz: edff25fa0f78b2652c180072dd7f0bc6dacffa63
5
5
  SHA512:
6
- metadata.gz: 296d0739324d4ba16643e82945fc39241d7c0647d511f6d566949238e105110e72bfd816b22bf0b68daac8fa8a23040bbfa80953d70ed14dbf89edcf5e3cfc3f
7
- data.tar.gz: 1c5b53aad81a85475a3e5ac8c4fcbaf3e38d4b506a24541fd2c24cf9e8b195a2f11c060a54b1b0f13fde9487ebd3121a5054f1037859056f3f424dd4fe683e88
6
+ metadata.gz: 80af83d4399e84dd1edec78a6f99355b3fe1a84d4157c50b8ec1ad68b5c678889dcad56b61645e4b8232023b243a8dfaa6edf988ef70e72c12f48a6adf1f10ea
7
+ data.tar.gz: dd8b892452b4ee498f055e434de967c9c9d8468ad42845777940a794383debdf5f5f97c7700995c9e3f37d37efcec8e7010499c8c5ae879eebe4764b5a9d27ba
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
2
  require 'yaml'
3
- load 'vcr/tasks/vcr.rake'
4
3
 
5
4
  require 'rspec/core/rake_task'
6
5
 
@@ -15,6 +15,10 @@ module MadCart
15
15
  InvalidCredentials = Class.new(StandardError)
16
16
 
17
17
  module Base
18
+ DEFAULT_CONNECTION_OPTIONS = {
19
+ :request => { :open_timeout => 30, :timeout => 60 }
20
+ }
21
+
18
22
  def self.included(base)
19
23
  base.extend ClassMethods
20
24
  base.class_eval do
@@ -109,11 +109,11 @@ module MadCart
109
109
  end
110
110
 
111
111
  def create_connection(args={})
112
- @connection = Faraday.new(:url => api_url_for(args[:store_url]))
113
- @connection.basic_auth(args[:username], args[:api_key])
114
- @connection.response :json
115
- @connection.adapter Faraday.default_adapter
116
- @connection
112
+ Faraday.new(DEFAULT_CONNECTION_OPTIONS.merge(:url => api_url_for(args[:store_url]))) do |connection|
113
+ connection.basic_auth(args[:username], args[:api_key])
114
+ connection.response :json
115
+ connection.adapter Faraday.default_adapter
116
+ end
117
117
  end
118
118
  end
119
119
  end
@@ -131,7 +131,7 @@ module MadCart
131
131
  end
132
132
 
133
133
  def create_connection(args={})
134
- Faraday.new(:url => api_url_for(args[:store_url])) do |connection|
134
+ Faraday.new(DEFAULT_CONNECTION_OPTIONS.merge(:url => api_url_for(args[:store_url]))) do |connection|
135
135
  connection.response :json
136
136
  connection.adapter Faraday.default_adapter
137
137
  connection.headers['X-Spree-Token'] = args[:api_key]
@@ -1,3 +1,3 @@
1
1
  module MadCart
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -46,7 +46,7 @@ http_interactions:
46
46
  - miss
47
47
  body:
48
48
  encoding: UTF-8
49
- string: '{"count":50,"total_count":83990,"current_page":1,"pages":1680,"products":[{"id":24050,"name":"Homemade
49
+ string: '{"count":50,"total_count":148,"current_page":1,"pages":3,"products":[{"id":24050,"name":"Homemade
50
50
  for Sale: How to Set Up and Market a Food Business from Your Home Kitchen","description":"\u003CP\u003EFrom
51
51
  farm-to-fork and \"Buy Local\" to slow food and hand-made artisan breads,
52
52
  more people than ever are demanding real food made with real ingredients by
@@ -2594,7 +2594,7 @@ http_interactions:
2594
2594
  - miss
2595
2595
  body:
2596
2596
  encoding: UTF-8
2597
- string: '{"count":50,"total_count":83990,"current_page":2,"pages":1680,"products":[{"id":67839,"name":"Planning
2597
+ string: '{"count":50,"total_count":148,"current_page":2,"pages":3,"products":[{"id":67839,"name":"Planning
2598
2598
  Classroom Management: A Five-Step Process to Creating a Positive Learning
2599
2599
  Environment","description":"","price":"76.95","available_on":"2015-01-12T03:18:52.781-06:00","permalink":"planning-classroom-management-illustrated-karen-bosch-english","count_on_hand":0,"meta_description":"\u003CP\u003EIncrease
2600
2600
  student learning with an effective classroom management plan! This resource
@@ -5221,7 +5221,7 @@ http_interactions:
5221
5221
  - miss
5222
5222
  body:
5223
5223
  encoding: UTF-8
5224
- string: '{"count":50,"total_count":83990,"current_page":3,"pages":1680,"products":[{"id":11209,"name":"Cocktail
5224
+ string: '{"count":50,"total_count":83990,"current_page":3,"pages":3,"products":[{"id":11209,"name":"Cocktail
5225
5225
  Time","description":"If Lord Ickenham had not dislodged the hat of Beefy Bastable
5226
5226
  with a well-aimed Brazil nut, the latter''s famous legal mind might never
5227
5227
  have been stimulated to literature. But the incident provoked Beefy to write
@@ -7697,7 +7697,7 @@ http_interactions:
7697
7697
  - miss
7698
7698
  body:
7699
7699
  encoding: UTF-8
7700
- string: '{"count":50,"total_count":83990,"current_page":1,"pages":1680,"products":[{"id":24050,"name":"Homemade
7700
+ string: '{"count":50,"total_count":83990,"current_page":1,"pages":3,"products":[{"id":24050,"name":"Homemade
7701
7701
  for Sale: How to Set Up and Market a Food Business from Your Home Kitchen","description":"\u003CP\u003EFrom
7702
7702
  farm-to-fork and \"Buy Local\" to slow food and hand-made artisan breads,
7703
7703
  more people than ever are demanding real food made with real ingredients by
@@ -10245,7 +10245,7 @@ http_interactions:
10245
10245
  - miss
10246
10246
  body:
10247
10247
  encoding: UTF-8
10248
- string: '{"count":50,"total_count":83990,"current_page":2,"pages":1680,"products":[{"id":67839,"name":"Planning
10248
+ string: '{"count":50,"total_count":83990,"current_page":2,"pages":3,"products":[{"id":67839,"name":"Planning
10249
10249
  Classroom Management: A Five-Step Process to Creating a Positive Learning
10250
10250
  Environment","description":"","price":"76.95","available_on":"2015-01-12T03:18:52.781-06:00","permalink":"planning-classroom-management-illustrated-karen-bosch-english","count_on_hand":0,"meta_description":"\u003CP\u003EIncrease
10251
10251
  student learning with an effective classroom management plan! This resource
@@ -12872,7 +12872,7 @@ http_interactions:
12872
12872
  - miss
12873
12873
  body:
12874
12874
  encoding: UTF-8
12875
- string: '{"count":50,"total_count":83990,"current_page":3,"pages":1680,"products":[{"id":11209,"name":"Cocktail
12875
+ string: '{"count":50,"total_count":148,"current_page":3,"pages":3,"products":[{"id":11209,"name":"Cocktail
12876
12876
  Time","description":"If Lord Ickenham had not dislodged the hat of Beefy Bastable
12877
12877
  with a well-aimed Brazil nut, the latter''s famous legal mind might never
12878
12878
  have been stimulated to literature. But the incident provoked Beefy to write
@@ -19,7 +19,7 @@ describe MadCart::Store::BigCommerce do
19
19
 
20
20
  it "authenticates via basic auth" do
21
21
  connection = Faraday.new
22
- Faraday.stub(:new).and_return(connection)
22
+ Faraday.stub(:new).and_yield(connection)
23
23
 
24
24
  connection.should_receive(:basic_auth).with('username', 'api_key')
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mad_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Heiligers
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-20 00:00:00.000000000 Z
13
+ date: 2015-06-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -294,3 +294,4 @@ test_files:
294
294
  - spec/lib/store/etsy_spec.rb
295
295
  - spec/lib/store/spree_spec.rb
296
296
  - spec/spec_helper.rb
297
+ has_rdoc: