lucid_shopify-resource 0.4.4 → 0.4.5

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: e7f650b0d5270783dbe5d6f9e9b9483fd193cde21d3f84f7c9c772fc1721f622
4
- data.tar.gz: d4cef13aa2345fb3fd4f808222a495eaded5efc3b5c147f261eae2fff36a41f0
3
+ metadata.gz: 8ab628783328c51563040db34488ff8f51d6779ec04757def63c998ea1efb708
4
+ data.tar.gz: 102947042a5b14ad08f7fa2737f4da20857813d73d6d4f5475b2bcb3371fc819
5
5
  SHA512:
6
- metadata.gz: a83f0b31e7e6c628d843c3093060aecd186b815f0c93db6d6fd03362fcdd9076d6208088029028890043c17618cd398a27415e84c4bfe85b3e9353f1d3424b25
7
- data.tar.gz: 365373a5bc2a4b5f066f6798c21b2d1215fc05eb22ed67a5f22355451cb8f0d7f94f2985a5a129d6b2c96af88a754fe9d1240896b6588242a627febcd37a4ecc
6
+ metadata.gz: 496e28e8da77113ea2f8294fac4544a8e621f5f220a72d68281e0298a5e9b4ffcc47bc60f49d0b9ce8c70d145759d0896810eb6e4812ec46a11dddf6c9c4c330
7
+ data.tar.gz: e4af3e9e69db0ce182829be2733cf88dc2e608b59b032b790ae5a4839e454d57ec2a03b5ce83fa80c8232180d22a6ac9fc121fbf4ab4152a291569a9b6d391b8
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'logger'
4
+
3
5
  require 'lucid_shopify/container'
4
6
 
5
7
  module LucidShopify
@@ -25,13 +27,18 @@ module LucidShopify
25
27
 
26
28
  #
27
29
  # @param client [Client]
30
+ # @param logger [Logger]
28
31
  #
29
- def initialize(client: Container[:client])
32
+ def initialize(client: Container[:client],
33
+ logger: Logger.new(IO::NULL))
30
34
  @client = client
35
+ @logger = logger
31
36
  end
32
37
 
33
38
  # @return [Client]
34
39
  attr_reader :client
40
+ # @return [Client]
41
+ attr_reader :logger
35
42
 
36
43
  #
37
44
  # @abstract Use {ClassMethods#resource} to implement (required)
@@ -69,6 +69,8 @@ module LucidShopify
69
69
  def find(credentials, id, params = {})
70
70
  params = finalize_params(params)
71
71
 
72
+ logger.info("Fetching #{resource} id=#{id}")
73
+
72
74
  client.get(credentials, "#{resource}/#{id}", params).values.first
73
75
  end
74
76
 
@@ -98,6 +100,8 @@ module LucidShopify
98
100
  since_id = 1
99
101
 
100
102
  loop do
103
+ logger.info("Fetching #{resource} since_id=#{since_id}")
104
+
101
105
  results = throttled_client.get(credentials, resource, params.merge(since_id: since_id)).values.first
102
106
  results.each do |result|
103
107
  yield result
@@ -128,6 +132,8 @@ module LucidShopify
128
132
  def count(credentials, params = {})
129
133
  params = finalize_params(params)
130
134
 
135
+ logger.info("Fetching #{resource} count")
136
+
131
137
  client.get(credentials, "#{resource}/count", params)['count']
132
138
  end
133
139
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module LucidShopify
4
4
  module Resource
5
- VERSION = '0.4.4'
5
+ VERSION = '0.4.5'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid_shopify-resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-13 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec