Sha256: 22cb74f21238d78ef665b31a53b02ac180570c82b45f1f3282cdcf5c1e54430f
Contents?: true
Size: 781 Bytes
Versions: 1
Compression:
Stored size: 781 Bytes
Contents
module Baltix::Actor::Link class NoDestinationDirError < StandardError ;end class NoSourceDirError < StandardError ;end class NoFileError < StandardError ;end class << self def apply context target_dir = context['target_dir'] || raise(NoDestinationDirError) source_dir = context['source_dir'] || raise(NoSourceDirError) file = context['file'] || raise(NoFileError) target_file = File.join(context['target_prefix'] || '', target_dir, file) source_file = File.join(source_dir, file) FileUtils.mkdir_p(File.dirname(target_file)) FileUtils.rm_rf(target_file) FileUtils.ln_s(source_file, target_file, force: true) $stdout.puts " #{source_file} -> #{target_file}" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
baltix-0.1.1 | lib/baltix/actor/link.rb |