Class: MM::Command::Init

Inherits:
AbstractCommand show all
Defined in:
lib/mm/cmds/init.rb

Instance Method Summary collapse

Methods inherited from AbstractCommand

#cache_options, #card_property?, #display_value, #options, #output, #run, #user_property?, #view

Instance Method Details

#do_once(clazz = nil) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/mm/cmds/init.rb', line 19

def do_once(clazz=nil)
  if clazz.respond_to?(:site)
    raise "Unknow Mingle project url. Type 'mm ?' for usage to init Mingle project url." if options[:site].blank?
    clazz.site = options[:site]
  end

  "site        => #{(options[:site]||"").gsub(/:[^@:]*@/, ":***@")}"
end

#docObject



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/mm/cmds/init.rb', line 32

def doc
%{
usage: mm init [site_url]

environment variable options:
  MM_SITE => the Mingle REST API project base url

Synopsis:
  mm init => show MingleMingle working directory settings.
  mm init http://name:[email protected]/projects/project_identifiler/ => setup MingleMingle working directory with Mingle REST api project base url.
}
end

#parse(argv) ⇒ Object



28
29
30
# File 'lib/mm/cmds/init.rb', line 28

def parse(argv)
  options[:site] = argv.first
end