Class: Persvr::Command

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/persvr/command.rb

Instance Method Summary collapse

Instance Method Details

#clear(path) ⇒ Object



21
22
23
24
25
26
# File 'lib/persvr/command.rb', line 21

def clear(path)
  raise "No instance was found at #{path}" unless File.exist?(path)
  Dir[File.join(path,'WEB-INF','data/*')].each do |file|
    FileUtils.rm_rf file
  end
end

#create(path) ⇒ Object



13
14
15
16
17
18
# File 'lib/persvr/command.rb', line 13

def create(path)      
  directory 'WEB-INF', File.join(path,'WEB-INF'), :force => options[:force]
  empty_directory File.join(path,'WEB-INF','jslib')
  empty_directory File.join(path,'WEB-INF','data')
  copy_file 'index.html', File.join(path,'index.html'), :force => options[:force]
end

#start(path = '.') ⇒ Object



31
32
33
34
35
# File 'lib/persvr/command.rb', line 31

def start(path='.')
  require 'jettr/command'
  jettr = Jettr::Command.new([], options)
  jettr.invoke(:start, [path])
end