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: 66aee20a0fb9f59498989df522fb6d69890ec944
4
- data.tar.gz: 584761dd820d46a8b6b3dc67bd09e4f0a8ba90bd
3
+ metadata.gz: 1dae7fd632f00edc3706a9f842914a777c1627b0
4
+ data.tar.gz: 3c04261a6b4cec730cea9a7d5738769af9f95ad6
5
5
  SHA512:
6
- metadata.gz: 99bf87c6ae908ab8d872b3ecd1933627fefd2743835a54f105b7bfc57907262475285a9fbe3ce236d4f1064dfd4ea03b691feb22bcb3ea0f8c107668f535ea0e
7
- data.tar.gz: 9df3ca90d6096473d7539464b56fa36eadcf1cb2690b537ca4350ed61c9e05aa13f1cf3bd42b4426dc0f893ef8d61510a60d3395b8f1df6b4cac5d803c3a31b6
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) do
47
- class_variable_set(CONFIGURATION, value)
48
- end
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?(:[]) ? parameters[:initialize] : parameters
22
+ parameters && parameters.respond_to?(:to_proc) ? @klass.instance_exec(:initialize, &parameters) : 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
- required_parameters.map do |param|
42
+ parameters.map do |param|
43
43
  scope.public_send(param)
44
44
  end
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module StackCommander
2
- VERSION = '0.0.5.pre'
2
+ VERSION = '0.0.5.pre.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_commander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.pre
4
+ version: 0.0.5.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Cichra