Class: MediaWikiVagrant::Hiera
- Includes:
- PluginEnvironment
- Defined in:
- lib/mediawiki-vagrant/hiera.rb
Overview
Provides a command-line interface for configuration of hiera settings.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from PluginEnvironment
#initialize, #interactive_out?
Class Method Details
.synopsis ⇒ Object
10 11 12 |
# File 'lib/mediawiki-vagrant/hiera.rb', line 10 def self.synopsis 'sets and displays hiera overrides' end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mediawiki-vagrant/hiera.rb', line 14 def execute = { unset: [], } opts = OptionParser.new do |o| o. = 'Usage: vagrant hiera [options] [key] [value]' o.separator '' o.separator 'Options:' o.separator '' o.on('--unset NAME', 'Remove a configured key') do |name| [:unset] << name end end argv = (opts) return unless argv if [:unset].any? unset_key([:unset]) elsif argv.length == 2 set_key(*argv) elsif argv.length == 1 get_key(*argv) else @env.ui.error opts return 1 end 0 end |