bootic_cli 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/bootic_cli/cli.rb +6 -1
- data/lib/bootic_cli/themes/api_theme.rb +19 -6
- data/lib/bootic_cli/themes/workflows.rb +12 -4
- data/lib/bootic_cli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 19dcc9147bd84c2b93d61e879276f62c9a2f6cd9eaa5743c6253ac0fa228e2e7
|
4
|
+
data.tar.gz: 5d8b8b62298052e7e1288c56f6157a52074f3f206acc8ef6d54387dc280ed7a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a39d8dc64b83fd85cfbfeb2560804ed4339a008593074e8145c65c91c9fd054465681d79948776e8bc22f632e4d4605864e10f39bf12817d9254e6187fc00419
|
7
|
+
data.tar.gz: c7c5cff0786564b00ece4d3135a246f401115eba87f348912b8c177a2e85b4e359c91ba006c29887f13a98c097d84efc4d97315474925e7fe56e05578dcad815
|
data/lib/bootic_cli/cli.rb
CHANGED
@@ -177,7 +177,12 @@ module BooticCli
|
|
177
177
|
IRB.conf[:PROMPT_MODE] = :CUSTOM
|
178
178
|
IRB.conf[:AUTO_INDENT] = false
|
179
179
|
|
180
|
-
|
180
|
+
begin
|
181
|
+
IRB.irb nil, context
|
182
|
+
rescue ThreadError => e
|
183
|
+
# puts "#{e.class} -> #{e.message}"
|
184
|
+
exit(1)
|
185
|
+
end
|
181
186
|
end
|
182
187
|
end
|
183
188
|
|
@@ -27,17 +27,17 @@ module BooticCli
|
|
27
27
|
def ==(other)
|
28
28
|
if digest.to_s == '' || other.digest.to_s == ''
|
29
29
|
# puts "One or the other digest is empty: #{digest} -- #{other.digest}"
|
30
|
-
return super
|
30
|
+
return super
|
31
31
|
end
|
32
32
|
|
33
33
|
# file sizes may differ as they are served by CDN (that shrinks them)
|
34
34
|
self.digest == other.digest # && self.file_size == other.file_size
|
35
35
|
end
|
36
36
|
|
37
|
-
def fetch_data(attempt = 1)
|
37
|
+
def fetch_data(attempt = 1, skip_verify = false)
|
38
38
|
uri = URI.parse(rels[:file].href)
|
39
39
|
opts = REQUEST_OPTS.merge({
|
40
|
-
|
40
|
+
verify_mode: skip_verify ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER,
|
41
41
|
use_ssl: uri.port == 443
|
42
42
|
})
|
43
43
|
|
@@ -50,6 +50,9 @@ module BooticCli
|
|
50
50
|
raise if attempt > 3 # max attempts
|
51
51
|
# puts "#{e.class} for #{File.basename(uri.path)}! Retrying request..."
|
52
52
|
fetch_data(attempt + 1)
|
53
|
+
rescue OpenSSL::SSL::SSLError => e
|
54
|
+
# retry but skipping verification
|
55
|
+
fetch_data(attempt + 1, true)
|
53
56
|
end
|
54
57
|
end
|
55
58
|
|
@@ -113,7 +116,12 @@ module BooticCli
|
|
113
116
|
|
114
117
|
def remove_template(file_name)
|
115
118
|
tpl = theme.templates.find { |t| t.file_name == file_name }
|
116
|
-
|
119
|
+
if tpl && tpl.can?(:delete_template)
|
120
|
+
res = tpl.delete_template
|
121
|
+
check_errors!(res) if res.respond_to?(:can?)
|
122
|
+
else
|
123
|
+
puts "Cannot delete #{file_name}"
|
124
|
+
end
|
117
125
|
end
|
118
126
|
|
119
127
|
def add_asset(file_name, file)
|
@@ -124,8 +132,13 @@ module BooticCli
|
|
124
132
|
end
|
125
133
|
|
126
134
|
def remove_asset(file_name)
|
127
|
-
asset = theme.assets.find{|t| t.file_name == file_name }
|
128
|
-
|
135
|
+
asset = theme.assets.find { |t| t.file_name == file_name }
|
136
|
+
if asset and asset.can?(:delete_theme_asset)
|
137
|
+
res = asset.delete_theme_asset
|
138
|
+
check_errors!(res) if res.respond_to?(:can?)
|
139
|
+
else
|
140
|
+
puts "Cannot delete asset: #{file_name}"
|
141
|
+
end
|
129
142
|
end
|
130
143
|
|
131
144
|
private
|
@@ -267,15 +267,21 @@ module BooticCli
|
|
267
267
|
end
|
268
268
|
|
269
269
|
def remove_all(from, to)
|
270
|
-
from.templates.each
|
271
|
-
|
270
|
+
from.templates.each do |f|
|
271
|
+
puts "Removing template #{highlight(f.file_name)}"
|
272
|
+
to.remove_template(f.file_name)
|
273
|
+
end
|
274
|
+
from.assets.each do |f|
|
275
|
+
puts "Removing asset #{highlight(f.file_name)}"
|
276
|
+
to.remove_asset(f.file_name)
|
277
|
+
end
|
272
278
|
end
|
273
279
|
|
274
280
|
def copy_templates(from, to, opts = {})
|
275
281
|
from.templates.each do |t|
|
276
282
|
handle_file_errors(:template, t) do
|
277
283
|
to.add_template(t.file_name, t.body)
|
278
|
-
puts "Copied #{highlight(t.file_name)}"
|
284
|
+
puts "Copied template #{highlight(t.file_name)}"
|
279
285
|
end
|
280
286
|
end
|
281
287
|
end
|
@@ -332,6 +338,8 @@ module BooticCli
|
|
332
338
|
theme.remove_template(file_name)
|
333
339
|
when :asset
|
334
340
|
theme.remove_asset(file_name)
|
341
|
+
else
|
342
|
+
raise "Invalid type: #{type}"
|
335
343
|
end
|
336
344
|
puts "Deleted remote #{type}: #{highlight(file_name)}"
|
337
345
|
end
|
@@ -361,7 +369,7 @@ module BooticCli
|
|
361
369
|
prompt.say("#{file.file_name} looks like a binary file, not a template. Skipping...", :red)
|
362
370
|
# abort
|
363
371
|
|
364
|
-
rescue Net::OpenTimeout, Net::ReadTimeout => e
|
372
|
+
rescue Net::OpenTimeout, Net::ReadTimeout => e
|
365
373
|
prompt.say("I'm having trouble connecting to the server. Please try again in a minute.", :red)
|
366
374
|
abort
|
367
375
|
|
data/lib/bootic_cli/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.3
|
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: 2019-
|
12
|
+
date: 2019-08-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.7.3
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Bootic command-line client.
|