Sha256: 0e25f7f7eb0391b736e3f706f6811c1185f47bf1d5c16f275f481de109c13229

Contents?: true

Size: 1001 Bytes

Versions: 6

Compression:

Stored size: 1001 Bytes

Contents

module Pione
  module Command
    # `PioneConfigUnset` is a command for unsetting a value of PIONE global
    # variable.
    class PioneConfigUnset < BasicCommand
      #
      # informations
      #

      define(:name, "unset")
      define(:desc, "Unset a value of PIONE global variable")

      #
      # arguments
      #

      argument(:name) do |item|
        item.type = :string
        item.desc = "variable name"
      end

      #
      # options
      #

      option CommonOption.debug
      option PioneConfigOption.file

      #
      # command lifecycle: execution phase
      #

      phase(:execution) do |item|
        item << PioneConfigAction.load_config
        item << :unset
        item << PioneConfigAction.save_config
      end

      execution(:unset) do |item|
        item.desc = "Unset the item"

        item.process do
          model[:config].unset(model[:name])
        end
      end
    end

    PioneConfig.define_subcommand("unset", PioneConfigUnset)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pione-0.5.0 lib/pione/command/pione-config-unset.rb
pione-0.5.0.alpha.2 lib/pione/command/pione-config-unset.rb
pione-0.5.0.alpha.1 lib/pione/command/pione-config-unset.rb
pione-0.4.2 lib/pione/command/pione-config-unset.rb
pione-0.4.1 lib/pione/command/pione-config-unset.rb
pione-0.4.0 lib/pione/command/pione-config-unset.rb