mad_cart 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -1
- data/lib/mad_cart/store/base.rb +4 -0
- data/lib/mad_cart/store/big_commerce.rb +5 -5
- data/lib/mad_cart/store/spree.rb +1 -1
- data/lib/mad_cart/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/spree_alternative.yml +6 -6
- data/spec/lib/store/big_commerce_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1ed7a36224e604c2d21fbeb24428cd76250588f
|
4
|
+
data.tar.gz: edff25fa0f78b2652c180072dd7f0bc6dacffa63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80af83d4399e84dd1edec78a6f99355b3fe1a84d4157c50b8ec1ad68b5c678889dcad56b61645e4b8232023b243a8dfaa6edf988ef70e72c12f48a6adf1f10ea
|
7
|
+
data.tar.gz: dd8b892452b4ee498f055e434de967c9c9d8468ad42845777940a794383debdf5f5f97c7700995c9e3f37d37efcec8e7010499c8c5ae879eebe4764b5a9d27ba
|
data/Rakefile
CHANGED
data/lib/mad_cart/store/base.rb
CHANGED
@@ -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
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
data/lib/mad_cart/store/spree.rb
CHANGED
@@ -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]
|
data/lib/mad_cart/version.rb
CHANGED
@@ -46,7 +46,7 @@ http_interactions:
|
|
46
46
|
- miss
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
|
-
string: '{"count":50,"total_count":
|
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":
|
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":
|
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":
|
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":
|
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":
|
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).
|
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.
|
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-
|
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:
|