Module: Baltix::Actor::Touch

Defined in:
lib/baltix/actor/touch.rb

Defined Under Namespace

Classes: NoDestinationDirError, NoFileError, NoSourceDirError

Class Method Summary collapse

Class Method Details

.apply(context) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/baltix/actor/touch.rb', line 7

def apply context
   target_dir = context['target_dir'] || raise(NoDestinationDirError)
   file = context['file'] || raise(NoFileError)

   target_file = File.join(context['target_prefix'] || '', target_dir, file)
   FileUtils.mkdir_p(File.dirname(target_file))
   FileUtils.touch(target_file)
   $stdout.puts "  >> #{target_file}"
end