whiplash_api 1.2.5 → 1.3.0

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
  SHA1:
3
- metadata.gz: d7abe6d649e8d8b5dc33256c09efed0ec254a7ed
4
- data.tar.gz: fd6a444810878d20fe7851432922ccfbe5511739
3
+ metadata.gz: 8763b960ba5bd1c097cef4f444ca483ccfe25810
4
+ data.tar.gz: cecbedfc0a7ff15f6d2ee0e960d1c103b168cc6e
5
5
  SHA512:
6
- metadata.gz: 38781e4a1737ca2c7e51621d0fc4d8ae3bf19f82d7e41bcac06064740f609fcff2e8dc1a98ee7f91c98483fbc1743be0d2aa57c7cc7b60fe3ac887a9e9a915ba
7
- data.tar.gz: 5c24ff3f1990e419950103089edb655e3b4fec6d6ff133a3916a6adb03e22d54dd5f0b700585c968b5206586dfa3b77700118db37a5079bd929392d5c36e868a
6
+ metadata.gz: ae63a4d9b11d45dd11cf3b1b6d25fc1e29ddab22e3dcc246e384ee13b5257162f1ef8e9cd349428fe1199f41bf52ec5f1ca9f06caab9c17db4a6c6a985bb277e
7
+ data.tar.gz: 299822d3b77c79c18f45860499f6c17f583456baf0ee0ab0eb6992f2ecfbd2e7886090e8c578f1cf5a50f081237c4bdcbc4d58f1898010e5aebcece48974e0e4
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  Whiplash API V1 - Ruby Client
2
2
  ================================
3
3
 
4
- [![Build Status](https://travis-ci.org/nikhgupta/whiplash_api.svg?branch=master)](https://travis-ci.org/nikhgupta/whiplash_api)
5
-
6
4
  This library provides a wrapper around the [Whiplash][whiplash] [Merchandising REST API][api] for use within Ruby apps or via the console.
7
5
 
8
6
  ### Requirements
@@ -12,14 +10,14 @@ This library provides a wrapper around the [Whiplash][whiplash] [Merchandising R
12
10
  - JSON
13
11
  - ActiveResource
14
12
 
15
- A valid API key (v1) or Oauth token (v2) is required to authenticate requests. You can find your API key on your customer account page.
13
+ A valid API key (v1) or Oauth token (v2) is required to authenticate requests. You can find your API key on your customer account page.
16
14
 
17
15
  You can also use the test API key `Hc2BHTn3bcrwyPooyYTP` to test this client.
18
16
 
19
17
  ### Installation
20
18
 
21
19
  ```
22
- gem install whiplash_api
20
+ gem install whiplash_api
23
21
  ```
24
22
 
25
23
  Or if you're using Bundler:
@@ -42,7 +40,7 @@ An error will be raised if no API key is provided.
42
40
 
43
41
  ### API Versions
44
42
 
45
- The default Whiplash API is v1 and uses API keys. The v2 API uses Oauth, and is currently available in private beta.
43
+ The default Whiplash API is v1 and uses API keys. The v2 API uses Oauth, and is currently available in private beta.
46
44
 
47
45
  Both API versions are fully supported by this gem. Unless specified, API v1 is used.
48
46
 
@@ -85,7 +83,7 @@ $ irb
85
83
  ```
86
84
 
87
85
  ### Contributing to the Whiplash API Gem
88
-
86
+
89
87
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
90
88
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
91
89
  * Fork the project.
@@ -3,9 +3,11 @@ require "whiplash_api/version"
3
3
 
4
4
  require 'whiplash_api/base'
5
5
  require 'whiplash_api/connection'
6
+ require 'whiplash_api/customer'
6
7
  require 'whiplash_api/item'
7
8
  require 'whiplash_api/order'
8
9
  require 'whiplash_api/order_item'
9
10
  require 'whiplash_api/shipnotice'
10
11
  require 'whiplash_api/shipnotice_item'
12
+ require 'whiplash_api/user'
11
13
  require 'whiplash_api/web_hook'
@@ -11,6 +11,7 @@ module WhiplashApi
11
11
 
12
12
  def testing!
13
13
  self.site = 'https://testing.whiplashmerch.com/api/'
14
+ # self.site = 'http://localhost:3000/api/'
14
15
 
15
16
  ActiveSupport::Notifications.subscribe("request.active_resource") do |*args|
16
17
  puts "[ActiveResource] Headers: #{WhiplashApi::Base.headers}"
@@ -20,7 +20,8 @@ module WhiplashApi
20
20
  else
21
21
  raise
22
22
  end
23
+ rescue ActiveResource::ResourceNotFound
24
+ raise WhiplashApi::Error, "The method you've attemped is not available for this resource or API version."
23
25
  end
24
26
  end
25
27
  end
26
-
@@ -0,0 +1,11 @@
1
+ module WhiplashApi
2
+ class Customer < Base
3
+ class << self
4
+
5
+ def count(args={})
6
+ self.get(:count, args)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ module WhiplashApi
2
+ class User < Base
3
+ class << self
4
+
5
+ def me
6
+ self.get(:me)
7
+ sanitize_as_resource self.get(:me)
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -1,4 +1,4 @@
1
1
  module WhiplashApi
2
- VERSION = "1.2.5"
2
+ VERSION = "1.3.0"
3
3
  DEFAULT_API_VERSION = 1
4
4
  end
@@ -6,8 +6,8 @@ require 'whiplash_api/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "whiplash_api"
8
8
  spec.version = WhiplashApi::VERSION
9
- spec.authors = ["Mark Dickson", "Nikhil Gupta"]
10
- spec.email = ["mark@sitesteaders.com", "mestoic@gmail.com"]
9
+ spec.authors = ["Mark Dickson"]
10
+ spec.email = ["mark@sitesteaders.com"]
11
11
 
12
12
  spec.summary = %q{Ruby Gem for connecting to the Whiplash Merchandising API}
13
13
  spec.description = %q{Ruby Gem for connecting to the Whiplash Merchandising API}
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency "rspec"
25
25
  spec.add_development_dependency "pry"
26
+ spec.add_development_dependency "webmock"
26
27
 
27
28
  spec.add_dependency "thor"
28
29
  spec.add_dependency "activesupport"
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whiplash_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Dickson
8
- - Nikhil Gupta
9
8
  autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2016-04-28 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
@@ -67,6 +66,20 @@ dependencies:
67
66
  - - ">="
68
67
  - !ruby/object:Gem::Version
69
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
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'
70
83
  - !ruby/object:Gem::Dependency
71
84
  name: thor
72
85
  requirement: !ruby/object:Gem::Requirement
@@ -112,7 +125,6 @@ dependencies:
112
125
  description: Ruby Gem for connecting to the Whiplash Merchandising API
113
126
  email:
114
127
  - mark@sitesteaders.com
115
- - mestoic@gmail.com
116
128
  executables:
117
129
  - whiplash_api
118
130
  extensions: []
@@ -132,11 +144,13 @@ files:
132
144
  - lib/whiplash_api/base.rb
133
145
  - lib/whiplash_api/cli.rb
134
146
  - lib/whiplash_api/connection.rb
147
+ - lib/whiplash_api/customer.rb
135
148
  - lib/whiplash_api/item.rb
136
149
  - lib/whiplash_api/order.rb
137
150
  - lib/whiplash_api/order_item.rb
138
151
  - lib/whiplash_api/shipnotice.rb
139
152
  - lib/whiplash_api/shipnotice_item.rb
153
+ - lib/whiplash_api/user.rb
140
154
  - lib/whiplash_api/version.rb
141
155
  - lib/whiplash_api/web_hook.rb
142
156
  - whiplash_api.gemspec