cli-mastermind 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cli/mastermind.rb +16 -0
- data/lib/cli/mastermind/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: 5da64e29ee1014239c49a64d9edacdda1aa736bce7eb4d7b2e096bfc4ca3ca31
|
4
|
+
data.tar.gz: b53c2e2ca23d992dfb78719d72c9f5425848cea3b4472cc3d585bad54d2d482e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bedc8b57e920f91bafac591f4080321704bef45e99f82dcdfccffe202dbf071fc01b96629239462f54d8bcdccc844a41428f67069784d6ed5d759c800329e3b
|
7
|
+
data.tar.gz: 81b1bf6a7d806b057ff3729c1e723d2a342e18e162c1f1a843d36c785e6a1ad8cb3286468aca3aad4bce506bb991a929d0ddf0589d06ec28425a05bd3d4ae81f
|
data/lib/cli/mastermind.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
require 'forwardable'
|
3
|
+
require 'pathname'
|
3
4
|
require 'cli/ui'
|
4
5
|
require 'cli/mastermind/arg_parse'
|
5
6
|
require 'cli/mastermind/configuration'
|
@@ -33,6 +34,17 @@ module CLI
|
|
33
34
|
@base_plan = base_plan
|
34
35
|
end
|
35
36
|
|
37
|
+
# Allows utilities wrapping Mastermind to specify planfiles that should be
|
38
|
+
# automatically loaded. Plans loaded this way are loaded _after_ all other
|
39
|
+
# planfiles and so should only be used to set default values.
|
40
|
+
def autoload_masterplan(plan_file_path)
|
41
|
+
path = Pathname.new plan_file_path
|
42
|
+
raise Error, "`#{plan_file_path}` is not an absolute path" unless path.absolute?
|
43
|
+
raise Error, "`#{plan_file_path}` does not exist or is not a file" unless path.file?
|
44
|
+
@autoloads ||= []
|
45
|
+
@autoloads << plan_file_path
|
46
|
+
end
|
47
|
+
|
36
48
|
# Process incoming options and take an appropriate action.
|
37
49
|
# This is normally called by the mastermind executable.
|
38
50
|
def execute(cli_args=ARGV)
|
@@ -41,6 +53,10 @@ module CLI
|
|
41
53
|
enable_ui if @arguments.display_ui?
|
42
54
|
|
43
55
|
frame('Mastermind') do
|
56
|
+
if @autoloads && @autoloads.any?
|
57
|
+
@autoloads.each { |masterplan| configuration.load_masterplan masterplan }
|
58
|
+
end
|
59
|
+
|
44
60
|
if @arguments.dump_config?
|
45
61
|
do_print_configuration
|
46
62
|
exit 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cli-mastermind
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Hall
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cli-ui
|