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.
Files changed (81) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +9 -0
  3. data/LICENSE.txt +674 -0
  4. data/README.md +31 -38
  5. data/lib/spree_client.rb +3 -0
  6. data/lib/spree_client.rb~ +71 -0
  7. data/lib/spree_client/api.rb +1 -0
  8. data/lib/spree_client/api/v1.rb +52 -0
  9. data/lib/spree_client/api/v1/products.rb +23 -0
  10. data/lib/spree_client/api/v1/properties.rb +12 -0
  11. data/lib/spree_client/api/v1/resources.rb +142 -0
  12. data/lib/spree_client/api/v1/stock_items.rb +27 -0
  13. data/lib/spree_client/api/v1/stock_locations.rb +33 -0
  14. data/lib/spree_client/api/v1/stock_movements.rb +16 -0
  15. data/lib/spree_client/api/v1/taxonomies.rb +12 -0
  16. data/lib/spree_client/api/v1/variants.rb +13 -0
  17. data/lib/spree_client/attributes.rb +26 -0
  18. data/lib/spree_client/models.rb +5 -0
  19. data/lib/spree_client/models/product.rb +7 -0
  20. data/lib/spree_client/models/property.rb +6 -0
  21. data/lib/spree_client/models/stock_item.rb +7 -0
  22. data/lib/spree_client/models/stock_location.rb +7 -0
  23. data/lib/spree_client/models/stock_movement.rb +7 -0
  24. data/lib/spree_client/models/store.rb +7 -0
  25. data/lib/spree_client/models/taxonomy.rb +5 -0
  26. data/lib/spree_client/models/variant.rb +7 -0
  27. metadata +73 -192
  28. data/.gitignore +0 -17
  29. data/.ruby-version +0 -1
  30. data/.travis.yml +0 -11
  31. data/CONTRIBUTING.md +0 -8
  32. data/Gemfile +0 -9
  33. data/LICENSE +0 -22
  34. data/Rakefile +0 -7
  35. data/fixtures/cassette_library/addresss.yml +0 -46
  36. data/fixtures/cassette_library/countries.yml +0 -52
  37. data/fixtures/cassette_library/orders.yml +0 -48
  38. data/fixtures/cassette_library/payments.yml +0 -48
  39. data/fixtures/cassette_library/products.yml +0 -66
  40. data/fixtures/cassette_library/properties.yml +0 -48
  41. data/fixtures/cassette_library/request.yml +0 -46
  42. data/fixtures/cassette_library/return_authorizations.yml +0 -48
  43. data/fixtures/cassette_library/shipment_ready.yml +0 -46
  44. data/fixtures/cassette_library/taxonomies.yml +0 -48
  45. data/fixtures/cassette_library/taxons.yml +0 -48
  46. data/fixtures/cassette_library/variants.yml +0 -63
  47. data/fixtures/cassette_library/zones.yml +0 -49
  48. data/lib/spree-api-client.rb +0 -49
  49. data/lib/spree-api-client/addresses.rb +0 -15
  50. data/lib/spree-api-client/connection.rb +0 -31
  51. data/lib/spree-api-client/countries.rb +0 -15
  52. data/lib/spree-api-client/error.rb +0 -47
  53. data/lib/spree-api-client/line_items.rb +0 -19
  54. data/lib/spree-api-client/orders.rb +0 -32
  55. data/lib/spree-api-client/payments.rb +0 -43
  56. data/lib/spree-api-client/products.rb +0 -31
  57. data/lib/spree-api-client/properties.rb +0 -31
  58. data/lib/spree-api-client/request.rb +0 -56
  59. data/lib/spree-api-client/return_authorizations.rb +0 -31
  60. data/lib/spree-api-client/shipments.rb +0 -15
  61. data/lib/spree-api-client/taxonomies.rb +0 -31
  62. data/lib/spree-api-client/taxons.rb +0 -27
  63. data/lib/spree-api-client/variants.rb +0 -31
  64. data/lib/spree-api-client/version.rb +0 -7
  65. data/lib/spree-api-client/zones.rb +0 -31
  66. data/spec/addresses_spec.rb +0 -12
  67. data/spec/client_spec.rb +0 -32
  68. data/spec/countries_spec.rb +0 -12
  69. data/spec/orders_spec.rb +0 -12
  70. data/spec/payments_spec.rb +0 -12
  71. data/spec/products_spec.rb +0 -12
  72. data/spec/properties_spec.rb +0 -12
  73. data/spec/return_authorizations_spec.rb +0 -12
  74. data/spec/shipments_spec.rb +0 -12
  75. data/spec/spec_helper.rb +0 -10
  76. data/spec/support/vcr.rb +0 -9
  77. data/spec/taxonomies_spec.rb +0 -12
  78. data/spec/taxons_spec.rb +0 -12
  79. data/spec/variants_spec.rb +0 -12
  80. data/spec/zones_spec.rb +0 -12
  81. data/spree-api-client.gemspec +0 -29
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require 'spree-api-client'
4
- require 'rspec'
5
- require 'webmock/rspec'
6
- require 'support/vcr'
7
-
8
- RSpec.configure do |config|
9
- config.extend VCR::RSpec::Macros
10
- end
@@ -1,9 +0,0 @@
1
- p 'VCR'
2
- require 'vcr'
3
-
4
- VCR.configure do |c|
5
- c.cassette_library_dir = 'fixtures/cassette_library'
6
- c.hook_into :webmock
7
- c.ignore_localhost = false
8
- c.default_cassette_options = { :record => :none }
9
- end
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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