shopify_api 7.0.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{CHANGELOG → CHANGELOG.md} +4 -0
- data/README.md +8 -8
- data/lib/shopify_api/resources/base.rb +2 -2
- data/lib/shopify_api/version.rb +1 -1
- data/test/base_test.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f6c202f9c29838510495d77a8414965c76387dec57557eca68d1221150fea05
|
4
|
+
data.tar.gz: 62d74d1bd36f35fe1c53256dca2906564bb583e2d1bea0d80cb342a496c64b2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ada5c8a355c109ac3ceef1dcb3aca833da26946ebfb3a4543356efc7bfbab6a1fe7c3de301b36785e5683f2c968fb210c441840881bc8265bcf507216ded6de
|
7
|
+
data.tar.gz: 6f0a5c32d25075e25eaed02bc6cfc78a1001ef2dadd8620978bd6ec5c7be5421bead11d8376216171f319a8315f431f16176f2f2f56997de8e4c8abf8642b5a5
|
data/{CHANGELOG → CHANGELOG.md}
RENAMED
data/README.md
CHANGED
@@ -22,7 +22,7 @@ ShopifyAPI::Session.new(domain, token, extras)
|
|
22
22
|
```
|
23
23
|
is now
|
24
24
|
```ruby
|
25
|
-
ShopifyAPI::Session.new(domain: domain, token: token,
|
25
|
+
ShopifyAPI::Session.new(domain: domain, token: token, api_version: api_version, extras: extras)
|
26
26
|
```
|
27
27
|
Note `extras` is still optional the other arguments are required.
|
28
28
|
|
@@ -33,7 +33,7 @@ end
|
|
33
33
|
```
|
34
34
|
is now
|
35
35
|
```ruby
|
36
|
-
ShopifyAPI::Session.temp(domain: domain, token: token,
|
36
|
+
ShopifyAPI::Session.temp(domain: domain, token: token, api_version: api_version) do
|
37
37
|
...
|
38
38
|
end
|
39
39
|
```
|
@@ -42,11 +42,11 @@ The `api_version` attribute can take the string or symbol name of any known vers
|
|
42
42
|
|
43
43
|
For example if you want to use the `2019-04` version you would create a session like this:
|
44
44
|
```ruby
|
45
|
-
session = ShopifyAPI::Session.new(domain: domain, token: token,
|
45
|
+
session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: '2019-04')
|
46
46
|
```
|
47
47
|
if you want to use the `unstable` version you would create a session like this:
|
48
48
|
```ruby
|
49
|
-
session = ShopifyAPI::Session.new(domain: domain, token: token,
|
49
|
+
session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: :unstable)
|
50
50
|
```
|
51
51
|
|
52
52
|
### Changes to how to define resources
|
@@ -87,9 +87,9 @@ end
|
|
87
87
|
### URLs that have not changed
|
88
88
|
|
89
89
|
- OAuth URLs for `authorize`, getting the `access_token` from a code, `access_scopes`, and using a `refresh_token` have _not_ changed.
|
90
|
-
- get: `/admin/oauth/authorize
|
91
|
-
- post: `/admin/oauth/access_token
|
92
|
-
- get: `/admin/oauth/access_scopes
|
90
|
+
- get: `/admin/oauth/authorize`
|
91
|
+
- post: `/admin/oauth/access_token`
|
92
|
+
- get: `/admin/oauth/access_scopes`
|
93
93
|
- URLs for the merchant’s web admin have _not_ changed. For example: to send the merchant to the product page the url is still `/admin/product/<id>`
|
94
94
|
|
95
95
|
## Usage
|
@@ -134,7 +134,7 @@ ShopifyAPI uses ActiveResource to communicate with the REST web service. ActiveR
|
|
134
134
|
```ruby
|
135
135
|
shop_url = "https://#{API_KEY}:#{PASSWORD}@#{SHOP_NAME}.myshopify.com"
|
136
136
|
ShopifyAPI::Base.site = shop_url
|
137
|
-
ShopifyAPI::Base.
|
137
|
+
ShopifyAPI::Base.api_version = '<version_name>' # find the latest stable api_version [here](https://help.shopify.com/api/versioning)
|
138
138
|
```
|
139
139
|
|
140
140
|
That's it, you're done, skip to step 6 and start using the API!
|
data/lib/shopify_api/version.rb
CHANGED
data/test/base_test.rb
CHANGED
@@ -157,6 +157,11 @@ class BaseTest < Test::Unit::TestCase
|
|
157
157
|
assert_equal 2, ShopifyAPI::Shop.current.id
|
158
158
|
end
|
159
159
|
|
160
|
+
test "#api_version should set ApiVersion" do
|
161
|
+
ShopifyAPI::Base.api_version = '2019-04'
|
162
|
+
assert_equal '2019-04', ShopifyAPI::Base.api_version.to_s
|
163
|
+
end
|
164
|
+
|
160
165
|
def clear_header(header)
|
161
166
|
[ActiveResource::Base, ShopifyAPI::Base, ShopifyAPI::Product].each do |klass|
|
162
167
|
klass.headers.delete(header)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -188,7 +188,7 @@ files:
|
|
188
188
|
- ".gitignore"
|
189
189
|
- ".rubocop.yml"
|
190
190
|
- ".travis.yml"
|
191
|
-
- CHANGELOG
|
191
|
+
- CHANGELOG.md
|
192
192
|
- CONTRIBUTING.md
|
193
193
|
- CONTRIBUTORS
|
194
194
|
- Gemfile
|