bootinq 1.6 → 1.7
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 +4 -4
- data/README.md +1 -1
- data/lib/bootinq/version.rb +1 -1
- data/lib/bootinq.rb +28 -24
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab4d92e0581dec34e3b8c35ab842953fc6c488a7ff7a79aab4e155e0ec04b598
|
4
|
+
data.tar.gz: 8d1b03413cb95941d3c34fa33e5167ae717a1152fb824f9fc4ca4c95232e3374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 957af1a041fb5230543b149ae7bb3fa14b455e0070232c60afe617c6dfce34712d3d9ea118aad38d2fd824ef253cb6af38a1e4a115d9f5862a2680ce4d2a48e2
|
7
|
+
data.tar.gz: 3dcecd28f93e44b34e7401fb6c4702754f57cac19706996a74fdbc306a9251d0fd7f8360afcd07470d37627461af4ecf1ea45e03f626b52543123d1991453d72
|
data/README.md
CHANGED
data/lib/bootinq/version.rb
CHANGED
data/lib/bootinq.rb
CHANGED
@@ -61,6 +61,8 @@ class Bootinq
|
|
61
61
|
"deps" => {}
|
62
62
|
}.freeze
|
63
63
|
|
64
|
+
ALL = %i[* all].freeze
|
65
|
+
|
64
66
|
FilterNegValue = -> (value, config) do
|
65
67
|
if value.start_with?(?-, ?^)
|
66
68
|
value = value.tr('\\-', '\\^')
|
@@ -168,7 +170,7 @@ class Bootinq
|
|
168
170
|
# Checks if a component with the given name (i.e. the same gem group)
|
169
171
|
# is enabled
|
170
172
|
def enabled?(name)
|
171
|
-
components.include?(name)
|
173
|
+
ALL.include?(name) || components.include?(name)
|
172
174
|
end
|
173
175
|
|
174
176
|
# :call-seq:
|
@@ -233,6 +235,11 @@ class Bootinq
|
|
233
235
|
# # do something when frontend and backend are enabled
|
234
236
|
# end
|
235
237
|
def on(name = nil, any: nil, all: nil) # :yields:
|
238
|
+
if ALL.include?(name)
|
239
|
+
yield
|
240
|
+
return true
|
241
|
+
end
|
242
|
+
|
236
243
|
if name.nil? && any.nil? && all.nil?
|
237
244
|
raise ArgumentError, "wrong arguments (given 0, expected 1)"
|
238
245
|
elsif (any && all) || (name && (any || all))
|
@@ -253,7 +260,7 @@ class Bootinq
|
|
253
260
|
# Takes a list of component names and yields a given block (optionally)
|
254
261
|
# if all of them are enabled. Returns boolean matching status.
|
255
262
|
def on_all(*parts) # :yields:
|
256
|
-
is_matched = parts.all? { |
|
263
|
+
is_matched = parts.all? { |part| enabled?(part) }
|
257
264
|
yield if is_matched && block_given?
|
258
265
|
is_matched
|
259
266
|
end
|
@@ -264,7 +271,7 @@ class Bootinq
|
|
264
271
|
# Takes a list of component names and yields a given block (optionally)
|
265
272
|
# if any of them are enabled. Returns boolean matching status.
|
266
273
|
def on_any(*parts) # :yields:
|
267
|
-
is_matched = parts.any? { |
|
274
|
+
is_matched = parts.any? { |part| enabled?(part) }
|
268
275
|
yield if is_matched && block_given?
|
269
276
|
is_matched
|
270
277
|
end
|
@@ -302,25 +309,22 @@ class Bootinq
|
|
302
309
|
super
|
303
310
|
end
|
304
311
|
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
on_any
|
324
|
-
switch
|
325
|
-
).each { |sym| class_eval(delegate_template % sym, *instance_method(sym).source_location) }
|
312
|
+
extend SingleForwardable
|
313
|
+
|
314
|
+
delegate %I[
|
315
|
+
component
|
316
|
+
components
|
317
|
+
each_mountable
|
318
|
+
enabled?
|
319
|
+
enable_component
|
320
|
+
flags
|
321
|
+
groups
|
322
|
+
on
|
323
|
+
on_all
|
324
|
+
on_any
|
325
|
+
ready!
|
326
|
+
ready?
|
327
|
+
switch
|
328
|
+
[]
|
329
|
+
] => :instance
|
326
330
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootinq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -64,7 +64,7 @@ homepage: https://github.com/estum/bootinq
|
|
64
64
|
licenses:
|
65
65
|
- MIT
|
66
66
|
metadata: {}
|
67
|
-
post_install_message:
|
67
|
+
post_install_message:
|
68
68
|
rdoc_options: []
|
69
69
|
require_paths:
|
70
70
|
- lib
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubygems_version: 3.0.3
|
83
|
-
signing_key:
|
83
|
+
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Rails Boot Inquirer
|
86
86
|
test_files: []
|