snap-api 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a50261392621d61f3d3f094c1a5692139021c057d2cab037212a856ab7a76a7d
4
- data.tar.gz: dc538907ae6ad79ed9682f871046329b3943e7d628294c53895352e9ab011e5f
3
+ metadata.gz: 8893c6ba1b64a97074146fae0aba8fe8f3bf1be9e52b19ee9bcd99aec198ff3b
4
+ data.tar.gz: a50a60eab5350b42717efab3e0fa3dfd749494d9b1b93302693550378271a40a
5
5
  SHA512:
6
- metadata.gz: 38ff79ecb25b6583e2713de2d3181fb3e92e56c4f04111526158684f98fd42c24346444df5bfe4fa3ca4dc6c82d7ec1730bcb016001ee1c57f4c33da0df31a40
7
- data.tar.gz: ca431ca5f8f145d58dd1235b1969a8d3fecf51bb17cd2e273fc5281bbb6473c21df2f635c3088545dabee0b2d4306888751a56e23a080ad428b1bdf3262577c0
6
+ metadata.gz: 7fd7dde555c9d92cf649ea79e5b4278142a51295c6a502d1828d3a7cd2ce934cc122f29eac7bfd08c00031dd47036b144fb0142201e2977aa68b3dd91adc064c
7
+ data.tar.gz: f733aeb8f05509b02387bb06a14ad6b2394186c7e5dc2134a2b31920f9593ff77e9afca419aa9dde48d0f79a5b57c21d0ffb1cdc62d52ccc2f42425da3416549
data/History.md ADDED
@@ -0,0 +1,39 @@
1
+
2
+ 0.1.1 / 2018-09-16
3
+ ==================
4
+
5
+ * Add Shipments#destroy
6
+ * Add Shipments#create
7
+ * Add image to readme
8
+ * Add basic usage instructions
9
+ * Update Gem install instructions
10
+ * Add Snap shipment model
11
+ * Add gem version badge
12
+ * Add CodeClimate badges
13
+ * Update rake requirement from ~> 10.0 to ~> 12.3
14
+ * Add Changelog
15
+
16
+ 0.1.0 / 2018-09-15
17
+ ==================
18
+
19
+ * Update name of gem to avoid conflict
20
+ * Add Shipments#find
21
+ * Add VCR
22
+ * Add a base client
23
+ * Add HTTParty
24
+ * Add initializer for local dev
25
+ * Make binding.pry available in test
26
+ * Add sample .env and fix setup bug
27
+ * Add dotenv
28
+ * Add SimpleCov
29
+ * Add configuration object
30
+ * Lint all the things
31
+ * Add rubocop
32
+ * Add pry
33
+ * Remove default failing spec
34
+ * Don't commit Gemfile.lock
35
+ * Update gem description
36
+ * Merge branch 'master' of github.com:MeUndies/snap
37
+ * Update Travis CI yaml
38
+ * Initial commit
39
+ * Initial commit
data/README.md CHANGED
@@ -1,32 +1,44 @@
1
+ ![Bag Logo](https://user-images.githubusercontent.com/1624718/45594013-e7593580-b947-11e8-911c-282ae1d19654.png)
2
+
1
3
  # Snap
2
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/snap-api.svg)](https://badge.fury.io/rb/snap-api)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/818c40e75cd06a101b79/maintainability)](https://codeclimate.com/github/MeUndies/snap/maintainability)
7
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/818c40e75cd06a101b79/test_coverage)](https://codeclimate.com/github/MeUndies/snap/test_coverage)
8
+
3
9
  A ruby gem to interact with the Snapfulfil API.
4
10
 
5
11
  ## Installation
6
12
 
7
13
  Add this line to your application's Gemfile:
8
14
 
9
- ```ruby gem 'snap' ```
15
+ ```ruby
16
+ gem 'snap-api', require: 'snap'
17
+ ```
10
18
 
11
19
  And then execute:
12
20
 
13
21
  $ bundle
14
22
 
15
- Or install it yourself as:
16
-
17
- $ gem install snap
18
-
19
23
  ```ruby
24
+
20
25
  Snap.configure do |config|
21
26
  config.endpoint = 'https://your-api-endpoint'
22
27
  config.username = 'Fred'
23
28
  config.password = 'Rogers'
24
29
  end
30
+
25
31
  ```
26
32
 
27
33
  ## Usage
28
34
 
29
- TODO: Write usage instructions here
35
+ ```ruby
36
+
37
+ Snap::Api::Shipments.find(id: 'your-shipment-id')
38
+
39
+ ```
40
+
41
+
30
42
 
31
43
  ## Development
32
44
 
@@ -8,6 +8,15 @@ module Snap
8
8
  def self.find(id:)
9
9
  client.get("/shipments/#{id}")
10
10
  end
11
+
12
+ def self.destroy(id:)
13
+ client.delete("/shipments/#{id}")
14
+ end
15
+
16
+ def self.create(options)
17
+ shipment = Snap::Shipment.new(options)
18
+ client.post('/shipments', body: shipment)
19
+ end
11
20
  end
12
21
  end
13
22
  end
@@ -0,0 +1,94 @@
1
+ module Snap
2
+ module Models
3
+ # A representation of a Snap Shipment object.
4
+ class Shipment < Hashie::Dash
5
+ include Hashie::Extensions::IndifferentAccess
6
+
7
+ property :ShipmentId, required: true
8
+ property :BizId
9
+ property :BizSalesOrder
10
+ property :Status
11
+ property :OrderType
12
+ property :OrderClass
13
+ property :CustomerId, required: true
14
+ property :BizCustomerId
15
+ property :CustomerGroup
16
+ property :CustomerName
17
+ property :ShippingAddressId
18
+ property :InvoiceAddressId
19
+ property :Site
20
+ property :Warehouse
21
+ property :OwnerId
22
+ property :StockStatus
23
+ property :SalesOrder
24
+ property :Prime
25
+ property :PriorityAllocation
26
+ property :PriorityDespatch
27
+ property :CustomerRef
28
+ property :ConsigmentId
29
+ property :PickGroupId
30
+ property :ASNNumber
31
+ property :DNoteNumber
32
+ property :InvoiceNumber
33
+ property :ManifestNumber
34
+ property :POD
35
+ property :ShippingMethod
36
+ property :Region
37
+ property :CarrierId
38
+ property :CarrierTrackingNumber
39
+ property :Route
40
+ property :LoadId
41
+ property :LoadSequence
42
+ property :PackStation
43
+ property :ShippingLane
44
+ property :ReturnReason
45
+ property :QC
46
+ property :Lines
47
+ property :LineQty
48
+ property :StUQty
49
+ property :Volume
50
+ property :Weight
51
+ property :ActualWeight
52
+ property :TaskCountNew
53
+ property :TaskCountCurrent
54
+ property :TaskCountActioned
55
+ property :TimeToPick
56
+ property :TimeToPack
57
+ property :TimeToCheck
58
+ property :TimeToLoad
59
+ property :TimeOther
60
+ property :TimeToDeliver
61
+ property :InvoiceInd
62
+ property :Currency
63
+ property :LineValue
64
+ property :Discount
65
+ property :Packing
66
+ property :Freight
67
+ property :Insurance
68
+ property :Charges
69
+ property :Allowances
70
+ property :Tax
71
+ property :InvoiceValue
72
+ property :ShortageCode
73
+ property :Variance
74
+ property :CutOffInd
75
+ property :Supervisor
76
+ property :Reason
77
+ property :DateCreated
78
+ property :DateSuspended
79
+ property :DateClosed
80
+ property :DateDueOut, required: true
81
+ property :DateShipment
82
+ property :DateDelivery
83
+ property :DateInvoice
84
+ property :ASNInd
85
+ property :OverdueInd
86
+ property :Stage
87
+ property :MaintInd
88
+ property :ShipmentLines
89
+ property :ShipAddress
90
+ property :ShipContacts
91
+ property :ShipmentDespatch
92
+ end
93
+ end
94
+ end
data/lib/snap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Snap
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
data/lib/snap.rb CHANGED
@@ -1,12 +1,16 @@
1
+ require 'hashie'
1
2
  require 'httparty'
2
3
 
3
4
  require 'snap/version'
4
5
  require 'snap/client'
5
6
 
6
7
  require 'snap/api/shipments'
8
+ require 'snap/models/shipment'
7
9
 
8
10
  # Top level module for the Snap gem.
9
11
  module Snap
12
+ include Models
13
+
10
14
  class << self
11
15
  attr_accessor :config
12
16
  end
data/snap.gemspec CHANGED
@@ -18,12 +18,13 @@ Gem::Specification.new do |spec|
18
18
  end
19
19
  spec.require_paths = ['lib']
20
20
 
21
+ spec.add_dependency 'hashie', '~> 3.5'
21
22
  spec.add_dependency 'httparty', '~> 0.16'
22
23
 
23
24
  spec.add_development_dependency 'bundler', '~> 1.16'
24
25
  spec.add_development_dependency 'dotenv', '~> 2.5'
25
26
  spec.add_development_dependency 'pry', '~> 0.11'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'rake', '~> 12.3'
27
28
  spec.add_development_dependency 'rspec', '~> 3.0'
28
29
  spec.add_development_dependency 'rubocop', '~> 0.59'
29
30
  spec.add_development_dependency 'simplecov', '~> 0.16'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snap-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Hood
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2018-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hashie
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.5'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: httparty
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +86,14 @@ dependencies:
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '10.0'
89
+ version: '12.3'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: '10.0'
96
+ version: '12.3'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +177,7 @@ files:
163
177
  - ".rubocop.yml"
164
178
  - ".travis.yml"
165
179
  - Gemfile
180
+ - History.md
166
181
  - LICENSE
167
182
  - README.md
168
183
  - Rakefile
@@ -172,6 +187,7 @@ files:
172
187
  - lib/snap.rb
173
188
  - lib/snap/api/shipments.rb
174
189
  - lib/snap/client.rb
190
+ - lib/snap/models/shipment.rb
175
191
  - lib/snap/version.rb
176
192
  - snap.gemspec
177
193
  homepage: https://github.com/MeUndies/snap