shipstation-ruby 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +19 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +52 -0
- data/README.md +100 -0
- data/Rakefile +14 -0
- data/lib/shipstation_ruby.rb +33 -0
- data/lib/shipstation_ruby/client.rb +27 -0
- data/lib/shipstation_ruby/collection.rb +61 -0
- data/shipstation-ruby.gemspec +27 -0
- data/spec/lib/shipstation_ruby/client_spec.rb +16 -0
- data/spec/lib/shipstation_ruby/collection_spec.rb +35 -0
- data/spec/lib/shipstation_ruby/extensions_spec.rb +20 -0
- data/spec/lib/shipstation_ruby/order_spec.rb +55 -0
- data/spec/spec_helper.rb +26 -0
- metadata +175 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ODNmZGJlNmM4OTdmMGY1MmI5ZDM2ZjczMmQ1YzdhN2NiYWUwZjVlOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjdiZTJkYmE3ZWY1MGE2NWQwZTQ2NjljZTgwNWUyODJkNTE1Njk4MA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGRkNjU2NmJiZTVhNGQyYzA4ZDNjMWZjOTkwY2JiYWE2NGFlMGVlODQ3ODAw
|
10
|
+
NjEyNGU4YTg3OTAzZmUyNThmYWFlMDVmYzdlYzY0Mzk2OTE3MDM5MGYwOWYy
|
11
|
+
MTliNDViMDM0ZWZlZDQzYTBhYzc0ZTk3Yjc1NjZhMzBlODEyOTk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTQzNDIwZTVlM2RlYWY2ODhkZTQ1YmE1YzYwMzQ2YTBlMTE0ODlkMWE0MzY0
|
14
|
+
ZDFkYTM0YWU1OTRkZmRjYjljYTE5ZjFlNDlhZGQ5OGM1MTEzZDBjMmM0YTdl
|
15
|
+
ZjI5Yjg0MjIzMDJlZjljODFkZWNhODg4MWU4YzJkYzFlYmRhMTk=
|
data/.gitignore
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile ~/.gitignore_global
|
6
|
+
|
7
|
+
# Ignore bundler config
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
|
13
|
+
# Ignore all logfiles and tempfiles.
|
14
|
+
/log/*.log
|
15
|
+
/tmp
|
16
|
+
/solr/data/development/index
|
17
|
+
|
18
|
+
# Ignore all VCR fixtures
|
19
|
+
/spec/fixtures/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
shipstation-ruby (0.0.1)
|
5
|
+
rash
|
6
|
+
ruby_odata
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (3.2.12)
|
12
|
+
i18n (~> 0.6)
|
13
|
+
multi_json (~> 1.0)
|
14
|
+
addressable (2.3.4)
|
15
|
+
ansi (1.4.3)
|
16
|
+
backports (3.3.0)
|
17
|
+
crack (0.3.2)
|
18
|
+
hashie (2.0.3)
|
19
|
+
i18n (0.6.4)
|
20
|
+
mime-types (1.22)
|
21
|
+
minitest (4.7.1)
|
22
|
+
multi_json (1.7.2)
|
23
|
+
nokogiri (1.5.9)
|
24
|
+
rake (10.0.4)
|
25
|
+
rash (0.4.0)
|
26
|
+
hashie (~> 2.0.0)
|
27
|
+
rest-client (1.6.7)
|
28
|
+
mime-types (>= 1.16)
|
29
|
+
ruby_odata (0.1.2)
|
30
|
+
activesupport (>= 3.0.0)
|
31
|
+
backports (>= 2.3.0)
|
32
|
+
i18n (~> 0.6.0)
|
33
|
+
nokogiri (>= 1.4.2)
|
34
|
+
rest-client (>= 1.5.1)
|
35
|
+
turn (0.9.6)
|
36
|
+
ansi
|
37
|
+
vcr (2.4.0)
|
38
|
+
webmock (1.11.0)
|
39
|
+
addressable (>= 2.2.7)
|
40
|
+
crack (>= 0.3.2)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
bundler
|
47
|
+
minitest
|
48
|
+
rake
|
49
|
+
shipstation-ruby!
|
50
|
+
turn
|
51
|
+
vcr
|
52
|
+
webmock
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
shipstation-ruby
|
2
|
+
================
|
3
|
+
|
4
|
+
This is a Ruby wrapper for [ShipStation](http://www.shipstation.com/)'s [OData API](http://api.shipstation.com/MainPage.ashx).
|
5
|
+
|
6
|
+
This is version 0.0.1 of the gem. It currently only supports querying and filtering of ShipStation resources.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
ShipStation-Ruby is packaged as a Ruby gem. I recommend you install it with [Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
|
11
|
+
[ShipStation](http://ww.shipstation.com/)'s Ruby client library is an interface to its
|
12
|
+
[OAuth API](http://api.shipstation.com/MainPage.ashx).
|
13
|
+
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
gem 'shipstation-ruby', '~> 0.0.1'
|
17
|
+
```
|
18
|
+
|
19
|
+
## Rails Configuration
|
20
|
+
|
21
|
+
The ShipStation API uses basic HTTP authentication. Inside config/initializers, create a new configuration file and use the following template to pass in your ShipStation credentials:
|
22
|
+
|
23
|
+
``` ruby
|
24
|
+
ShipStationRuby.username = ENV['SHIPSTATION_USERNAME']
|
25
|
+
ShipStationRuby.password = ENV['SHIPSTATION_PASSWORD']
|
26
|
+
```
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
### Set your credentials and create a new client:
|
31
|
+
``` ruby
|
32
|
+
ShipStationRuby.username = "shipstation_username"
|
33
|
+
ShipStationRuby.password = "shipstation_password"
|
34
|
+
client = ShipStationRuby::Client.new
|
35
|
+
```
|
36
|
+
|
37
|
+
### Or create a new client by passing credentials directly:
|
38
|
+
``` ruby
|
39
|
+
client = ShipStationRuby::Client.new("shipstation_username", "shipstation_password")
|
40
|
+
```
|
41
|
+
### Query a resource by record id:
|
42
|
+
``` ruby
|
43
|
+
order = client.order.find(12345)
|
44
|
+
```
|
45
|
+
|
46
|
+
### Get all records for any given resource in an array (paginated in batches of 100):
|
47
|
+
``` ruby
|
48
|
+
orders = client.order.all
|
49
|
+
```
|
50
|
+
|
51
|
+
### Query records for any resource by any attribute, returns an array:
|
52
|
+
``` ruby
|
53
|
+
open_texas_orders = client.order.where("active" => "true", "ship_state" => "TX")
|
54
|
+
```
|
55
|
+
|
56
|
+
### Other resources follow a similar pattern
|
57
|
+
``` ruby
|
58
|
+
all_warehouses = client.warehouse.all
|
59
|
+
customer_12345 = client.customer.find(12345)
|
60
|
+
texas_fedex_shipments = client.shipment.where("shipping_service_id" => 0001, "state" => "TX")
|
61
|
+
```
|
62
|
+
etc.
|
63
|
+
|
64
|
+
### Once returned, resources can be queried by field name
|
65
|
+
``` ruby
|
66
|
+
client = ShipStationRuby::Client.new
|
67
|
+
order = client.order.find(12345)
|
68
|
+
|
69
|
+
order.order_id ## 12345
|
70
|
+
order.ship_city ## Boise
|
71
|
+
order.order_total ## $343.32
|
72
|
+
```
|
73
|
+
|
74
|
+
## Requirements
|
75
|
+
This gem has been tested on Ruby 1.9.3 on version 1.1 of ShipStation's API.
|
76
|
+
|
77
|
+
## Bugs
|
78
|
+
Please report bugs at https://github.com/codyduval/shipstation-ruby/issues
|
79
|
+
|
80
|
+
## Note on Patches/Pull Requests
|
81
|
+
* Fork the project from https://github.com/codyduval/shipstation-ruby/
|
82
|
+
* Make your feature addition or bug fix.
|
83
|
+
* Add tests
|
84
|
+
* Commit
|
85
|
+
* Send me a pull request. Bonus points for topic branches.
|
86
|
+
|
87
|
+
## Thanks
|
88
|
+
Thanks to [Nate Berkopec](https://github.com/nateberkopec) for advice and guidance.
|
89
|
+
|
90
|
+
## License
|
91
|
+
|
92
|
+
(The MIT License.)
|
93
|
+
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
|
95
|
+
in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
96
|
+
|
97
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
98
|
+
|
99
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
100
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rake/testtask'
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
desc "Open an irb session preloaded with this library"
|
5
|
+
task :console do
|
6
|
+
sh "irb -rubygems -I lib -I extra -r shipstation_ruby.rb"
|
7
|
+
end
|
8
|
+
|
9
|
+
Rake::TestTask.new do |t|
|
10
|
+
t.test_files = FileList['spec/lib/shipstation_ruby/*_spec.rb']
|
11
|
+
t.verbose = true
|
12
|
+
end
|
13
|
+
|
14
|
+
task :default => :test
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "rash"
|
2
|
+
require "ruby_odata"
|
3
|
+
require "awesome_print"
|
4
|
+
|
5
|
+
require "shipstation_ruby/client"
|
6
|
+
require "shipstation_ruby/collection"
|
7
|
+
|
8
|
+
module ShipStationRuby
|
9
|
+
API_BASE = "https://data.shipstation.com/1.1"
|
10
|
+
|
11
|
+
class ShipStationRubyError < StandardError
|
12
|
+
end
|
13
|
+
|
14
|
+
class AuthenticationError < ShipStationRubyError; end
|
15
|
+
class ConfigurationError < ShipStationRubyError; end
|
16
|
+
|
17
|
+
class << self
|
18
|
+
def username
|
19
|
+
defined? @username and @username or raise(
|
20
|
+
ConfigurationError, "ShipStationRuby username not configured"
|
21
|
+
)
|
22
|
+
end
|
23
|
+
attr_writer :username
|
24
|
+
|
25
|
+
def password
|
26
|
+
defined? @password and @password or raise(
|
27
|
+
ConfigurationError, "ShipStationRuby password not configured"
|
28
|
+
)
|
29
|
+
end
|
30
|
+
attr_writer :password
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module ShipStationRuby
|
2
|
+
class Client
|
3
|
+
attr_accessor :auth, :client
|
4
|
+
|
5
|
+
def initialize(username = ShipStationRuby.username, password = ShipStationRuby.password)
|
6
|
+
raise ArgumentError unless username && password
|
7
|
+
@auth = {:username => username, :password => password}
|
8
|
+
|
9
|
+
@client = OData::Service.new(API_BASE, @auth)
|
10
|
+
self
|
11
|
+
end
|
12
|
+
|
13
|
+
def method_missing(method, *args, &block)
|
14
|
+
method = method.to_s
|
15
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
16
|
+
|
17
|
+
# method == 'orders'
|
18
|
+
klass = method.pluralize.camelize
|
19
|
+
ShipStationRuby::Collection.new(@client, klass)
|
20
|
+
end
|
21
|
+
|
22
|
+
def inspect
|
23
|
+
"#<ShipStationRuby::Client:#{object_id}>"
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module ShipStationRuby
|
2
|
+
class Collection
|
3
|
+
|
4
|
+
attr_accessor :client, :resource
|
5
|
+
|
6
|
+
def initialize(client, resource)
|
7
|
+
@client = client
|
8
|
+
@resource = resource
|
9
|
+
end
|
10
|
+
|
11
|
+
def find(id)
|
12
|
+
@client.send("#{@resource}",id)
|
13
|
+
result = @client.execute
|
14
|
+
single_result = result.first
|
15
|
+
json_hash = JSON.parse(single_result.to_json)
|
16
|
+
json_rash = Hashie::Rash.new(json_hash)
|
17
|
+
return json_rash
|
18
|
+
end
|
19
|
+
|
20
|
+
def all
|
21
|
+
@client.send("#{@resource}")
|
22
|
+
results = @client.execute
|
23
|
+
formatted_results = []
|
24
|
+
results.each do |result|
|
25
|
+
result_hash = JSON.parse(result.to_json)
|
26
|
+
result_rash = Hashie::Rash.new(result_hash)
|
27
|
+
formatted_results.push(result_rash)
|
28
|
+
end
|
29
|
+
return formatted_results
|
30
|
+
end
|
31
|
+
|
32
|
+
def where(filters={})
|
33
|
+
final_string = ""
|
34
|
+
final_string_array = []
|
35
|
+
filters.each do |attribute, value|
|
36
|
+
shipstation_style_attribute = attribute.to_s.classify.gsub(/Id/, 'ID')
|
37
|
+
puts shipstation_style_attribute
|
38
|
+
puts value
|
39
|
+
if value.is_a?(Integer)
|
40
|
+
filter_string = "#{shipstation_style_attribute} eq #{value}"
|
41
|
+
else
|
42
|
+
filter_string = "#{shipstation_style_attribute} eq '#{value}'"
|
43
|
+
end
|
44
|
+
|
45
|
+
final_string_array << filter_string
|
46
|
+
end
|
47
|
+
final_string = final_string_array.join(' and ')
|
48
|
+
puts final_string
|
49
|
+
@client.send("#{@resource}").filter("#{final_string}")
|
50
|
+
results = @client.execute
|
51
|
+
formatted_results = []
|
52
|
+
results.each do |result|
|
53
|
+
result_hash = JSON.parse(result.to_json)
|
54
|
+
result_rash = Hashie::Rash.new(result_hash)
|
55
|
+
formatted_results.push(result_rash)
|
56
|
+
end
|
57
|
+
return formatted_results
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = "shipstation-ruby"
|
7
|
+
gem.version = "0.0.1"
|
8
|
+
gem.authors = ["Cody Duval"]
|
9
|
+
gem.email = ["cody.duval@gmail.com"]
|
10
|
+
gem.description = 'An API wrapper for the ShipStation API'
|
11
|
+
gem.summary = 'An API wrapper for the ShipStation API'
|
12
|
+
gem.homepage = 'https://github.com/codyduval/shipstation-ruby'
|
13
|
+
|
14
|
+
gem.files = `git ls-files`.split($/)
|
15
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
|
19
|
+
gem.add_dependency 'rash'
|
20
|
+
gem.add_dependency 'ruby_odata'
|
21
|
+
gem.add_development_dependency 'minitest'
|
22
|
+
gem.add_development_dependency 'turn'
|
23
|
+
gem.add_development_dependency 'rake'
|
24
|
+
gem.add_development_dependency 'vcr'
|
25
|
+
gem.add_development_dependency 'webmock'
|
26
|
+
gem.add_development_dependency 'bundler'
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe ShipStationRuby::Client do
|
4
|
+
it "sets authentication on initialize with passed parameters" do
|
5
|
+
client_test = VCR.use_cassette('get_metadata') do
|
6
|
+
ShipStationRuby::Client.new
|
7
|
+
end
|
8
|
+
client_test.auth[:username].must_equal ShipStationRuby.username
|
9
|
+
client_test.auth[:password].must_equal ShipStationRuby.password
|
10
|
+
end
|
11
|
+
|
12
|
+
it "must have a username and password" do
|
13
|
+
proc { ShipStationRuby::Client.new("username", nil) }.must_raise ArgumentError
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe ShipStationRuby::Collection do
|
4
|
+
let(:client) { ShipStationRuby::Client.new }
|
5
|
+
|
6
|
+
it "initializes new Collection" do
|
7
|
+
@resource = "orders"
|
8
|
+
ShipStationRuby::Collection.new(@client, @resource).must_be_instance_of ShipStationRuby::Collection
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "It must correctly find Order resource" do
|
12
|
+
let(:client) { ShipStationRuby::Client.new }
|
13
|
+
|
14
|
+
it "must contain correct client and class" do
|
15
|
+
@resource = "orders"
|
16
|
+
collection = ShipStationRuby::Collection.new(@client, @resource)
|
17
|
+
|
18
|
+
collection.client.must_equal @client
|
19
|
+
collection.resource.must_equal "orders"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "It must correctly find Warehouse resource" do
|
24
|
+
let(:client) { ShipStationRuby::Client.new }
|
25
|
+
|
26
|
+
it "must contain correct client and class" do
|
27
|
+
@resource = "warehouses"
|
28
|
+
collection = ShipStationRuby::Collection.new(@client, @resource)
|
29
|
+
|
30
|
+
collection.client.must_equal @client
|
31
|
+
collection.resource.must_equal "warehouses"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe 'HashieMash extensions' do
|
4
|
+
it "must convert CamelCase keys to snake_case" do
|
5
|
+
test_hash = {"TopLevel" => "Top level value"}
|
6
|
+
|
7
|
+
test_rash = Hashie::Rash.new(test_hash)
|
8
|
+
|
9
|
+
test_rash.must_equal({"top_level" => "Top level value"})
|
10
|
+
end
|
11
|
+
|
12
|
+
it "must convert nested CamelCase keys to snake_case" do
|
13
|
+
test_hash = {"TopLevel" => {"SecondLevel" => {"ThirdLevel" => 9999 }}}
|
14
|
+
|
15
|
+
test_rash = Hashie::Rash.new(test_hash)
|
16
|
+
|
17
|
+
test_rash.must_equal({"top_level" => {"second_level" => {"third_level" => 9999 }}})
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
|
3
|
+
describe "ShipStationRuby::Order metaclass" do
|
4
|
+
|
5
|
+
describe "Find order" do
|
6
|
+
let(:client) { ShipStationRuby::Client.new }
|
7
|
+
|
8
|
+
it "must find the right Order from the OData service" do
|
9
|
+
VCR.use_cassette('find_order') do
|
10
|
+
client.orders.find(21660574).order_id.must_equal 21660574
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it "must return a Rash object" do
|
15
|
+
VCR.use_cassette('find_order') do
|
16
|
+
client.orders.find(21660574).must_be_instance_of Hashie::Rash
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "all orders" do
|
22
|
+
let(:client) { ShipStationRuby::Client.new }
|
23
|
+
|
24
|
+
it "must return an array of Rash objects" do
|
25
|
+
VCR.use_cassette('all_orders') do
|
26
|
+
client.orders.all.must_be_instance_of Array
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "GET filtered order" do
|
32
|
+
let(:client) { ShipStationRuby::Client.new }
|
33
|
+
|
34
|
+
it "must get the correct filtered result with one parameter" do
|
35
|
+
VCR.use_cassette('filtered_order_one_param') do
|
36
|
+
order = client.orders.where("customer_id"=> 15843013).first
|
37
|
+
order.order_id.must_equal 21660574
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
it "must get the correct filtered result with two passed parameters" do
|
42
|
+
VCR.use_cassette('filtered_order_two_params') do
|
43
|
+
order = client.orders.where("order_id" => 21660574, "seller_id" => 105162).first
|
44
|
+
order.order_id.must_equal 21660574
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe "Update order attributes" do
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
end
|
55
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative '../lib/shipstation_ruby'
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'webmock/minitest'
|
5
|
+
require 'vcr'
|
6
|
+
require 'turn/autorun'
|
7
|
+
|
8
|
+
Turn.config do |c|
|
9
|
+
c.format = :outline
|
10
|
+
c.natural = true
|
11
|
+
c.verbose = true
|
12
|
+
end
|
13
|
+
|
14
|
+
VCR.configure do |c|
|
15
|
+
c.cassette_library_dir = 'spec/fixtures/shipstation_ruby_cassettes'
|
16
|
+
c.hook_into :webmock
|
17
|
+
end
|
18
|
+
|
19
|
+
#environment vars
|
20
|
+
include ShipStationRuby
|
21
|
+
ShipStationRuby.username = 'shipstation_username'
|
22
|
+
ShipStationRuby.password = 'shipstation_password'
|
23
|
+
|
24
|
+
ShipStationRuby.username != 'shipstation_username' or raise(
|
25
|
+
ConfigurationError, "ShipStationRuby username and password not configured"
|
26
|
+
)
|
metadata
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: shipstation-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Cody Duval
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rash
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ruby_odata
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
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: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: turn
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: bundler
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: An API wrapper for the ShipStation API
|
126
|
+
email:
|
127
|
+
- cody.duval@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- .gitignore
|
133
|
+
- Gemfile
|
134
|
+
- Gemfile.lock
|
135
|
+
- README.md
|
136
|
+
- Rakefile
|
137
|
+
- lib/shipstation_ruby.rb
|
138
|
+
- lib/shipstation_ruby/client.rb
|
139
|
+
- lib/shipstation_ruby/collection.rb
|
140
|
+
- shipstation-ruby.gemspec
|
141
|
+
- spec/lib/shipstation_ruby/client_spec.rb
|
142
|
+
- spec/lib/shipstation_ruby/collection_spec.rb
|
143
|
+
- spec/lib/shipstation_ruby/extensions_spec.rb
|
144
|
+
- spec/lib/shipstation_ruby/order_spec.rb
|
145
|
+
- spec/spec_helper.rb
|
146
|
+
homepage: https://github.com/codyduval/shipstation-ruby
|
147
|
+
licenses: []
|
148
|
+
metadata: {}
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ! '>='
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
requirements: []
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.0.3
|
166
|
+
signing_key:
|
167
|
+
specification_version: 4
|
168
|
+
summary: An API wrapper for the ShipStation API
|
169
|
+
test_files:
|
170
|
+
- spec/lib/shipstation_ruby/client_spec.rb
|
171
|
+
- spec/lib/shipstation_ruby/collection_spec.rb
|
172
|
+
- spec/lib/shipstation_ruby/extensions_spec.rb
|
173
|
+
- spec/lib/shipstation_ruby/order_spec.rb
|
174
|
+
- spec/spec_helper.rb
|
175
|
+
has_rdoc:
|