Sha256: f08e0b43011951fd24f5b2624a11bddd04fcc29a81bc8d6d3bafaf5f717ec832
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
module Pione module Command # `PioneConfigSet` is a command for setting a value of PIONE global # variable. class PioneConfigSet < BasicCommand # # informations # define(:name, "set") define(:desc, "Set a value of PIONE global variable") # # arguments # argument(:name) do |item| item.type = :string item.desc = "variable name" end argument(:value) do |item| item.type = :string item.desc = "variable value" end # # options # option CommonOption.debug option PioneConfigOption.file # # command lifecycle: execution phase # phase(:execution) do |item| item << PioneConfigAction.load_config item << :set item << PioneConfigAction.save_config end execution(:set) do |item| item.desc = "Set the value" item.process do model[:config].set(model[:name], model[:value]) end item.exception(Global::UnconfigurableVariableError) do |e| cmd.abort("'%s' is not a configurable item name." % cmd.name) end end end PioneConfig.define_subcommand("set", PioneConfigSet) end end
Version data entries
6 entries across 6 versions & 1 rubygems