bootic_cli 0.5.4 → 0.5.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
  SHA1:
3
- metadata.gz: 33dd7903e0e41865015bbbf447ba8eeb5f129349
4
- data.tar.gz: 8a082e16833d9da57bdc7f408f652f5b43677c4b
3
+ metadata.gz: c0ca07dc72c5128ad36d0238086d41432565e60a
4
+ data.tar.gz: 18647ebabc38ea74417ffc4ba4beb627e463494d
5
5
  SHA512:
6
- metadata.gz: e5b628ce27bd6bb46520a971a8dc5c49acc8bb36f1bd029bf9fcfeed327e92b177c8da4e7ef6ecbff5c90e638141a87596fb547f4bc6cf32e1de846c5926d953
7
- data.tar.gz: 46b6bed1f17ac6fae5f102d444014714fdb79cfcc2405bd5e798680b2ea0941cc22aaf8769b19089f28912b6166c323f2e2ea5f082257988d0e64123f33d7a3e
6
+ metadata.gz: 14fbbce3f9176faab1138b03e511d57b214ee19dbdf6289f7780cfe8bc3d6052ea87b681706ba38922e17d6f6ad4947eed85d1f3f58af2afded64dc55a2c913e
7
+ data.tar.gz: a4fec4c63aea720c868bea2f48dbfb865db4677e1054433edb8fb6258ddeab3b72c4dc2836dc6d9e62232a169089d67da955b6391242946f0edbb5c6f1adde94
@@ -9,6 +9,7 @@ module BooticCli
9
9
  end
10
10
 
11
11
  def ==(other)
12
+ # puts "Comparing with time #{self.updated_on} vs #{other.updated_on}"
12
13
  self.updated_on == other.updated_on
13
14
  end
14
15
  end
@@ -24,8 +25,13 @@ module BooticCli
24
25
  end
25
26
 
26
27
  def ==(other)
27
- return super if digest.to_s == '' || other.digest.to_s == ''
28
- self.file_size == other.file_size && self.digest == other.digest
28
+ if digest.to_s == '' || other.digest.to_s == ''
29
+ # puts "One or the other digest is empty: #{digest} -- #{other.digest}"
30
+ return super
31
+ end
32
+
33
+ # file sizes may differ as they are served by CDN (that shrinks them)
34
+ self.digest == other.digest # && self.file_size == other.file_size
29
35
  end
30
36
 
31
37
  def fetch_data(attempt = 1)
@@ -53,12 +59,13 @@ module BooticCli
53
59
  attr_reader :errors
54
60
  def initialize(errors)
55
61
  @errors = errors
56
- super "Entity has errors: #{errors.map(&:field)}"
62
+ super "Entity has errors: #{errors.map(&:field).join(', ')}"
57
63
  end
58
64
  end
59
65
 
60
66
  def initialize(theme)
61
67
  @theme = theme
68
+ puts "Entity has errors: #{theme.errors.map(&:messages).join(', ')}" if theme.has?(:errors)
62
69
  end
63
70
 
64
71
  # this is unique to API themes
@@ -124,7 +131,6 @@ module BooticCli
124
131
  private
125
132
  attr_reader :theme
126
133
 
127
-
128
134
  def check_errors!(entity)
129
135
  if entity.has?(:errors)
130
136
  raise EntityErrors.new(entity.errors)
@@ -19,10 +19,12 @@ module BooticCli
19
19
 
20
20
  def ==(other)
21
21
  if other.digest.to_s == '' # api theme asset without a digest set
22
+ # puts "Other has no digest, so comparing dates: #{self.updated_on} vs #{other.updated_on}"
22
23
  return self.updated_on == other.updated_on
23
24
  end
24
25
 
25
- self.file_size == other.file_size && self.digest == other.digest
26
+ # file sizes may differ as they are served by CDN (that shrinks them)
27
+ self.digest == other.digest # self.file_size == other.file_size
26
28
  end
27
29
  end
28
30
 
@@ -284,18 +284,20 @@ module BooticCli
284
284
  files = from.assets.find_all do |a|
285
285
  if opts[:overwrite]
286
286
  true
287
- else
288
- target_asset = to.assets.find { |t| t.file_name == a.file_name }
289
- if target_asset
290
- opts[:interactive] && prompt.yes_or_no?("Asset exists: #{highlight(a.file_name)}. Overwrite?", false)
287
+ elsif existing = to.assets.find { |t| t.file_name == a.file_name }
288
+ if existing == a # exact copy, no need to overwrite
289
+ false
291
290
  else
292
- true
291
+ opts[:interactive] && prompt.yes_or_no?("Asset exists: #{highlight(a.file_name)}. Overwrite?", false)
293
292
  end
293
+ else
294
+ true
294
295
  end
295
296
  end
296
297
 
297
298
  pool = BooticCli::WorkerPool.new(CONCURRENCY)
298
299
 
300
+ # puts "Downloading assets: #{files.count}"
299
301
  files.each do |a|
300
302
  pool.schedule do
301
303
  handle_file_errors(:asset, a) do
@@ -1,3 +1,3 @@
1
1
  module BooticCli
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootic_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-02 00:00:00.000000000 Z
12
+ date: 2019-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor