lib/heirloom/artifact/artifact_reader.rb in heirloom-0.1.2 vs lib/heirloom/artifact/artifact_reader.rb in heirloom-0.1.3

- old
+ new

@@ -15,9 +15,29 @@ def exists?(args) show(args) != nil end + def get_bucket(args) + artifact = show :name => args[:name], + :id => args[:id] + + url = artifact["#{args[:region]}-s3-url"].first + + bucket = url.gsub('s3://', '').split('/').first + end + + def get_key(args) + artifact = show :name => args[:name], + :id => args[:id] + + url = artifact["#{args[:region]}-s3-url"].first + + bucket = url.gsub('s3://', '').gsub(get_bucket(args), '') + bucket.slice!(0) + bucket + end + private def sdb @sdb ||= AWS::SimpleDB.new :config => @config end