cognac 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d3bd3977561fc9485489780f4bf6005edfb8993
4
- data.tar.gz: 1fbfa74e3a3c4e1ebfebcb61855ab6100c052359
3
+ metadata.gz: 919761511baee7130f501a32e61618926799b652
4
+ data.tar.gz: 44fbca19631cea02f42324770ea4f60bbfdbce18
5
5
  SHA512:
6
- metadata.gz: d89841d71f41b1a2fa70276e605b380b13674037478e000cf20041960dbcdb1f2572030b834ad92cd62f835242f15d465a2d44a6113ce8569b19996c7eed3ed2
7
- data.tar.gz: 487649b302363d85348098805a0b4dc212db0ac26433ccac049e748e507d50ff14a8c3ceb8e190f55994a27e741d0e3468d5f6aa0abbd3951cb4d9b08fb8c4d0
6
+ metadata.gz: 1481ceb5cc53846f9db92cbc24a0bf5b3784b09a4c992e815b2d22a7f39bfeadc37119d8141c576e27ab7d67ef7c6b9d149bc063644e2c928ccc7a5cd01ddb3c
7
+ data.tar.gz: e7b2d39d146e3955effedecd3bc04a24bf413ddbc995e60a0227f63e632336bf5398942aae716340c4138b1a08b566dc24c447babcf1430143c848e115d48760
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Cognac
2
2
 
3
- This is a lightweight gem for implementing Amazon S3 upload using CORS support. The dependencies are kept to a minimum for easier maintenance. To experiment with this code, run `bin/console` for an interactive prompt.
3
+ This is a lightweight gem for implementing Amazon S3 upload using CORS support. The dependencies are kept to a minimum for easier maintenance.
4
+
5
+ This gem builds the AWS authentication signature as described in http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html. It requires the Amazon keys, as well as options about the request (request type, resource, etc).
6
+
7
+ To experiment with this code, run `bin/console` for an interactive prompt.
4
8
 
5
9
  ## Installation
6
10
 
@@ -30,11 +34,13 @@ You can use this gem in your Rails controller like this:
30
34
  ```ruby
31
35
  def generate_signed_s3_url
32
36
  # To avoid file collision, we prepend string to the file_name
33
- file_name = Cognac::CloudFile.generate(params[:file_name])
37
+ file_name = Cognac::CloudFile.generate(params[:filename])
34
38
  resource_end_point = Cognac::CloudFile.resource_end_point(ENV["AWS_S3_BUCKET"], file_name)
39
+
35
40
  options = Cognac::Signature.generate_options_for_build_s3_upload_url(ENV["AWS_S3_BUCKET"], file_name, params[:content_type])
36
- url = AwsHelper.build_s3_upload_url(resource_endpoint, ENV["AWS_ACCESS_KEY_ID"], ENV["AWS_SECRET_ACCESS_KEY"], options)
37
- render :json => {:put_url => url, :file_url => resource_endpoint}
41
+ url = Cognac::Signature.build_s3_upload_url(resource_end_point, ENV["AWS_ACCESS_KEY_ID"], ENV["AWS_SECRET_ACCESS_KEY"], options)
42
+
43
+ render :json => {:put_url => url, :file_url => resource_end_point}
38
44
  end
39
45
  ```
40
46
 
data/cognac.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["bparanj@gmail.com"]
11
11
 
12
12
  spec.summary = %q{A simple library to implement Amazon S3 upload using CORS.}
13
+ spec.description = %q{This gem builds the AWS authentication signature as described in http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html. It requires the Amazon keys, as well as options about the request (request type, resource, etc).}
13
14
  spec.homepage = "http://www.rubyplus.com"
14
15
  spec.license = "MIT"
15
16
 
@@ -1,3 +1,3 @@
1
1
  module Cognac
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cognac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bala Paranj
@@ -66,7 +66,9 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5.7'
69
- description:
69
+ description: This gem builds the AWS authentication signature as described in http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html.
70
+ It requires the Amazon keys, as well as options about the request (request type,
71
+ resource, etc).
70
72
  email:
71
73
  - bparanj@gmail.com
72
74
  executables: []