fifthgear 0.0.2
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 +7 -0
- data/.gitignore +22 -0
- data/.rspec +4 -0
- data/.travis.yml +16 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +53 -0
- data/Rakefile +10 -0
- data/fifthgear.gemspec +27 -0
- data/lib/config/defaults.yml +3 -0
- data/lib/fifthgear/cart.rb +8 -0
- data/lib/fifthgear/client.rb +23 -0
- data/lib/fifthgear/configuration.rb +20 -0
- data/lib/fifthgear/helper.rb +9 -0
- data/lib/fifthgear/item.rb +10 -0
- data/lib/fifthgear/item_inventory.rb +10 -0
- data/lib/fifthgear/item_inventory_bulk.rb +10 -0
- data/lib/fifthgear/item_personalization_data.rb +10 -0
- data/lib/fifthgear/order_status_bulk.rb +15 -0
- data/lib/fifthgear/order_status_by_ref_number.rb +8 -0
- data/lib/fifthgear/version.rb +3 -0
- data/lib/fifthgear.rb +61 -0
- data/spec/fifthgear/cart_spec.rb +13 -0
- data/spec/fifthgear/client_spec.rb +16 -0
- data/spec/fifthgear/configuration_spec.rb +32 -0
- data/spec/fifthgear/fifthgear_spec.rb +32 -0
- data/spec/fifthgear/item_inventory_bulk_spec.rb +13 -0
- data/spec/fifthgear/item_inventory_spec.rb +13 -0
- data/spec/fifthgear/item_lookup_spec.rb +13 -0
- data/spec/fifthgear/item_personalization_data_spec.rb +13 -0
- data/spec/fifthgear/order_status_bulk_spec.rb +13 -0
- data/spec/fifthgear/order_status_by_ref_number_spec.rb +13 -0
- data/spec/spec_helper.rb +19 -0
- metadata +171 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c59fe8e0e138b63c2ccbcfe0209d2addd5fc8fd4
|
4
|
+
data.tar.gz: cfbcee4cf09a1ab225e021d1fd8335a3da25cd34
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8a41bd2b1f78456f613fc94fdfb536afe23dcecaa52f4e1c7cc05e735e27c66d551e67f152ecae0bde4768aba82f9c6960ad43e3fe5438a01930d6e5b55415f0
|
7
|
+
data.tar.gz: 9fe7c1488c73588b2e06fb3c0e5e1ad875cdca1e8f76a02367f74cb35b2f334c39c6737b624653efbad40e7f557191a275bd9855dcb67f063ec20eb6bbbd1174
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Tom Hanley
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Fifthgear
|
2
|
+
[](https://travis-ci.org/WalkerAndCoBrandsInc/fifthgear) [](https://codeclimate.com/github/WalkerAndCoBrandsInc/fifthgear) [](https://codeclimate.com/github/WalkerAndCoBrandsInc/fifthgear)
|
3
|
+
|
4
|
+
Ruby gem for interfacing with [Fifthgear's](https://github.com/fifthgear/fifthgear-raw) api
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
gem 'fifthgear'
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install fifthgear
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
### Configuration
|
23
|
+
```ruby
|
24
|
+
Fifthgear.configure do |config|
|
25
|
+
config.api_root = 'https://commerceservicestest.infifthgear.com'
|
26
|
+
config.api_version = '/v2.0/CommerceServices.svc/Rest'
|
27
|
+
config.username = 'foo'
|
28
|
+
config.password = 'bar'
|
29
|
+
config.company_id = 'big_time_biz_1234'
|
30
|
+
config.content_type = 'application/json'
|
31
|
+
config.debug = true
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
### Helpers
|
36
|
+
|
37
|
+
Fifthgear requires dates to be in a specific format. We've added a helper function for formatting the dates correctly.
|
38
|
+
Internally it uses [Chronic](https://github.com/mojombo/chronic) to parse the date.
|
39
|
+
```ruby
|
40
|
+
irb(main):001:0> Fifthgear::Helper.format_date('12/01/2014')
|
41
|
+
=> "Date(1417464000000-0800)"
|
42
|
+
irb(main):002:0> Fifthgear::Helper.format_date('12/01/2014 12:12:12')
|
43
|
+
=> "Date(1417464732000-0800)"
|
44
|
+
irb(main):003:0>
|
45
|
+
```
|
46
|
+
|
47
|
+
## Contributing
|
48
|
+
|
49
|
+
1. Fork it ( https://github.com/WalkerAndCoBrandsInc/fifthgear/fork )
|
50
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
51
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
52
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
53
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/fifthgear.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'fifthgear/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "fifthgear"
|
8
|
+
spec.version = Fifthgear::VERSION
|
9
|
+
spec.authors = ["Tom Hanley"]
|
10
|
+
spec.email = ["tjhanleyx@gmail.com"]
|
11
|
+
spec.summary = %q{Gem for interfacing with Fifthgear's API.}
|
12
|
+
spec.description = %q{Create objects in Fifthgear's fulfillment system}
|
13
|
+
spec.homepage = "https://github.com/WalkerAndCoBrandsInc/fifthgear"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_dependency "faraday", "~> 0.9"
|
24
|
+
spec.add_dependency "faraday_middleware", "~> 0.9"
|
25
|
+
spec.add_dependency "chronic", "~> 0.10"
|
26
|
+
spec.add_runtime_dependency "hashie", "~> 2.1"
|
27
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'fifthgear'
|
2
|
+
module Fifthgear
|
3
|
+
class Client
|
4
|
+
def self.new
|
5
|
+
Faraday.new(:url => Fifthgear.configuration.api_root ) do |faraday|
|
6
|
+
# middleware
|
7
|
+
faraday.use FaradayMiddleware::FollowRedirects
|
8
|
+
faraday.use FaradayMiddleware::EncodeJson
|
9
|
+
# request defs
|
10
|
+
faraday.use Faraday::Request::BasicAuthentication, Fifthgear.configuration.username, Fifthgear.configuration.password
|
11
|
+
faraday.use Faraday::Request::UrlEncoded
|
12
|
+
# response defs
|
13
|
+
faraday.use Faraday::Response::ParseJson
|
14
|
+
faraday.use Faraday::Response::Mashify
|
15
|
+
faraday.use Faraday::Response::RaiseError unless Fifthgear.configuration.debug
|
16
|
+
faraday.response :logger if Fifthgear.configuration.debug
|
17
|
+
|
18
|
+
faraday.headers['Content-Type'] = Fifthgear.configuration.content_type
|
19
|
+
faraday.adapter ::Faraday.default_adapter
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
class Configuration
|
5
|
+
attr_accessor :api_root, :api_version, :username, :password, :content_type, :company_id, :debug
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
defaults = load_defaults
|
9
|
+
@api_root = defaults[:api_root]
|
10
|
+
@api_version = defaults[:api_version]
|
11
|
+
@content_type = defaults[:content_type]
|
12
|
+
@debug = false
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
def load_defaults
|
17
|
+
YAML.load_file(File.join(File.dirname(__FILE__),'..','config','defaults.yml'))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'fifthgear/client'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
class Item
|
5
|
+
def self.lookup(sku=nil)
|
6
|
+
conn = Fifthgear::Client.new
|
7
|
+
conn.post "#{Fifthgear.configuration.api_version}/ItemLookup", { "CompanyId" => Fifthgear.configuration.company_id, "Request" => sku}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'fifthgear/client'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
class ItemInventory
|
5
|
+
def self.lookup(sku=nil)
|
6
|
+
conn = Fifthgear::Client.new
|
7
|
+
conn.post "#{Fifthgear.configuration.api_version}/ItemInventoryLookup", { "CompanyId" => Fifthgear.configuration.company_id, "Request" => sku}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'fifthgear/client'
|
2
|
+
module Fifthgear
|
3
|
+
class ItemInventoryBulk
|
4
|
+
def self.lookup(startRange=nil, endRange=nil)
|
5
|
+
conn = Fifthgear::Client.new
|
6
|
+
conn.post "#{Fifthgear.configuration.api_version}/ItemInventoryBulkLookup", { "CompanyId" => Fifthgear.configuration.company_id,
|
7
|
+
"Request" => {"startRange" => startRange, "endRange" => endRange}}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'fifthgear/client'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
class ItemPersonalizationData
|
5
|
+
def self.export(sku=nil)
|
6
|
+
conn = Fifthgear::Client.new
|
7
|
+
conn.post "#{Fifthgear.configuration.api_version}/ExportItemPersonalizationData", { "CompanyId" => Fifthgear.configuration.company_id, "Request" => sku}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'fifthgear/client'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
class OrderStatusBulk
|
5
|
+
def self.lookup(fromDate=nil, toDate=nil, startRange=nil, endRange=nil)
|
6
|
+
conn = Fifthgear::Client.new
|
7
|
+
conn.post "#{Fifthgear.configuration.api_version}/OrderStatusBulkLookup", { "CompanyId" => Fifthgear.configuration.company_id,
|
8
|
+
"Request" => { "FromDate" => fromDate,
|
9
|
+
"ToDate" => toDate,
|
10
|
+
"StartRange" => startRange,
|
11
|
+
"EndRange" => endRange }
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module Fifthgear
|
2
|
+
class OrderStatusByRefNumber
|
3
|
+
def self.get(orderRefNumber=nil)
|
4
|
+
conn = Fifthgear::Client.new
|
5
|
+
conn.post "#{Fifthgear.configuration.api_version}/OrderStatusLookupByRefNumber", { "CompanyId" => Fifthgear.configuration.company_id, "Request" => orderRefNumber}
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
data/lib/fifthgear.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require "faraday_middleware"
|
3
|
+
|
4
|
+
require "fifthgear/version"
|
5
|
+
require "fifthgear/configuration"
|
6
|
+
require "fifthgear/client"
|
7
|
+
require "fifthgear/item"
|
8
|
+
require "fifthgear/item_inventory"
|
9
|
+
require "fifthgear/item_inventory_bulk"
|
10
|
+
require "fifthgear/item_personalization_data"
|
11
|
+
require "fifthgear/order_status_by_ref_number"
|
12
|
+
require "fifthgear/order_status_bulk"
|
13
|
+
require "fifthgear/cart"
|
14
|
+
require "fifthgear/helper"
|
15
|
+
|
16
|
+
module Fifthgear
|
17
|
+
class << self
|
18
|
+
attr_writer :configuration
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.configuration
|
22
|
+
@configuration ||= Configuration.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.reset
|
26
|
+
@configuration = Configuration.new
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.configure
|
30
|
+
yield(configuration)
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.item_lookup(sku=nil)
|
34
|
+
Fifthgear::Item.lookup(sku)
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.item_inventory_lookup(sku=nil)
|
38
|
+
Fifthgear::ItemInventory.lookup(sku)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.item_inventory_bulk_lookup(startRange=nil, endRange=nil)
|
42
|
+
Fifthgear::ItemInventoryBulk.lookup(startRange, endRange)
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.item_personalization_data_export(sku=nil)
|
46
|
+
Fifthgear::ItemPersonalizationData.export(sku)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.order_status_by_ref_number(orderRefNumber=nil)
|
50
|
+
Fifthgear::OrderStatusLookupByRefNumber.lookup(orderRefNumber)
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.order_status_bulk_lookup(fromDate=nil, toDate=nil, startRange=nil, endRange=nil)
|
54
|
+
Fifthgear::OrderStatusBulkLookup.lookup(fromDate, toDate, startRange, endRange)
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.cart_submit(cart={})
|
58
|
+
Fifthgear::Cart.submit(cart)
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe Cart do
|
5
|
+
describe "#post" do
|
6
|
+
it "should return an order object" do
|
7
|
+
pending "Configuration isn't passing username and password to client."
|
8
|
+
order_obj = Fifthgear.cart_submit({})
|
9
|
+
expect(order_obj).to_not eq(nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe Client do
|
5
|
+
describe "#new" do
|
6
|
+
let(:client) {Fifthgear::Client.new}
|
7
|
+
it "should return a Faraday Connection object" do
|
8
|
+
expect(client.class).to eq(Faraday::Connection)
|
9
|
+
end
|
10
|
+
it "should have headers set based on config" do
|
11
|
+
expect(client.headers["Username"]).to eq(Fifthgear.configuration.username)
|
12
|
+
expect(client.headers["Password"]).to eq(Fifthgear.configuration.password)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe Configuration do
|
5
|
+
let(:api_root) {'https://commerceservicestest.infifthgear.com'}
|
6
|
+
let(:username) {'rick'}
|
7
|
+
let(:password) {'rubin'}
|
8
|
+
let(:company_id) {'company123'}
|
9
|
+
let(:content_type) {'application/json'}
|
10
|
+
|
11
|
+
describe '#api_root' do
|
12
|
+
it 'should default value' do
|
13
|
+
expect(Configuration.new.api_root).to eq(api_root)
|
14
|
+
expect(Configuration.new.content_type).to eq(content_type)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
describe '#api_root=' do
|
18
|
+
it 'can set value' do
|
19
|
+
config = Configuration.new
|
20
|
+
config.api_root = api_root
|
21
|
+
config.username = username
|
22
|
+
config.password = password
|
23
|
+
config.company_id = company_id
|
24
|
+
|
25
|
+
expect(config.api_root).to eq(api_root)
|
26
|
+
expect(config.username).to eq(username)
|
27
|
+
expect(config.password).to eq(password)
|
28
|
+
expect(config.company_id).to eq(company_id)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe "#configure" do
|
5
|
+
before do
|
6
|
+
Fifthgear.configure do |config|
|
7
|
+
config.api_root = 'https://commerceservicestest.infifthgear.com/v2.0/CommerceServices.svc/Rest'
|
8
|
+
config.username = 'mork'
|
9
|
+
config.password = 'foobarf'
|
10
|
+
config.content_type = 'text/json'
|
11
|
+
config.company_id = 'CompanyID'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
describe "#reset" do
|
16
|
+
before do
|
17
|
+
Fifthgear.configure do |config|
|
18
|
+
config.api_root = 'https://commerceservicestest.infifthgear.com/v2.0/CommerceServices.svc/Rest'
|
19
|
+
config.username = 'mork'
|
20
|
+
config.password = 'foobarf'
|
21
|
+
config.content_type = 'text/json'
|
22
|
+
config.company_id = 'CompanyID'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "resets the configuration" do
|
27
|
+
Fifthgear.reset
|
28
|
+
config = Fifthgear.configuration
|
29
|
+
expect(config.username).to be(nil)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe ItemInventoryBulk do
|
5
|
+
describe "#get" do
|
6
|
+
it "should return details about item" do
|
7
|
+
pending "Configuration isn't passing username and password to client."
|
8
|
+
item = Fifthgear.item_inventory_bulk_lookup('testsku')
|
9
|
+
expect(item).to_not eq(nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe ItemInventory do
|
5
|
+
describe "#get" do
|
6
|
+
it "should return details about item" do
|
7
|
+
pending "Configuration isn't passing username and password to client."
|
8
|
+
item = Fifthgear.item_inventory_lookup('testsku')
|
9
|
+
expect(item).to_not eq(nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe Item do
|
5
|
+
describe "#get" do
|
6
|
+
it "should return an item" do
|
7
|
+
pending "Configuration isn't passing username and password to client."
|
8
|
+
item = Fifthgear.item_lookup('testsku')
|
9
|
+
expect(item).to_not eq(nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe ItemPersonalizationData do
|
5
|
+
describe "#get" do
|
6
|
+
it "should return an item" do
|
7
|
+
pending "Configuration isn't passing username and password to client."
|
8
|
+
item = Fifthgear.item_personalization_data_export('testsku')
|
9
|
+
expect(item).to_not eq(nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe OrderStatusBulk do
|
5
|
+
describe "#get" do
|
6
|
+
it "should return an item" do
|
7
|
+
pending "Configuration isn't passing username and password to client."
|
8
|
+
item = Fifthgear.order_status_bulk_lookup('testsku')
|
9
|
+
expect(item).to_not eq(nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Fifthgear
|
4
|
+
describe OrderStatusByRefNumber do
|
5
|
+
describe "#lookup" do
|
6
|
+
it "should return an item" do
|
7
|
+
pending "Configuration isn't passing username and password to client."
|
8
|
+
item = Fifthgear.order_status_lookup_by_ref_number('testsku')
|
9
|
+
expect(item).to_not eq(nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "fifthgear"
|
2
|
+
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
6
|
+
# loaded once.
|
7
|
+
#
|
8
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
11
|
+
config.run_all_when_everything_filtered = true
|
12
|
+
config.filter_run :focus
|
13
|
+
|
14
|
+
# Run specs in random order to surface order dependencies. If you find an
|
15
|
+
# order dependency and want to debug it, you can fix the order by providing
|
16
|
+
# the seed, which is printed after each run.
|
17
|
+
# --seed 1234
|
18
|
+
config.order = 'random'
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fifthgear
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tom Hanley
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.9'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday_middleware
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.9'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.9'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: chronic
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.10'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.10'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: hashie
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.1'
|
97
|
+
description: Create objects in Fifthgear's fulfillment system
|
98
|
+
email:
|
99
|
+
- tjhanleyx@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE.txt
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- fifthgear.gemspec
|
112
|
+
- lib/config/defaults.yml
|
113
|
+
- lib/fifthgear.rb
|
114
|
+
- lib/fifthgear/cart.rb
|
115
|
+
- lib/fifthgear/client.rb
|
116
|
+
- lib/fifthgear/configuration.rb
|
117
|
+
- lib/fifthgear/helper.rb
|
118
|
+
- lib/fifthgear/item.rb
|
119
|
+
- lib/fifthgear/item_inventory.rb
|
120
|
+
- lib/fifthgear/item_inventory_bulk.rb
|
121
|
+
- lib/fifthgear/item_personalization_data.rb
|
122
|
+
- lib/fifthgear/order_status_bulk.rb
|
123
|
+
- lib/fifthgear/order_status_by_ref_number.rb
|
124
|
+
- lib/fifthgear/version.rb
|
125
|
+
- spec/fifthgear/cart_spec.rb
|
126
|
+
- spec/fifthgear/client_spec.rb
|
127
|
+
- spec/fifthgear/configuration_spec.rb
|
128
|
+
- spec/fifthgear/fifthgear_spec.rb
|
129
|
+
- spec/fifthgear/item_inventory_bulk_spec.rb
|
130
|
+
- spec/fifthgear/item_inventory_spec.rb
|
131
|
+
- spec/fifthgear/item_lookup_spec.rb
|
132
|
+
- spec/fifthgear/item_personalization_data_spec.rb
|
133
|
+
- spec/fifthgear/order_status_bulk_spec.rb
|
134
|
+
- spec/fifthgear/order_status_by_ref_number_spec.rb
|
135
|
+
- spec/spec_helper.rb
|
136
|
+
homepage: https://github.com/WalkerAndCoBrandsInc/fifthgear
|
137
|
+
licenses:
|
138
|
+
- MIT
|
139
|
+
metadata: {}
|
140
|
+
post_install_message:
|
141
|
+
rdoc_options: []
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
requirements: []
|
155
|
+
rubyforge_project:
|
156
|
+
rubygems_version: 2.2.2
|
157
|
+
signing_key:
|
158
|
+
specification_version: 4
|
159
|
+
summary: Gem for interfacing with Fifthgear's API.
|
160
|
+
test_files:
|
161
|
+
- spec/fifthgear/cart_spec.rb
|
162
|
+
- spec/fifthgear/client_spec.rb
|
163
|
+
- spec/fifthgear/configuration_spec.rb
|
164
|
+
- spec/fifthgear/fifthgear_spec.rb
|
165
|
+
- spec/fifthgear/item_inventory_bulk_spec.rb
|
166
|
+
- spec/fifthgear/item_inventory_spec.rb
|
167
|
+
- spec/fifthgear/item_lookup_spec.rb
|
168
|
+
- spec/fifthgear/item_personalization_data_spec.rb
|
169
|
+
- spec/fifthgear/order_status_bulk_spec.rb
|
170
|
+
- spec/fifthgear/order_status_by_ref_number_spec.rb
|
171
|
+
- spec/spec_helper.rb
|