thor-addons 1.0.2 → 1.0.3
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/CHANGELOG.md +6 -0
- data/lib/thor-addons/helpers/options_config_file.rb +6 -12
- data/lib/thor-addons/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bd656f336a408fa69a9cda65493fb7d9c3d8b3bba39d01c28af7c82a565a04d
|
4
|
+
data.tar.gz: 67638ae62b9ae368c9d97a3c929dab7600bf4b28e6a9da2d70ef4f53573666c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 207fdff2a961cdeba426b9906f547adf02d5e7ce9122464c2c4be337721fa003335925b6c6fcfef2aa787346d17c58c6043344d08136ad5a6569ecaf52f8a48d
|
7
|
+
data.tar.gz: a6f49a41898b3323cba5fd15d89eff699723eb9166760f1af9235fc79dcfbc206bc8ac2dd04f4ff5e73c7832326954fc0f619a7ca5eb1a7db59a85cd06425fcb
|
data/CHANGELOG.md
CHANGED
@@ -11,29 +11,23 @@ module ThorAddons
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.extract_command_data(data, command)
|
14
|
-
|
15
|
-
|
16
|
-
return data_hash if command.nil? || data[command].nil?
|
17
|
-
|
18
|
-
data_hash.merge(data[command])
|
14
|
+
[data.fetch("global", {}), data.fetch(command, {})]
|
19
15
|
end
|
20
16
|
|
21
17
|
def self.get_command_config_data(data, invocations, current_command_name)
|
22
18
|
invocations ||= {}
|
23
19
|
commands = (invocations.values.flatten << current_command_name)
|
24
20
|
|
25
|
-
|
21
|
+
global_options, cmd_options = extract_command_data(data, commands.shift)
|
26
22
|
|
27
23
|
commands.each do |cmd|
|
28
|
-
|
29
|
-
command_options.merge!(extract_command_data(command_options, cmd))
|
30
|
-
|
31
|
-
%W[#{cmd} global].each { |k| command_options.delete(k) }
|
24
|
+
break if cmd_options[cmd].nil?
|
32
25
|
|
33
|
-
|
26
|
+
global, cmd_options = extract_command_data(cmd_options, cmd)
|
27
|
+
global_options.merge!(global)
|
34
28
|
end
|
35
29
|
|
36
|
-
|
30
|
+
global_options.merge(cmd_options)
|
37
31
|
end
|
38
32
|
|
39
33
|
def self.parse(config_file, invocations, current_command_name, defaults)
|
data/lib/thor-addons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thor-addons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacopo Scrinzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: symbolized
|