Sha256: 317739abdc996cc2f11b1eef2e2908fc6741b730004453233539c3711cebabb3
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
Contents
module Bubbles module Uploaders class LocalDir extend Forwardable include Bubbles::CommonUploaderInterface def call config.logger.debug("#{self.class.name}: transfering #{uid_file} to #{local_dir_uploader_path}") FileUtils.cp(uid_file, local_dir_uploader_path) write_metadata rescue Errno::ENOENT => e config.logger.error("#{e.message}") command_queue.reschedule(self) end def inspect "<##{self.class.name} uid_file: #{uid_file} to: #{local_dir_uploader_path}>" end private def_delegators :config, :local_dir_uploader_path, :local_dir_metadata_file_path def_delegators :bfile, :uid_file, :uid_file_name, :metadata def write_metadata File.open(local_dir_metadata_file_path, 'a') do |f| f.write yaml_append end end def yaml_append <<EOF - key: #{uid_file_name} path: #{uid_file} metadata: #{metadata.to_json} EOF end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bubbles-0.0.4 | lib/bubbles/uploaders/local_dir.rb |