stack_commander 0.0.5.pre → 0.0.5.pre.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dae7fd632f00edc3706a9f842914a777c1627b0
|
4
|
+
data.tar.gz: 3c04261a6b4cec730cea9a7d5738769af9f95ad6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee8c6a2d3c1ad2652d918d1880b0889c8eae16f6896ae576eca932f80c0095031c9e9c22580530e158c2211414c6b38d0bf825c43243005dbb60d0190593b9d
|
7
|
+
data.tar.gz: f27cb2d4341f3015bbe93d069bcf7cd7e0870296644a35929dd519a81b8fa0f1042b1f696c928f0bcbd6f6e6c3aa53523039838842a9f38458b4c83f4bb7b8a8
|
@@ -43,9 +43,9 @@ module StackCommander
|
|
43
43
|
# Creates an anonymous subclass of current command, configured with passed value
|
44
44
|
# then all instances of that command will have the same configuration
|
45
45
|
def [](value)
|
46
|
-
Class.new(self)
|
47
|
-
|
48
|
-
|
46
|
+
subclass = Class.new(self)
|
47
|
+
subclass.class_variable_set(CONFIGURATION, value)
|
48
|
+
subclass
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -19,7 +19,7 @@ module StackCommander
|
|
19
19
|
|
20
20
|
def configured_parameters
|
21
21
|
parameters = @klass.class_variable_defined?(CVAR) && @klass.class_variable_get(CVAR)
|
22
|
-
parameters && parameters.respond_to?(:
|
22
|
+
parameters && parameters.respond_to?(:to_proc) ? @klass.instance_exec(:initialize, ¶meters) : parameters
|
23
23
|
end
|
24
24
|
|
25
25
|
def parameters
|
@@ -39,7 +39,7 @@ module StackCommander
|
|
39
39
|
def extract(scope)
|
40
40
|
match!(scope)
|
41
41
|
|
42
|
-
|
42
|
+
parameters.map do |param|
|
43
43
|
scope.public_send(param)
|
44
44
|
end
|
45
45
|
end
|