Method: Raykit::Command#save
- Defined in:
- lib/raykit/command.rb
#save ⇒ Object
256 257 258 259 260 261 262 263 264 265 |
# File 'lib/raykit/command.rb', line 256 def save filename = "#{Environment.get_dev_dir("log")}/Commands/#{SecureRandom.uuid}" log_dir = File.dirname(filename) FileUtils.mkdir_p(log_dir) unless Dir.exist?(log_dir) File.open(filename, "w") do |f| f.write(JSON.pretty_generate(to_hash)) end self end |