shopify_api 7.0.1 → 7.0.2

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: 7f6c202f9c29838510495d77a8414965c76387dec57557eca68d1221150fea05
4
- data.tar.gz: 62d74d1bd36f35fe1c53256dca2906564bb583e2d1bea0d80cb342a496c64b2d
3
+ metadata.gz: 536ae3dc24da93a37f8338cea6686c4018073f54b2a1dc4e8bbd4fdb25eb2c5f
4
+ data.tar.gz: 7ef36dd0517a77a70e5634d7fb359ef23f2f48622e44257514461400ffa367fd
5
5
  SHA512:
6
- metadata.gz: 3ada5c8a355c109ac3ceef1dcb3aca833da26946ebfb3a4543356efc7bfbab6a1fe7c3de301b36785e5683f2c968fb210c441840881bc8265bcf507216ded6de
7
- data.tar.gz: 6f0a5c32d25075e25eaed02bc6cfc78a1001ef2dadd8620978bd6ec5c7be5421bead11d8376216171f319a8315f431f16176f2f2f56997de8e4c8abf8642b5a5
6
+ metadata.gz: 1a76419a2c85136fd952596744c842c2a0bab63b7aae938b38c923537ea4560c741eb78a58af7d9fb042fcd700400766b430ce59fd47f5d06cb7b39a42c1794b
7
+ data.tar.gz: 65dc3afe191f8007b4b41d824b4e00bdf6256c01392399d0aac63363a412def433f376e8448d819504c88ba7014a8afe9ec9ccc5e4725093be1cf5797216f101
@@ -1,3 +1,7 @@
1
+ == Version 7.0.2
2
+
3
+ * Add 2019-07 to known API versions.
4
+
1
5
  == Version 7.0.1
2
6
 
3
7
  * Support passing version string to `ShopifyAPI::Base.api_version` [#563](https://github.com/Shopify/shopify_api/pull/563)
data/README.md CHANGED
@@ -38,7 +38,7 @@ ShopifyAPI::Session.temp(domain: domain, token: token, api_version: api_version)
38
38
  end
39
39
  ```
40
40
 
41
- The `api_version` attribute can take the string or symbol name of any known version and correctly coerce it to a `ShopifyAPI::ApiVersion`. You can find the currently defined versions [here](https://github.com/Shopify/shopify_api/blob/master/lib/shopify_api/api_version.rb#L58), follow these [instructions](#adding-aditional-api-versions) to add additional version definitions if needed.
41
+ The `api_version` attribute can take the string or symbol name of any known version and correctly coerce it to a `ShopifyAPI::ApiVersion`. You can find the currently defined versions [here](https://github.com/Shopify/shopify_api/blob/master/lib/shopify_api/defined_versions.rb), follow these [instructions](#adding-additional-api-versions) to add additional version definitions if needed.
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
@@ -105,7 +105,7 @@ For more information and detailed documentation about the API visit https://deve
105
105
 
106
106
  #### Ruby version
107
107
 
108
- This gem requires Ruby 2.3.1 as of version 4.3. If you need to use an older Ruby version then update your `Gemfile` to lock onto an older release than 4.3.
108
+ This gem requires Ruby 2.4 as of version 7.0.
109
109
 
110
110
  ### Installation
111
111
 
@@ -290,20 +290,20 @@ ShopifyAPI uses ActiveResource to communicate with the REST web service. ActiveR
290
290
 
291
291
  ### Console
292
292
 
293
- This package also supports the ``shopify-cli`` executable to make it easy to open up an interactive console to use the API with a shop.
293
+ This package also supports the ``shopify-api`` executable to make it easy to open up an interactive console to use the API with a shop.
294
294
 
295
- 1. Install the ``shopify_cli`` gem.
295
+ 1. Install the ``shopify_api_console`` gem.
296
296
 
297
297
  ```bash
298
- gem install shopify_cli
298
+ gem install shopify_api_console
299
299
  ```
300
300
 
301
301
  2. Obtain a private API key and password to use with your shop (step 2 in "Getting Started")
302
302
 
303
- 3. Use the ``shopify-cli`` script to save the credentials for the shop to quickly log in.
303
+ 3. Use the ``shopify-api`` script to save the credentials for the shop to quickly log in.
304
304
 
305
305
  ```bash
306
- shopify-cli add yourshopname
306
+ shopify-api add yourshopname
307
307
  ```
308
308
 
309
309
  Follow the prompts for the shop domain, API key and password.
@@ -311,13 +311,13 @@ gem install shopify_cli
311
311
  4. Start the console for the connection.
312
312
 
313
313
  ```bash
314
- shopify-cli console
314
+ shopify-api console
315
315
  ```
316
316
 
317
317
  5. To see the full list of commands, type:
318
318
 
319
319
  ```bash
320
- shopify-cli help
320
+ shopify-api help
321
321
  ```
322
322
 
323
323
  ## GraphQL
@@ -344,13 +344,13 @@ result = client.query(SHOP_NAME_QUERY)
344
344
  result.data.shop.name
345
345
  ```
346
346
 
347
- ## Adding aditional API versions
347
+ ## Adding additional API versions
348
348
  We will release a gem update every time we release a new version of the API. Most of the time upgrading the gem will be all you need to do.
349
349
 
350
350
  If you want access to a newer version without upgrading you can define an api version.
351
351
  For example if you wanted to add an `ApiVersion` '2022-03', you would add the following to the initialization of your application:
352
352
  ```ruby
353
- ShopifyAPI::ApiVersion.define_version(ShopifyAPI::ApiVersion::Release.new('2022-03')
353
+ ShopifyAPI::ApiVersion.define_version(ShopifyAPI::ApiVersion::Release.new('2022-03'))
354
354
  ```
355
355
  Once you have done that you can now set this version in a Sesssion like this:
356
356
 
@@ -374,6 +374,17 @@ bundle install
374
374
  bundle exec rake test
375
375
  ```
376
376
 
377
+ or if you'd rather use docker just run:
378
+ ```bash
379
+ docker run -it --name shopify_api -v "$PWD:/shopify_api" -w="/shopify_api" ruby:2.6 bundle install
380
+ docker exec -it shopify_api bash
381
+ ```
382
+
383
+ or you can even use our automated rake task for docker:
384
+ ```bash
385
+ bundle exec rake docker
386
+ ```
387
+
377
388
  ## Additional Resources
378
389
 
379
390
  * [API Reference](https://help.shopify.com/api/reference)
data/Rakefile CHANGED
@@ -37,3 +37,8 @@ Rake::RDocTask.new do |rdoc|
37
37
  rdoc.rdoc_files.include('README*')
38
38
  rdoc.rdoc_files.include('lib/**/*.rb')
39
39
  end
40
+
41
+ task :docker do
42
+ cmd = "docker-compose up -d && docker exec -i -t shopify_api bash"
43
+ exec(cmd, err: File::NULL)
44
+ end
@@ -0,0 +1,13 @@
1
+ version: '3.5'
2
+ services:
3
+ api:
4
+ container_name: shopify_api
5
+ image: ruby:2.6
6
+ working_dir: /shopify_api
7
+ volumes:
8
+ - .:/shopify_api
9
+ - bundle:/usr/local/bundle
10
+ command: bash -c "bundle install && tail -f /dev/null"
11
+
12
+ volumes:
13
+ bundle:
@@ -6,6 +6,7 @@ require 'digest/md5'
6
6
  require 'base64'
7
7
  require 'active_resource/detailed_log_subscriber'
8
8
  require 'shopify_api/limits'
9
+ require 'shopify_api/defined_versions'
9
10
  require 'shopify_api/api_version'
10
11
  require 'active_resource/json_errors'
11
12
  require 'shopify_api/disable_prefix_check'
@@ -4,6 +4,8 @@ module ShopifyAPI
4
4
  class UnknownVersion < StandardError; end
5
5
  class InvalidVersion < StandardError; end
6
6
 
7
+ extend DefinedVersions
8
+
7
9
  include Comparable
8
10
 
9
11
  def self.coerce_to_version(version_or_name)
@@ -25,11 +27,6 @@ module ShopifyAPI
25
27
  @versions = {}
26
28
  end
27
29
 
28
- def self.define_known_versions
29
- define_version(Unstable.new)
30
- define_version(Release.new('2019-04'))
31
- end
32
-
33
30
  def self.latest_stable_version
34
31
  @versions.values.select(&:stable?).sort.last
35
32
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ module ShopifyAPI
3
+ module DefinedVersions
4
+ def define_known_versions
5
+ define_version(ShopifyAPI::ApiVersion::Unstable.new)
6
+ define_version(ShopifyAPI::ApiVersion::Release.new('2019-04'))
7
+ define_version(ShopifyAPI::ApiVersion::Release.new('2019-07'))
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module ShopifyAPI
2
- VERSION = "7.0.1"
2
+ VERSION = "7.0.2"
3
3
  end
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.1
4
+ version: 7.0.2
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-10 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
@@ -201,6 +201,7 @@ files:
201
201
  - RELEASING
202
202
  - Rakefile
203
203
  - bin/shopify
204
+ - docker-compose.yml
204
205
  - lib/active_resource/connection_ext.rb
205
206
  - lib/active_resource/detailed_log_subscriber.rb
206
207
  - lib/active_resource/json_errors.rb
@@ -208,6 +209,7 @@ files:
208
209
  - lib/shopify_api/api_version.rb
209
210
  - lib/shopify_api/connection.rb
210
211
  - lib/shopify_api/countable.rb
212
+ - lib/shopify_api/defined_versions.rb
211
213
  - lib/shopify_api/disable_prefix_check.rb
212
214
  - lib/shopify_api/events.rb
213
215
  - lib/shopify_api/limits.rb