bootinq 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bootinq.rb +1 -2
- data/lib/bootinq/switch.rb +6 -22
- data/lib/bootinq/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2132126092e2938ead320330a8866a61e496e47683b1a88c7ec3f8b15d3f1f2b
|
4
|
+
data.tar.gz: 3eee6dabbc507a0d8234d2edc64461eddca66259b3df04c76799cbfffbbb94f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2b45226f655ee94a841ec79f70934af6948427ba97e4a1269a4371693b9c3d50bbd9857db2b2b7a914532cc04a571176c41dbeb7f44bbd5979b4464562e5dbe
|
7
|
+
data.tar.gz: cd87ee76d07175f774202a45c20875d5e1c9a18ab2e0f469e75b2d4a9039520fda537ba29d12f05f67e5e1704b8797a4296ba5c277e56da14a1982731ff7678f
|
data/lib/bootinq.rb
CHANGED
@@ -106,7 +106,6 @@ class Bootinq
|
|
106
106
|
@_neg = @_value.start_with?(?-, ?^)
|
107
107
|
@flags = []
|
108
108
|
@components = []
|
109
|
-
@switch = Switch.new(*@components)
|
110
109
|
|
111
110
|
config['parts'].each { |flag, name| enable_component(name, flag: flag) }
|
112
111
|
config['mount'].each { |flag, name| enable_component(name, flag: flag, as: Mountable) }
|
@@ -242,7 +241,7 @@ class Bootinq
|
|
242
241
|
# part.backend { … }
|
243
242
|
# end
|
244
243
|
delegated def switch # :yields: Bootinq::Switch.new
|
245
|
-
yield(
|
244
|
+
yield(Switch.new)
|
246
245
|
nil
|
247
246
|
end
|
248
247
|
|
data/lib/bootinq/switch.rb
CHANGED
@@ -5,32 +5,16 @@ class Bootinq
|
|
5
5
|
undef_method :==
|
6
6
|
undef_method :equal?
|
7
7
|
|
8
|
-
module YieldMixin
|
9
|
-
def yield_block
|
10
|
-
yield
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
private_constant :YieldMixin
|
15
|
-
|
16
|
-
def self.new(*names)
|
17
|
-
switch = super()
|
18
|
-
mixin = ::Module.new
|
19
|
-
mixin.include(YieldMixin)
|
20
|
-
names.each { |name| mixin.alias_method name, :yield_block }
|
21
|
-
mixin.send(:private, :yield_block)
|
22
|
-
mixin.send(:extend_object, switch)
|
23
|
-
switch
|
24
|
-
ensure
|
25
|
-
mixin = nil
|
26
|
-
end
|
27
|
-
|
28
8
|
def raise(*args) # :no-doc:
|
29
9
|
::Object.send(:raise, *args)
|
30
10
|
end
|
31
11
|
|
32
|
-
def method_missing(*)
|
33
|
-
|
12
|
+
def method_missing(name, *)
|
13
|
+
if ::Bootinq.enabled?(name)
|
14
|
+
yield()
|
15
|
+
else
|
16
|
+
nil
|
17
|
+
end
|
34
18
|
end
|
35
19
|
end
|
36
20
|
end
|
data/lib/bootinq/version.rb
CHANGED