console_runner 0.1.10 → 0.1.11
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/lib/console_runner.rb +0 -1
- data/lib/console_runner/version.rb +1 -1
- data/lib/method_parser.rb +6 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48702b2334e7143c8032e902f2e0cbbbe1f64fa0
|
4
|
+
data.tar.gz: f84149a38591b135f60cb61d99e69a3901b190e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d96cebd00e0808b44def12d3e5ece4c969961153fe60b087fd1fb88ea665987ddddc6be91c1addfaaf853faf078132c8b65941d6ce95565b473e0d052c3e4e2b
|
7
|
+
data.tar.gz: 13ea52b7757d0bb79095bd2a8355a080fe7c23e0e8362a2ee1d791f8592f6cc92111a812a7caa276d9228096c4e3dc47af3b5e9a5a32a85972b4e02055bc95c0
|
data/lib/console_runner.rb
CHANGED
data/lib/method_parser.rb
CHANGED
@@ -82,13 +82,10 @@ Use different names to `console_runner` be able to run #{@name} method."
|
|
82
82
|
result
|
83
83
|
end
|
84
84
|
|
85
|
-
# Prepare
|
86
85
|
def params_array
|
87
|
-
expected_params = @parameters.map(&:first).map.with_index { |p, i| [i, p] }.to_h
|
88
86
|
options_groups = {}
|
89
87
|
get_params = {}
|
90
|
-
|
91
|
-
expected_params.each do |index, name|
|
88
|
+
@parameters.map(&:first).map.with_index { |p, i| [i, p] }.to_h.each do |index, name|
|
92
89
|
if options_group?(name)
|
93
90
|
options_groups[index] = name
|
94
91
|
get_params[index] = option_as_hash(name)
|
@@ -96,24 +93,16 @@ Use different names to `console_runner` be able to run #{@name} method."
|
|
96
93
|
get_params[index] = @cmd_opts[name.to_sym]
|
97
94
|
end
|
98
95
|
end
|
99
|
-
get_params
|
100
|
-
|
96
|
+
get_params = get_params.to_a.sort_by { |a| a[0] }.reverse
|
101
97
|
stop_delete = false
|
102
98
|
get_params.delete_if do |a|
|
103
|
-
index
|
104
|
-
value
|
105
|
-
result
|
106
|
-
|
107
|
-
if options_groups[index]
|
108
|
-
result = value == {}
|
109
|
-
else
|
110
|
-
result = value == nil
|
111
|
-
end
|
99
|
+
index = a[0]
|
100
|
+
value = a[1]
|
101
|
+
result = value.nil?
|
102
|
+
result = value == {} if options_groups[index]
|
112
103
|
stop_delete = true unless result
|
113
104
|
next if stop_delete
|
114
|
-
result
|
115
105
|
end
|
116
|
-
|
117
106
|
get_params.sort_by { |a| a[0] }.map { |a| a[1] }
|
118
107
|
end
|
119
108
|
|