paperclip-azure 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -0
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/paperclip-azure.gemspec +5 -5
- metadata +5 -4
- data/README.rdoc +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b81f27902f4dd3e53c6cf261424f669ef9e12691
|
4
|
+
data.tar.gz: ea0e4b80cd819d7aa37c7055e69489628e9f8361
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24b0de19b078bb55685eed33a07e7e8633d380e3a904c53e3f8b14480085c684f474216400a98c81c327011f4ff6f06c65768e3b7f103da7d4137a088bd2d389
|
7
|
+
data.tar.gz: 2fd2fca79cdaf86e804d9a4f270c32c73701e89dc65ff1c771185a02cfceee2ff4d1b6fa3e6e368873c4a9983b889a01ebb07d9937d95fa4d235e4067384ea16
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# paperclip-azure
|
2
|
+
|
3
|
+
Paperclip-Azure is a [Paperclip](https://github.com/thoughtbot/paperclip) storage driver for storing files in a Microsoft Azure Blob.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile after the Paperclip gem:
|
8
|
+
|
9
|
+
gem 'paperclip-optimizer'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
The Azure storage engine has been developed to work as similarly to S3 storage configuration as is possible. This gem can be configured in a Paperclip initializer as follows:
|
18
|
+
|
19
|
+
Paperclip::Attachment.default_options[:storage] = :azure
|
20
|
+
Paperclip::Attachment.default_options[:url] = ':azure_path_url'
|
21
|
+
Paperclip::Attachment.default_options[:path] = ":class/:attachment/:id/:style/:filename"
|
22
|
+
Paperclip::Attachment.default_options[:storage] = :azure
|
23
|
+
Paperclip::Attachment.default_options[:azure_credentials] = {
|
24
|
+
storage_account_name: ENV['AZURE_STORAGE_ACCOUNT'],
|
25
|
+
access_key: ENV['AZURE_ACCESS_KEY'],
|
26
|
+
container: ENV['AZURE_CONTAINER_NAME']
|
27
|
+
}
|
28
|
+
|
29
|
+
Or, at the level of the model such as in the following example:
|
30
|
+
|
31
|
+
has_attached_file :download,
|
32
|
+
storage: :azure,
|
33
|
+
azure_credentials: {
|
34
|
+
storage_account_name: ENV['AZURE_STORAGE_ACCOUNT'],
|
35
|
+
access_key: ENV['AZURE_ACCESS_KEY'],
|
36
|
+
container: ENV['AZURE_CONTAINER_NAME']
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
## Private Blob Access
|
41
|
+
|
42
|
+
In the even that are using a Blob that has been configured for Private access, you will need to use the Shared Access Signature functionality of Azure. This functionality has been baked in to the `Attachment#expiring_url` method. Simply specify a time and a style and you will get a proper URL as follows:
|
43
|
+
|
44
|
+
object.attachment.expiring_url(30.minutes.since, :thumb)
|
45
|
+
|
46
|
+
For more information about Azure Shared Access Signatures, please refer to [here](http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/).
|
47
|
+
|
48
|
+
## Contributing to paperclip-azure
|
49
|
+
|
50
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
51
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
52
|
+
* Fork the project.
|
53
|
+
* Start a feature/bugfix branch.
|
54
|
+
* Commit and push until you are happy with your contribution.
|
55
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
56
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
57
|
+
* Submit a pull request for the finished product's integration.
|
58
|
+
|
59
|
+
## Copyright
|
60
|
+
|
61
|
+
Copyright (c) 2015 Jordan. See [LICENSE](LICENSE.txt) for
|
62
|
+
further details.
|
63
|
+
|
data/Rakefile
CHANGED
@@ -15,12 +15,12 @@ require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
17
|
gem.name = "paperclip-azure"
|
18
|
-
gem.homepage = "http://github.com/
|
18
|
+
gem.homepage = "http://github.com/supportify/paperclip-azure"
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = %Q{An Azure Blob Storage implementation for Paperclip.}
|
21
21
|
gem.description = %Q{An Azure Blob Storage implementation for Paperclip.}
|
22
22
|
gem.email = "help@supportify.io"
|
23
|
-
gem.authors = ["Jordan Yaker"]
|
23
|
+
gem.authors = ["Jordan Yaker", "Supportify, Inc."]
|
24
24
|
# dependencies defined in Gemfile
|
25
25
|
end
|
26
26
|
Jeweler::RubygemsDotOrgTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/paperclip-azure.gemspec
CHANGED
@@ -5,16 +5,16 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "paperclip-azure"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Jordan Yaker"]
|
11
|
+
s.authors = ["Jordan Yaker", "Supportify, Inc."]
|
12
12
|
s.date = "2015-01-19"
|
13
13
|
s.description = "An Azure Blob Storage implementation for Paperclip."
|
14
14
|
s.email = "help@supportify.io"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
|
-
"README.
|
17
|
+
"README.md"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
"Gemfile",
|
23
23
|
"Gemfile.lock",
|
24
24
|
"LICENSE.txt",
|
25
|
-
"README.
|
25
|
+
"README.md",
|
26
26
|
"Rakefile",
|
27
27
|
"VERSION",
|
28
28
|
"lib/azure/core/auth/shared_access_signature.rb",
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
"paperclip-azure.gemspec",
|
32
32
|
"spec/spec_helper.rb"
|
33
33
|
]
|
34
|
-
s.homepage = "http://github.com/
|
34
|
+
s.homepage = "http://github.com/supportify/paperclip-azure"
|
35
35
|
s.licenses = ["MIT"]
|
36
36
|
s.require_paths = ["lib"]
|
37
37
|
s.rubygems_version = "2.0.6"
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Yaker
|
8
|
+
- Supportify, Inc.
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -142,14 +143,14 @@ executables: []
|
|
142
143
|
extensions: []
|
143
144
|
extra_rdoc_files:
|
144
145
|
- LICENSE.txt
|
145
|
-
- README.
|
146
|
+
- README.md
|
146
147
|
files:
|
147
148
|
- .document
|
148
149
|
- .rspec
|
149
150
|
- Gemfile
|
150
151
|
- Gemfile.lock
|
151
152
|
- LICENSE.txt
|
152
|
-
- README.
|
153
|
+
- README.md
|
153
154
|
- Rakefile
|
154
155
|
- VERSION
|
155
156
|
- lib/azure/core/auth/shared_access_signature.rb
|
@@ -157,7 +158,7 @@ files:
|
|
157
158
|
- lib/paperclip/storage/azure.rb
|
158
159
|
- paperclip-azure.gemspec
|
159
160
|
- spec/spec_helper.rb
|
160
|
-
homepage: http://github.com/
|
161
|
+
homepage: http://github.com/supportify/paperclip-azure
|
161
162
|
licenses:
|
162
163
|
- MIT
|
163
164
|
metadata: {}
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= paperclip-azure
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to paperclip-azure
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
-
* Fork the project.
|
10
|
-
* Start a feature/bugfix branch.
|
11
|
-
* Commit and push until you are happy with your contribution.
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2015 Jordan. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|