lib/heirloom/artifact/artifact_uploader.rb in heirloom-0.1.3 vs lib/heirloom/artifact/artifact_uploader.rb in heirloom-0.1.4

- old
+ new

@@ -2,19 +2,18 @@ class ArtifactUploader def initialize(args) @config = args[:config] - @logger = args[:logger] + @name = args[:name] + @id = args[:id] + @logger = @config.logger end def upload(args) - id = args[:id] file = args[:file] - key_folder = args[:name] - key_name = "#{id}.tar.gz" - name = args[:name] + key_name = "#{@id}.tar.gz" bucket_prefix = args[:bucket_prefix] public_readable = args[:public_readable] @config.regions.each do |region| bucket = "#{bucket_prefix}-#{region}" @@ -23,15 +22,16 @@ :logger => @logger, :region => region s3_uploader.upload_file :bucket => bucket, :file => file, - :id => id, - :key_folder => key_folder, + :id => @id, + :key_folder => @name, :key_name => key_name, - :name => name, + :name => @name, :public_readable => public_readable end + @logger.info "Upload complete." end end end