shopifydev 0.0.20 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Mzk3YTFjNzhmNjJhZTU4MTI4MGEwYmZmZmExN2Q3ZGYwN2FkZjk4MA==
4
+ MDAzOGMwZTczZTY0NTNmNDQ3NDAyMzZkOTZhNmI2MDNjMzcwOWQxZg==
5
5
  data.tar.gz: !binary |-
6
- ZDQxZThmZGJiYWRlNWEyZjc2NzA0MTkxMmZjNzYzNjhhNDMwMjM4ZQ==
6
+ ZTYzZjQ0MGEzMmNmZjk0YTgyNDI5N2I1N2JlZGU5MzU0MWY5N2U2YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Yzg3N2YxMmYzODY2ZGYxY2QyYWU2ZWQ2OWI2OWQ3MDgwMWY4ODg4MTNhMmRh
10
- OTdkYWI2ZGJjYWU0NzIyNGNlYTIzNjA2MGQ5ODVkOWNlMGQ2YTYwNjNlMGJi
11
- NDRlN2RkNjUwY2Q0N2NhZGFhMmJkODY3Nzk4NzBlMDI5MmFhODI=
9
+ ODYwNTAwZDQxODQ1YTFhMTQ4ZjRkY2MyNGQ5MzZkYzJjYjNmMWU1ZmNlZDQz
10
+ ZDhkYTFkYTcwNDZiN2UwY2VlZTM0NzJjOGU1YzE2M2U0YWRmZGU2NWY2ZGVj
11
+ YzMzNDBkYzEzNDkzOTdiZGJjNTY2ZDk5NjFkZjViMDNkMTZiNGU=
12
12
  data.tar.gz: !binary |-
13
- NzQzOWRmYWJmMzY3ZDMyZmNhMWVlZmVlYWIyNmQxNTQ5MzM4NzYxNjFmODkz
14
- OTk1MjJmMzA2N2RjZmFhNzc3MWQ5YzEwNzJjMWY4N2VhZGY1Y2M1MmNhNzJj
15
- ZWNkYjUzYWVmYTUxYmI2MzZiMmI4NmQyMTc0NzcyZWQwNzg2NzI=
13
+ YmY3YTUzNDlkYzAwZGFiOWUzNmUxNjg5OTg4MDM2OTMxNmUwNTkwYjQzNTM5
14
+ NDMwNzdkNGM1MzI4NDQ2Y2Y2ZDE0OWM5YTRkNWFmMTUxY2Y1YTE3YWQwMTM5
15
+ NGM5ODBiYWJkZTkwM2ZlNDhiYmNlNmNkODdjN2FhODQ2MDg0ODU=
data/README.md CHANGED
@@ -125,11 +125,13 @@ Assuming you ```cd ShopifyAPI```:
125
125
  caches
126
126
  => lists status of all the caches & when they were last
127
127
  reloaded. Will show an ! next to records that were fetched
128
- with params.
128
+ with params. Example:
129
129
 
130
130
  caches true
131
131
  => shows params the caches were loaded with
132
132
 
133
+ products.delete_all
134
+ => delete all the products in the cache & reload the cache
133
135
 
134
136
 
135
137
 
@@ -17,6 +17,12 @@ module ShopifyAPI
17
17
  end
18
18
 
19
19
  module ShopifyAPI
20
+ class VariantWithProduct < Base
21
+ self.prefix = "/admin/"
22
+ self.element_name = "variant"
23
+ self.collection_name = "variants"
24
+ end
25
+
20
26
  class << self
21
27
 
22
28
  def cache_status(cache, show_opts=false)
@@ -84,7 +90,12 @@ EOF
84
90
  self.replace(entity.find(:all, params: self.params))
85
91
  self.since = Time.now
86
92
  puts "#{self.length} records."
87
- nil
93
+ self
94
+ }}
95
+ obj.singleton_class.class_eval{define_method(:delete_all) {
96
+ puts "deleting all #{entity.collection_name}..."
97
+ self.each{|e| entity.delete(e.id)}
98
+ self.r
88
99
  }}
89
100
  end
90
101
 
@@ -124,7 +135,7 @@ EOF
124
135
  def variants(opts={limit: 250})
125
136
  return if warn_site
126
137
  @@variants ||= nil
127
- @@variants = fetch_cache(ShopifyAPI::Variant, opts, @@variants)
138
+ @@variants = fetch_cache(ShopifyAPI::VariantWithProduct, opts, @@variants)
128
139
  @@variants
129
140
 
130
141
  end
@@ -1,3 +1,3 @@
1
1
  module Shopifydev
2
- VERSION = "0.0.20"
2
+ VERSION = "0.0.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopifydev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Johnston