class Devkitkat::Service::Executor::Scripter
Constants
- SCRIPT_HEADER
Public Instance Methods
file_path()
click to toggle source
# File lib/devkitkat/service/executor/scripter.rb, line 11 def file_path File.join(service.dir, "script-#{service.name}-#{command.script}") end
new_file() { || ... }
click to toggle source
# File lib/devkitkat/service/executor/scripter.rb, line 15 def new_file delete_file create_file yield ensure delete_file end
write(cmd)
click to toggle source
# File lib/devkitkat/service/executor/scripter.rb, line 24 def write(cmd) File.open(file_path, 'a') do |stream| stream.write(cmd + "\n") end end
Private Instance Methods
create_file()
click to toggle source
# File lib/devkitkat/service/executor/scripter.rb, line 32 def create_file ensure_service_root_dir File.write(file_path, SCRIPT_HEADER) File.chmod(0777, file_path) end
delete_file()
click to toggle source
# File lib/devkitkat/service/executor/scripter.rb, line 38 def delete_file FileUtils.rm_f(file_path) end
ensure_service_root_dir()
click to toggle source
# File lib/devkitkat/service/executor/scripter.rb, line 42 def ensure_service_root_dir FileUtils.mkdir_p(service.root_dir) end