carrierwave-dropbox 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile +0 -2
- data/README.md +1 -1
- data/carrierwave-dropbox.gemspec +1 -1
- data/lib/carrierwave/dropbox/version.rb +1 -1
- data/lib/carrierwave/storage/dropbox.rb +5 -12
- data/spec/spec_helper.rb +2 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0763586e9d58c582df0487f3046d125dc12e006
|
4
|
+
data.tar.gz: 35f64d9d57608842700f94ecda9f6441f9e344f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef093d3338a4cbe370e6d07948c29936894a04aef7e5f4cd932fd40e128a95118dbe56d790adce00ac650482c3a5617e901ddf58fa1784371c33ba6475b659ce
|
7
|
+
data.tar.gz: 4c2e198bcabed3e665594f4f42c6d3ba4227a184e68e9c5337227b7d3e3e9a10c487a9b17be3adcf4226881bd6a4a433b4bb77555c0c766210fef38483d715b3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.2.0 (January 12, 2014)
|
4
|
+
|
5
|
+
* Make the `dropbox_client` method public
|
6
|
+
|
7
|
+
You can now easily access to the `dropbox_client` method to get
|
8
|
+
information about the current connection or check if the latter is
|
9
|
+
active or not.
|
10
|
+
|
11
|
+
* Use the root path instead of the `Public` directory by default
|
12
|
+
|
3
13
|
## 1.1.1 (October 5, 2013)
|
4
14
|
|
5
15
|
* Fix deletion when using app_folder accounts
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,7 @@ If you are using Rails, the Rake task is automatically loaded. Otherwise, if you
|
|
24
24
|
aren't running a Rails application, first load the task in your `Rakefile`:
|
25
25
|
|
26
26
|
~~~ruby
|
27
|
-
load "carrierwave/dropbox/
|
27
|
+
load "carrierwave/dropbox/authorize.rake"
|
28
28
|
~~~
|
29
29
|
|
30
30
|
Then you have to run this task:
|
data/carrierwave-dropbox.gemspec
CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency "rspec", "~> 2.14"
|
28
28
|
spec.add_development_dependency "sqlite3"
|
29
29
|
spec.add_development_dependency "mini_magick"
|
30
|
-
spec.add_development_dependency "
|
30
|
+
spec.add_development_dependency "capybara-webkit", "~> 1.0"
|
31
31
|
spec.add_development_dependency "rails", ">= 3.2.14", "< 5.0"
|
32
32
|
end
|
@@ -10,9 +10,7 @@ module CarrierWave
|
|
10
10
|
|
11
11
|
# Store a single file
|
12
12
|
def store!(file)
|
13
|
-
location = uploader.store_path
|
14
|
-
location = "/Public/#{location}" if config[:access_type] == "dropbox"
|
15
|
-
|
13
|
+
location = (config[:access_type] == "dropbox") ? "/#{location}" : uploader.store_path
|
16
14
|
dropbox_client.put_file(location, file.to_file)
|
17
15
|
end
|
18
16
|
|
@@ -21,8 +19,6 @@ module CarrierWave
|
|
21
19
|
CarrierWave::Storage::Dropbox::File.new(uploader, config, uploader.store_path(file), dropbox_client)
|
22
20
|
end
|
23
21
|
|
24
|
-
private
|
25
|
-
|
26
22
|
def dropbox_client
|
27
23
|
@dropbox_client ||= begin
|
28
24
|
session = DropboxSession.new(config[:app_key], config[:app_secret])
|
@@ -31,6 +27,8 @@ module CarrierWave
|
|
31
27
|
end
|
32
28
|
end
|
33
29
|
|
30
|
+
private
|
31
|
+
|
34
32
|
def config
|
35
33
|
@config ||= {}
|
36
34
|
|
@@ -53,17 +51,12 @@ module CarrierWave
|
|
53
51
|
end
|
54
52
|
|
55
53
|
def url
|
56
|
-
|
57
|
-
if @config[:access_type] == "dropbox"
|
58
|
-
"https://dl.dropboxusercontent.com/u/#{user_id}/#{path}"
|
59
|
-
else
|
60
|
-
@client.media(path)["url"]
|
61
|
-
end
|
54
|
+
@client.media(@path)["url"]
|
62
55
|
end
|
63
56
|
|
64
57
|
def delete
|
65
58
|
path = @path
|
66
|
-
path = "
|
59
|
+
path = "/#{path}" if @config[:access_type] == "dropbox"
|
67
60
|
begin
|
68
61
|
@client.file_delete(path)
|
69
62
|
rescue DropboxError
|
data/spec/spec_helper.rb
CHANGED
@@ -6,10 +6,11 @@ require 'dummy/config/environment'
|
|
6
6
|
require 'carrierwave'
|
7
7
|
require 'carrierwave/dropbox'
|
8
8
|
|
9
|
+
require 'capybara-webkit'
|
9
10
|
require 'capybara/rspec'
|
10
11
|
|
11
12
|
RSpec.configure do |config|
|
12
13
|
Capybara.app = Dummy::Application
|
13
|
-
Capybara.current_driver = :
|
14
|
+
Capybara.current_driver = :webkit
|
14
15
|
config.order = 'random'
|
15
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-dropbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Dupret
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -123,19 +123,19 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: capybara-webkit
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ~>
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '1.0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ~>
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '1.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rails
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
250
|
version: '0'
|
251
251
|
requirements: []
|
252
252
|
rubyforge_project:
|
253
|
-
rubygems_version: 2.
|
253
|
+
rubygems_version: 2.2.1
|
254
254
|
signing_key:
|
255
255
|
specification_version: 4
|
256
256
|
summary: Dropbox integration for CarrierWave
|