Class: Kojo::Commands::CommandBase

Inherits:
MisterBin::Command
  • Object
show all
Defined in:
lib/kojo/commands/command_base.rb

Direct Known Subclasses

DirCmd, SingleCmd

Instance Method Summary collapse

Instance Method Details

#save(file, output) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/kojo/commands/command_base.rb', line 6

def save(file, output)
  outpath = "#{outdir}/#{file}"
  dir = File.dirname outpath
  FileUtils.mkdir_p dir unless Dir.exist? dir
  File.write outpath, output
  say "Saved #{outpath}"  
end