Sha256: 6248de9b87b7ecae40ce87821bec341e9bcfd15d23e041f960b9765746f1aa5b

Contents?: true

Size: 556 Bytes

Versions: 16

Compression:

Stored size: 556 Bytes

Contents

require 'fileutils'
module Mccloud
  module Command
    class UnDefineCommand < Base

      register "undefine NAME", "Undefines a machine"
      argument :name, :type => :string, :optional => false, :default => nil

      def execute
        env.ui.info "Undefine machine #{name}"
        filename=File.join("vms","#{name}.rb")
        if File.exists?(filename)
          env.ui.info "Removing #{filename}"
          FileUtils.rm(filename)
        else
          env.ui.info "Machine #{name} has not yet defined"
        end
      end

    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mccloud-0.1.1 lib/mccloud/command/undefine.rb
mccloud-0.0.28 lib/mccloud/command/undefine.rb
mccloud-0.0.27 lib/mccloud/command/undefine.rb
mccloud-0.0.26 lib/mccloud/command/undefine.rb
mccloud-0.0.25 lib/mccloud/command/undefine.rb
mccloud-0.0.24 lib/mccloud/command/undefine.rb
mccloud-0.0.23 lib/mccloud/command/undefine.rb
mccloud-0.0.22 lib/mccloud/command/undefine.rb
mccloud-0.0.21 lib/mccloud/command/undefine.rb
mccloud-0.0.20 lib/mccloud/command/undefine.rb
mccloud-0.0.19 lib/mccloud/command/undefine.rb
mccloud-0.0.18 lib/mccloud/command/undefine.rb
mccloud-0.0.17 lib/mccloud/command/undefine.rb
mccloud-0.0.16 lib/mccloud/command/undefine.rb
mccloud-0.0.15 lib/mccloud/command/undefine.rb
mccloud-0.0.14 lib/mccloud/command/undefine.rb