paperclip-dropbox 1.1.5 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8cf29eabf601c976450ee9451a7f1507f7438b39
4
+ data.tar.gz: 1610e7c1b1c31e084d9a19b1589ebfa9ff1474c3
5
+ SHA512:
6
+ metadata.gz: 8e97054c8acd45b12b43f8931e465fa089e6b24e1635655e03fd92a9bcea89a022d4c837a1f81bfb8a67807bec3ffbb79c1615b4ec613fbf1b1eadbf2b60608b
7
+ data.tar.gz: 80b71d4f7ea9ee4e348779e26fcd8d12bbe29797a20501da786d7d5a779683ee38b5f2e851dfaf3dcb076344cd30c3dfffee00df9a41a112743cbe5888176847
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Dropbox
1
+ # Paperclip Dropbox
2
2
 
3
3
  This gem extends [Paperclip](https://github.com/thoughtbot/paperclip) with
4
4
  [Dropbox](https://www.dropbox.com) storage.
@@ -124,7 +124,8 @@ user.avatar.url(:download => true)
124
124
 
125
125
  ### Check if the file exists
126
126
 
127
- You can easily check if the file exists on Dropbox:
127
+ It may happen that a file on Dropbox gets deleted remotely. To check this in
128
+ your application, you can use the `#exists?` method:
128
129
 
129
130
  ```ruby
130
131
  user.avatar.exists?
@@ -33,6 +33,8 @@ module Paperclip
33
33
  @credentials.stringify_keys!
34
34
  @credentials = @credentials[namespace.to_s] || @credentials
35
35
  @credentials.symbolize_keys!
36
+
37
+ @credentials
36
38
  end
37
39
 
38
40
  def validate!
@@ -48,7 +48,7 @@ module Paperclip
48
48
  return @attachment_options[:dropbox_options][:path] if @attachment_options[:dropbox_options][:path]
49
49
 
50
50
  if @attachment_options[:dropbox_options][:unique_filename]
51
- eval %(proc { |style| "\#{self.class.model_name.underscore}_\#{id}_\#{#{@attachment.name}.name}" })
51
+ eval %(proc { |style| "\#{ActiveModel::Naming.param_key(self.class)}_\#{id}_\#{#{@attachment.name}.name}" })
52
52
  else
53
53
  eval %(proc { |style| #{@attachment.name}.original_filename })
54
54
  end
@@ -49,6 +49,7 @@ module Paperclip
49
49
  end
50
50
 
51
51
  def exists?(style = default_style)
52
+ return false if not present?
52
53
  metadata = dropbox_client.metadata(path(style))
53
54
  not metadata.nil? and not metadata["is_deleted"]
54
55
  rescue DropboxError
@@ -57,10 +58,11 @@ module Paperclip
57
58
 
58
59
  def dropbox_client
59
60
  @dropbox_client ||= begin
61
+ @options[:dropbox_credentials][:access_type] ||= "dropbox"
60
62
  credentials = @options[:dropbox_credentials]
61
63
  session = DropboxSession.new(credentials[:app_key], credentials[:app_secret])
62
64
  session.set_access_token(credentials[:access_token], credentials[:access_token_secret])
63
- DropboxClient.new(session, credentials[:access_type] || "dropbox")
65
+ DropboxClient.new(session, credentials[:access_type])
64
66
  end
65
67
  end
66
68
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "paperclip-dropbox"
5
- gem.version = "1.1.5"
5
+ gem.version = "1.1.7"
6
6
 
7
7
  gem.homepage = "https://github.com/janko-m/paperclip-dropbox"
8
8
  gem.description = %q{Extends Paperclip with Dropbox storage.}
@@ -22,9 +22,8 @@ Gem::Specification.new do |gem|
22
22
 
23
23
  gem.add_development_dependency "rake"
24
24
  gem.add_development_dependency "rspec", "~> 2.11"
25
- gem.add_development_dependency "vcr", "~> 2.2"
25
+ gem.add_development_dependency "vcr", ">= 2.6"
26
26
  gem.add_development_dependency "webmock", ">= 1.8", "< 1.10"
27
27
  gem.add_development_dependency "activerecord", ">= 3.2"
28
- gem.add_development_dependency "activerecord-nulldb-adapter", ">= 0.2.3"
29
28
  gem.add_development_dependency "rest-client", ">= 1.6"
30
29
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-dropbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
5
- prerelease:
4
+ version: 1.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Janko Marohnić
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-21 00:00:00.000000000 Z
11
+ date: 2013-10-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: paperclip
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: dropbox-sdk
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,23 +41,20 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,25 +69,22 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: vcr
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
- version: '2.2'
75
+ version: '2.6'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
- version: '2.2'
82
+ version: '2.6'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: webmock
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '1.8'
102
90
  - - <
@@ -105,9 +93,8 @@ dependencies:
105
93
  type: :development
106
94
  prerelease: false
107
95
  version_requirements: !ruby/object:Gem::Requirement
108
- none: false
109
96
  requirements:
110
- - - ! '>='
97
+ - - '>='
111
98
  - !ruby/object:Gem::Version
112
99
  version: '1.8'
113
100
  - - <
@@ -116,49 +103,29 @@ dependencies:
116
103
  - !ruby/object:Gem::Dependency
117
104
  name: activerecord
118
105
  requirement: !ruby/object:Gem::Requirement
119
- none: false
120
106
  requirements:
121
- - - ! '>='
107
+ - - '>='
122
108
  - !ruby/object:Gem::Version
123
109
  version: '3.2'
124
110
  type: :development
125
111
  prerelease: false
126
112
  version_requirements: !ruby/object:Gem::Requirement
127
- none: false
128
113
  requirements:
129
- - - ! '>='
114
+ - - '>='
130
115
  - !ruby/object:Gem::Version
131
116
  version: '3.2'
132
- - !ruby/object:Gem::Dependency
133
- name: activerecord-nulldb-adapter
134
- requirement: !ruby/object:Gem::Requirement
135
- none: false
136
- requirements:
137
- - - ! '>='
138
- - !ruby/object:Gem::Version
139
- version: 0.2.3
140
- type: :development
141
- prerelease: false
142
- version_requirements: !ruby/object:Gem::Requirement
143
- none: false
144
- requirements:
145
- - - ! '>='
146
- - !ruby/object:Gem::Version
147
- version: 0.2.3
148
117
  - !ruby/object:Gem::Dependency
149
118
  name: rest-client
150
119
  requirement: !ruby/object:Gem::Requirement
151
- none: false
152
120
  requirements:
153
- - - ! '>='
121
+ - - '>='
154
122
  - !ruby/object:Gem::Version
155
123
  version: '1.6'
156
124
  type: :development
157
125
  prerelease: false
158
126
  version_requirements: !ruby/object:Gem::Requirement
159
- none: false
160
127
  requirements:
161
- - - ! '>='
128
+ - - '>='
162
129
  - !ruby/object:Gem::Version
163
130
  version: '1.6'
164
131
  description: Extends Paperclip with Dropbox storage.
@@ -168,44 +135,40 @@ executables: []
168
135
  extensions: []
169
136
  extra_rdoc_files: []
170
137
  files:
171
- - lib/paperclip-dropbox.rb
172
- - lib/paperclip/storage/dropbox.rb
173
- - lib/paperclip/storage/dropbox/path_generator.rb
174
- - lib/paperclip/storage/dropbox/url_generator.rb
175
- - lib/paperclip/storage/dropbox/credentials.rb
176
- - lib/paperclip/dropbox.rb
177
138
  - lib/paperclip/dropbox/railtie.rb
178
139
  - lib/paperclip/dropbox/rake.rb
179
140
  - lib/paperclip/dropbox/tasks.rake
141
+ - lib/paperclip/dropbox.rb
142
+ - lib/paperclip/storage/dropbox/credentials.rb
143
+ - lib/paperclip/storage/dropbox/path_generator.rb
144
+ - lib/paperclip/storage/dropbox/url_generator.rb
145
+ - lib/paperclip/storage/dropbox.rb
146
+ - lib/paperclip-dropbox.rb
180
147
  - README.md
181
148
  - LICENSE
182
149
  - paperclip-dropbox.gemspec
183
150
  homepage: https://github.com/janko-m/paperclip-dropbox
184
151
  licenses:
185
152
  - MIT
153
+ metadata: {}
186
154
  post_install_message:
187
155
  rdoc_options: []
188
156
  require_paths:
189
157
  - lib
190
158
  required_ruby_version: !ruby/object:Gem::Requirement
191
- none: false
192
159
  requirements:
193
- - - ! '>='
160
+ - - '>='
194
161
  - !ruby/object:Gem::Version
195
162
  version: 1.9.2
196
163
  required_rubygems_version: !ruby/object:Gem::Requirement
197
- none: false
198
164
  requirements:
199
- - - ! '>='
165
+ - - '>='
200
166
  - !ruby/object:Gem::Version
201
167
  version: '0'
202
- segments:
203
- - 0
204
- hash: 129369807
205
168
  requirements: []
206
169
  rubyforge_project:
207
- rubygems_version: 1.8.23
170
+ rubygems_version: 2.0.3
208
171
  signing_key:
209
- specification_version: 3
172
+ specification_version: 4
210
173
  summary: Extends Paperclip with Dropbox storage.
211
174
  test_files: []