send_s3_file 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f9a615259eec334e112b3671d8c5a91bc819b78
4
- data.tar.gz: c0bf9e26a89970952439d0b0df4f1c7da7ab7ead
3
+ metadata.gz: 325cd0dca93a09982d185f00716c72b18d8ff7e4
4
+ data.tar.gz: 255994aa5d9ff702b490648b55e415e1f43e7187
5
5
  SHA512:
6
- metadata.gz: b2a4374372682b1b7ef242cf1a5a0389709c5793060ac505f42db4be35846dd181dd985d0d0d2227b86279c4b6572e0c83e8cc611d4c8d346f210ffa9271f346
7
- data.tar.gz: 279dcad78c7e1c7040d892478349faefe56014afb4bee437c249540bba160c77e505b1089372e725cbd4a27926f991cf27fec4da32bad33b6eabd8a7b2d1831b
6
+ metadata.gz: 1ccb13ba146f764a88c9303bc58670dac167fe3466ef0907210f4ee7575176bcbb40ece2ced9f30cd5ba2e093672b1034370123da1ef9c81935cf6d0895bba61
7
+ data.tar.gz: 620111fec29c11f841b81464619b9814e55ddc986f31d7db656de89b83b7ef502440590907c7f57ea2af291293c92c260422647c19579ade7f55e0d19d70df8d
@@ -1,3 +1,3 @@
1
1
  module SendS3File
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/send_s3_file.rb CHANGED
@@ -6,9 +6,7 @@ require "action_controller"
6
6
 
7
7
 
8
8
  module SendS3File
9
- def send_s3_file file_name, bucket, options = {}
10
- s3 = AWS::S3.new
11
- object = s3.buckets[bucket].objects[file_name]
9
+ def send_s3_file s3_object, options = {}
12
10
  headers.merge!(
13
11
  'Content-Type' => build_content_type(options),
14
12
  'Content-Disposition' => build_disposition(options),
@@ -16,11 +14,11 @@ module SendS3File
16
14
  )
17
15
 
18
16
  render :status => options[:status], :text => Proc.new {|response, output|
19
- logger.info "Streaming file from s3 #{bucket} #{file_name}" unless logger.nil?
20
- object.read do |chunk|
17
+ logger.info "Streaming file from s3 #{s3_object.bucket} #{s3_object.key}" unless logger.nil?
18
+ s3_object.read do |chunk|
21
19
  output.write(chunk)
22
20
  end
23
- logger.info "Done Streaming file from s3 #{bucket} #{file_name}" unless logger.nil?
21
+ logger.info "Done Streaming file from s3 #{s3_object.bucket} #{s3_object.key}" unless logger.nil?
24
22
  }
25
23
  end
26
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: send_s3_file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jatin Naik