Class: Static::CLI

Inherits:
VMC::CLI
  • Object
show all
Defined in:
lib/static/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(command = nil, input = nil) ⇒ CLI

Returns a new instance of CLI.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/static/cli.rb', line 21

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

Instance Method Details

#default_actionObject



38
39
40
41
42
43
44
# File 'lib/static/cli.rb', line 38

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