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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf125a486688f3865f77935c3be9adf0a865dd55
4
- data.tar.gz: 5b0ae6e6ea47bde7f0d9b4cd6d39f385ab9e1530
3
+ metadata.gz: b0763586e9d58c582df0487f3046d125dc12e006
4
+ data.tar.gz: 35f64d9d57608842700f94ecda9f6441f9e344f0
5
5
  SHA512:
6
- metadata.gz: 11aab1f8f4cba4c7b3b4e50e2c1fafcf9a8bcacd78af6668f719794330fad4c668f5b982bf69f0472ed4d8e589c1fb1c27960c007bd877b54c251eace1eeb39e
7
- data.tar.gz: 333ab9b4199c5d6ce7240c0c36657f90c8b0dbcebab9f34192737d37700ad4617ef83a409e72eda9910d5fd3e06ecb616daa439a7f5040316fe0e82c9402c564
6
+ metadata.gz: ef093d3338a4cbe370e6d07948c29936894a04aef7e5f4cd932fd40e128a95118dbe56d790adce00ac650482c3a5617e901ddf58fa1784371c33ba6475b659ce
7
+ data.tar.gz: 4c2e198bcabed3e665594f4f42c6d3ba4227a184e68e9c5337227b7d3e3e9a10c487a9b17be3adcf4226881bd6a4a433b4bb77555c0c766210fef38483d715b3
@@ -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
@@ -2,5 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in carrierwave-dropbox.gemspec
4
4
  gemspec
5
-
6
- gem 'rubyzip', require: 'zip/zip'
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/tasks.rake"
27
+ load "carrierwave/dropbox/authorize.rake"
28
28
  ~~~
29
29
 
30
30
  Then you have to run this task:
@@ -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 "selenium-webdriver", "~> 2.35.1"
30
+ spec.add_development_dependency "capybara-webkit", "~> 1.0"
31
31
  spec.add_development_dependency "rails", ">= 3.2.14", "< 5.0"
32
32
  end
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module Dropbox
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  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
- user_id, path = @config[:user_id], @path
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 = "/Public/#{path}" if @config[:access_type] == "dropbox"
59
+ path = "/#{path}" if @config[:access_type] == "dropbox"
67
60
  begin
68
61
  @client.file_delete(path)
69
62
  rescue DropboxError
@@ -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 = :selenium
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.1.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: 2013-10-05 00:00:00.000000000 Z
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: selenium-webdriver
126
+ name: capybara-webkit
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: 2.35.1
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: 2.35.1
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.0.6
253
+ rubygems_version: 2.2.1
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: Dropbox integration for CarrierWave