paperclip-dropbox 1.1.1 → 1.1.2
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.
- data/README.md +1 -1
- data/lib/paperclip/storage/dropbox.rb +5 -3
- data/paperclip-dropbox.gemspec +1 -1
- metadata +6 -6
data/README.md
CHANGED
@@ -49,7 +49,7 @@ you're storing and how you're exposing it to users.
|
|
49
49
|
After creating your app, it will have an "App key" and "App secret". Provide
|
50
50
|
these and the access type (`dropbox` or `app_folder`) to the authorization Rake task:
|
51
51
|
|
52
|
-
```
|
52
|
+
```sh
|
53
53
|
$ rake dropbox:authorize APP_KEY=your_app_key APP_SECRET=your_app_secret ACCESS_TYPE=your_access_type
|
54
54
|
```
|
55
55
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'dropbox_sdk'
|
2
2
|
require 'active_support/core_ext/hash/keys'
|
3
3
|
require 'active_support/inflector/methods'
|
4
|
+
require 'active_support/core_ext/object/blank'
|
4
5
|
require 'yaml'
|
5
6
|
require 'erb'
|
6
7
|
|
@@ -71,7 +72,7 @@ module Paperclip
|
|
71
72
|
path = instance.instance_exec(style, &file_path)
|
72
73
|
style_suffix = (style != default_style ? "_#{style}" : "")
|
73
74
|
|
74
|
-
if original_extension && path =~ /#{original_extension}$/
|
75
|
+
if original_extension.present? && path =~ /#{original_extension}$/
|
75
76
|
path.sub(original_extension, "#{style_suffix}#{original_extension}")
|
76
77
|
else
|
77
78
|
path + style_suffix + original_extension.to_s
|
@@ -100,7 +101,7 @@ module Paperclip
|
|
100
101
|
private
|
101
102
|
|
102
103
|
def original_extension
|
103
|
-
original_filename
|
104
|
+
File.extname(original_filename)
|
104
105
|
end
|
105
106
|
|
106
107
|
def user_id
|
@@ -123,7 +124,8 @@ module Paperclip
|
|
123
124
|
|
124
125
|
def assert_required_keys
|
125
126
|
[:app_key, :app_secret, :access_token, :access_token_secret, :user_id].each do |key|
|
126
|
-
@dropbox_credentials.fetch(key)
|
127
|
+
value = @dropbox_credentials.fetch(key)
|
128
|
+
raise ":#{key} credential is nil" if value.nil?
|
127
129
|
end
|
128
130
|
if @dropbox_credentials[:access_type] and not ['dropbox', 'app_folder'].include?(@dropbox_credentials[:access_type])
|
129
131
|
raise KeyError, ":access_type must be 'dropbox' or 'app_folder'"
|
data/paperclip-dropbox.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-dropbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paperclip
|
@@ -178,12 +178,12 @@ executables: []
|
|
178
178
|
extensions: []
|
179
179
|
extra_rdoc_files: []
|
180
180
|
files:
|
181
|
+
- lib/paperclip-dropbox.rb
|
182
|
+
- lib/paperclip/storage/dropbox.rb
|
183
|
+
- lib/paperclip/dropbox.rb
|
181
184
|
- lib/paperclip/dropbox/railtie.rb
|
182
185
|
- lib/paperclip/dropbox/rake.rb
|
183
186
|
- lib/paperclip/dropbox/tasks.rake
|
184
|
-
- lib/paperclip/dropbox.rb
|
185
|
-
- lib/paperclip/storage/dropbox.rb
|
186
|
-
- lib/paperclip-dropbox.rb
|
187
187
|
- README.md
|
188
188
|
- LICENSE
|
189
189
|
- paperclip-dropbox.gemspec
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
segments:
|
210
210
|
- 0
|
211
|
-
hash:
|
211
|
+
hash: 569081523
|
212
212
|
requirements: []
|
213
213
|
rubyforge_project:
|
214
214
|
rubygems_version: 1.8.23
|