spree-api-client 0.0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +674 -0
- data/README.md +31 -38
- data/lib/spree_client.rb +3 -0
- data/lib/spree_client.rb~ +71 -0
- data/lib/spree_client/api.rb +1 -0
- data/lib/spree_client/api/v1.rb +52 -0
- data/lib/spree_client/api/v1/products.rb +23 -0
- data/lib/spree_client/api/v1/properties.rb +12 -0
- data/lib/spree_client/api/v1/resources.rb +142 -0
- data/lib/spree_client/api/v1/stock_items.rb +27 -0
- data/lib/spree_client/api/v1/stock_locations.rb +33 -0
- data/lib/spree_client/api/v1/stock_movements.rb +16 -0
- data/lib/spree_client/api/v1/taxonomies.rb +12 -0
- data/lib/spree_client/api/v1/variants.rb +13 -0
- data/lib/spree_client/attributes.rb +26 -0
- data/lib/spree_client/models.rb +5 -0
- data/lib/spree_client/models/product.rb +7 -0
- data/lib/spree_client/models/property.rb +6 -0
- data/lib/spree_client/models/stock_item.rb +7 -0
- data/lib/spree_client/models/stock_location.rb +7 -0
- data/lib/spree_client/models/stock_movement.rb +7 -0
- data/lib/spree_client/models/store.rb +7 -0
- data/lib/spree_client/models/taxonomy.rb +5 -0
- data/lib/spree_client/models/variant.rb +7 -0
- metadata +73 -192
- data/.gitignore +0 -17
- data/.ruby-version +0 -1
- data/.travis.yml +0 -11
- data/CONTRIBUTING.md +0 -8
- data/Gemfile +0 -9
- data/LICENSE +0 -22
- data/Rakefile +0 -7
- data/fixtures/cassette_library/addresss.yml +0 -46
- data/fixtures/cassette_library/countries.yml +0 -52
- data/fixtures/cassette_library/orders.yml +0 -48
- data/fixtures/cassette_library/payments.yml +0 -48
- data/fixtures/cassette_library/products.yml +0 -66
- data/fixtures/cassette_library/properties.yml +0 -48
- data/fixtures/cassette_library/request.yml +0 -46
- data/fixtures/cassette_library/return_authorizations.yml +0 -48
- data/fixtures/cassette_library/shipment_ready.yml +0 -46
- data/fixtures/cassette_library/taxonomies.yml +0 -48
- data/fixtures/cassette_library/taxons.yml +0 -48
- data/fixtures/cassette_library/variants.yml +0 -63
- data/fixtures/cassette_library/zones.yml +0 -49
- data/lib/spree-api-client.rb +0 -49
- data/lib/spree-api-client/addresses.rb +0 -15
- data/lib/spree-api-client/connection.rb +0 -31
- data/lib/spree-api-client/countries.rb +0 -15
- data/lib/spree-api-client/error.rb +0 -47
- data/lib/spree-api-client/line_items.rb +0 -19
- data/lib/spree-api-client/orders.rb +0 -32
- data/lib/spree-api-client/payments.rb +0 -43
- data/lib/spree-api-client/products.rb +0 -31
- data/lib/spree-api-client/properties.rb +0 -31
- data/lib/spree-api-client/request.rb +0 -56
- data/lib/spree-api-client/return_authorizations.rb +0 -31
- data/lib/spree-api-client/shipments.rb +0 -15
- data/lib/spree-api-client/taxonomies.rb +0 -31
- data/lib/spree-api-client/taxons.rb +0 -27
- data/lib/spree-api-client/variants.rb +0 -31
- data/lib/spree-api-client/version.rb +0 -7
- data/lib/spree-api-client/zones.rb +0 -31
- data/spec/addresses_spec.rb +0 -12
- data/spec/client_spec.rb +0 -32
- data/spec/countries_spec.rb +0 -12
- data/spec/orders_spec.rb +0 -12
- data/spec/payments_spec.rb +0 -12
- data/spec/products_spec.rb +0 -12
- data/spec/properties_spec.rb +0 -12
- data/spec/return_authorizations_spec.rb +0 -12
- data/spec/shipments_spec.rb +0 -12
- data/spec/spec_helper.rb +0 -10
- data/spec/support/vcr.rb +0 -9
- data/spec/taxonomies_spec.rb +0 -12
- data/spec/taxons_spec.rb +0 -12
- data/spec/variants_spec.rb +0 -12
- data/spec/zones_spec.rb +0 -12
- data/spree-api-client.gemspec +0 -29
data/spec/countries_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Countries do
|
4
|
-
use_vcr_cassette "countries", :record => :new_episodes
|
5
|
-
describe 'countries' do
|
6
|
-
it 'should load countries' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
countries = client.countries
|
9
|
-
countries.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/orders_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Orders do
|
4
|
-
use_vcr_cassette "orders", :record => :new_episodes
|
5
|
-
describe 'orders' do
|
6
|
-
it 'should load orders' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
orders = client.orders
|
9
|
-
orders.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/payments_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Payments do
|
4
|
-
use_vcr_cassette "payments", :record => :new_episodes
|
5
|
-
describe 'payments' do
|
6
|
-
it 'should load payments' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
payments = client.payments('R610162112')
|
9
|
-
payments.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/products_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Products do
|
4
|
-
use_vcr_cassette "products", :record => :new_episodes
|
5
|
-
describe 'products' do
|
6
|
-
it 'should load products' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
products = client.products
|
9
|
-
products.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/properties_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Properties do
|
4
|
-
use_vcr_cassette "properties", :record => :new_episodes
|
5
|
-
describe 'properties' do
|
6
|
-
it 'should load properties' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
properties = client.properties(1)
|
9
|
-
properties.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::ReturnAuthorizations do
|
4
|
-
use_vcr_cassette "return_authorizations", :record => :new_episodes
|
5
|
-
describe 'return_authorizations' do
|
6
|
-
it 'should load return_authorizations' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
return_authorizations = client.return_authorizations('R781501551')
|
9
|
-
return_authorizations.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/shipments_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Shipments do
|
4
|
-
use_vcr_cassette "shipment_ready", :record => :new_episodes
|
5
|
-
describe 'shipment_ready' do
|
6
|
-
it 'should set a shipment to ready' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
shipment = client.shipment_ready(1, 1)
|
9
|
-
shipment.should be_a(Hashie::Mash)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/spec_helper.rb
DELETED
data/spec/support/vcr.rb
DELETED
data/spec/taxonomies_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Taxonomies do
|
4
|
-
use_vcr_cassette "taxonomies", :record => :new_episodes
|
5
|
-
describe 'taxonomies' do
|
6
|
-
it 'should load taxonomies' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
taxonomies = client.taxonomies
|
9
|
-
taxonomies.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/taxons_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Taxons do
|
4
|
-
use_vcr_cassette "taxons", :record => :new_episodes
|
5
|
-
describe 'taxons' do
|
6
|
-
it 'should load taxons' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
taxons = client.taxons(1)
|
9
|
-
taxons.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/variants_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Variants do
|
4
|
-
use_vcr_cassette "variants", :record => :new_episodes
|
5
|
-
describe 'variants' do
|
6
|
-
it 'should load variants' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
variants = client.variants(1)
|
9
|
-
variants.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spec/zones_spec.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::API::Client::Zones do
|
4
|
-
use_vcr_cassette "zones", :record => :new_episodes
|
5
|
-
describe 'zones' do
|
6
|
-
it 'should load zones' do
|
7
|
-
client = Spree::API::Client.new('http://localhost:4000/store/api', 'b56019f04b61a50553ee323f5ab68c6b435871971e79c987')
|
8
|
-
zones = client.zones
|
9
|
-
zones.should be_a(Array)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/spree-api-client.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'spree-api-client/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |gem|
|
7
|
-
gem.name = "spree-api-client"
|
8
|
-
gem.version = Spree::API::Client::VERSION
|
9
|
-
gem.authors = ["Andrew Nesbitt"]
|
10
|
-
gem.email = ["andrewnez@gmail.com"]
|
11
|
-
gem.description = %q{A rubygem for interacting with the Spree API}
|
12
|
-
gem.summary = %q{A rubygem for interacting with the Spree API}
|
13
|
-
gem.homepage = "https://github.com/andrew/spree-api-client"
|
14
|
-
|
15
|
-
gem.files = `git ls-files`.split($/)
|
16
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
-
gem.require_paths = ["lib"]
|
19
|
-
|
20
|
-
gem.add_dependency 'faraday', '~> 0.8'
|
21
|
-
gem.add_dependency 'faraday_middleware', '~> 0.9'
|
22
|
-
gem.add_dependency 'hashie', '~> 1.2'
|
23
|
-
gem.add_dependency 'multi_json', '~> 1.4'
|
24
|
-
|
25
|
-
gem.add_development_dependency 'webmock'
|
26
|
-
gem.add_development_dependency 'vcr'
|
27
|
-
gem.add_development_dependency 'rake'
|
28
|
-
gem.add_development_dependency 'rspec'
|
29
|
-
end
|