Sha256: a123d8253e4df3814dd679ff77acbca4112ee674fd512cd635e7a6506c0dfabf

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

module Baltix::Actor::Touch
   class NoDestinationDirError < StandardError ;end
   class NoSourceDirError < StandardError ;end
   class NoFileError < StandardError ;end

   class << self
      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
   end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
baltix-0.1.1 lib/baltix/actor/touch.rb