Class: Utilikilt::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/utilikilt/cli.rb

Instance Method Summary collapse

Instance Method Details

#build(project_dir = nil) ⇒ Object



21
22
23
24
# File 'lib/utilikilt/cli.rb', line 21

def build( project_dir = nil )
  opts = normalize_options(project_dir,options)
  run_one_off_scan( opts ) 
end

#serve(project_dir = nil) ⇒ Object



27
28
29
30
# File 'lib/utilikilt/cli.rb', line 27

def serve( project_dir = nil )
  opts = normalize_options(project_dir,options)
  start_serve( opts )
end

#up(project_dir = nil) ⇒ Object



35
36
37
38
39
40
# File 'lib/utilikilt/cli.rb', line 35

def up( project_dir=nil )
  watch_thread = Thread.new{ watch(project_dir) }
  serve_thread = Thread.new{ serve(project_dir) }

  serve_thread.join # joining on serve rather than watch is arbitrary
end

#watch(project_dir = nil) ⇒ Object



13
14
15
16
# File 'lib/utilikilt/cli.rb', line 13

def watch( project_dir = nil )
  opts = normalize_options(project_dir,options)
  start_watcher(opts)
end

#workspace(workspace_name) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/utilikilt/cli.rb', line 43

def workspace( workspace_name )
  workspace = Workspace.new( Dir.getwd, workspace_name )
  problems = workspace.create_or_report_problems
  if problems
    puts 
    puts problems
    exit 1
  end
end