Class: S3::Client
- Inherits:
-
Object
- Object
- S3::Client
- Defined in:
- lib/ios3/s3.rb
Instance Method Summary collapse
-
#initialize(access_key_id, secret_access_key, region) ⇒ Client
constructor
A new instance of Client.
- #upload_build(ipa, options) ⇒ Object
Constructor Details
#initialize(access_key_id, secret_access_key, region) ⇒ Client
Returns a new instance of Client.
30 31 32 33 34 35 36 |
# File 'lib/ios3/s3.rb', line 30 def initialize(access_key_id, secret_access_key, region) # credentials = Aws.Credentials.new(access_key_id, secret_access_key) # @s3 = Aws::S3::Client.new(credentials: credentials, region: region) @s3 = Aws::S3::Client.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key, :region => region) end |
Instance Method Details
#upload_build(ipa, options) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ios3/s3.rb', line 38 def upload_build(ipa, ) path = [:path] files = [] files << ipa # files << options[:dsym] if options[:dsym] files.each do |file| basename = File.basename(file) key = path ? File.join(path, basename) : basename File.open(file) do |descriptor| params = {body: descriptor, bucket: [:bucket], key: key, acl: [:acl]} response = @s3.put_object(params) upload_manifest() end end end |