Sha256: 9a7f88ebf1e737066d778429b79dac2f1e5e1aef8752c35e7eec94c3d47c7c12

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

require "vmc"
require "vmc/cli"

module Static
  class CLI < VMC::CLI

    def initialize(command = nil, input = nil)
      config = File.expand_path(VMC::CONFIG_DIR)
      if not File.exist? config
        target = sane_target_url("http://api.static.me")
        ensure_config_dir
		    File.open(File.expand_path(VMC::TARGET_FILE), "w") do |f|
        	f.write(sane_target_url(target))
      	end
        info = target_info(client_target)
        save_target_info(info)
      end

      super

      @@commands.delete(:register)
    end

    def default_action
      if input[:version]
        line "static #{Static::Cmd::VERSION}"
      end

      super
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
static-1.0.0 lib/static/cli.rb