class Bubbles::Uploaders::LocalDir

Public Instance Methods

call() click to toggle source
# File lib/bubbles/uploaders/local_dir.rb, line 7
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
inspect() click to toggle source
# File lib/bubbles/uploaders/local_dir.rb, line 16
def inspect
  "<##{self.class.name} uid_file: #{uid_file} to: #{local_dir_uploader_path}>"
end

Private Instance Methods

write_metadata() click to toggle source
# File lib/bubbles/uploaders/local_dir.rb, line 24
def write_metadata
  File.open(local_dir_metadata_file_path, 'a') do |f|
    f.write yaml_append
  end
end
yaml_append() click to toggle source
# File lib/bubbles/uploaders/local_dir.rb, line 30
        def yaml_append
<<EOF
-
  key: #{uid_file_name}
  metadata: #{metadata.to_json}
EOF
        end