cli-mastermind 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd49841f87237f2a7223cd748c61772244232e84cdf46112241e291e73f1a311
4
- data.tar.gz: '0197b2452f75c1c1c7ac50d84621a9dfef1635d04781c500fb4ca8516f2b65e5'
3
+ metadata.gz: 5da64e29ee1014239c49a64d9edacdda1aa736bce7eb4d7b2e096bfc4ca3ca31
4
+ data.tar.gz: b53c2e2ca23d992dfb78719d72c9f5425848cea3b4472cc3d585bad54d2d482e
5
5
  SHA512:
6
- metadata.gz: b3f195e375e769c105e335c29ab33102db1b2ad76b963f6f463f9c77e0d25a6b79bced05eb44cc86eccaa8d32701236d10b73854310955f8f50742cbeb76a7ac
7
- data.tar.gz: a5e649e5427b3bea7e52e6cb1a12fa3e563d5e54fbf405623c2d2cdb58147c89dab6043d8fabb3351bf70c13174b0c4c5827383cf75fea0270665847c4a2a3a0
6
+ metadata.gz: 2bedc8b57e920f91bafac591f4080321704bef45e99f82dcdfccffe202dbf071fc01b96629239462f54d8bcdccc844a41428f67069784d6ed5d759c800329e3b
7
+ data.tar.gz: 81b1bf6a7d806b057ff3729c1e723d2a342e18e162c1f1a843d36c785e6a1ad8cb3286468aca3aad4bce506bb991a929d0ddf0589d06ec28425a05bd3d4ae81f
@@ -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
@@ -7,7 +7,7 @@ module CLI
7
7
 
8
8
  module VERSION
9
9
  RELEASE = 1
10
- MAJOR = 0
10
+ MAJOR = 1
11
11
  MINOR = 0
12
12
  PATCH = nil
13
13
 
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.0.0
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-10-08 00:00:00.000000000 Z
11
+ date: 2019-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cli-ui