paperclipdropbox 0.0.6 → 0.0.7
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.rdoc +7 -7
- data/lib/paperclipdropbox/version.rb +1 -1
- data/lib/paperclipdropbox.rb +1 -0
- data/lib/tasks/paperclipdropbox.rake +45 -0
- data/paperclipdropbox.gemspec +1 -0
- metadata +17 -5
data/README.rdoc
CHANGED
@@ -12,7 +12,7 @@ You can let bundler install Paperclip Dropbox Plugin by adding this line to your
|
|
12
12
|
|
13
13
|
And then execute:
|
14
14
|
|
15
|
-
bundle install
|
15
|
+
bundle install
|
16
16
|
|
17
17
|
Or install it yourself as:
|
18
18
|
|
@@ -20,8 +20,8 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
Then run the authotization rake task
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
rake paperclipdropbox:authorize
|
24
|
+
|
25
25
|
you'll then be given a url to login to dropbox to authorize this plugin access to your dropbox account.
|
26
26
|
Then once logged in run the rake task again.
|
27
27
|
|
@@ -32,10 +32,10 @@ Create the file config/paperclipdropbox.yml:
|
|
32
32
|
development:
|
33
33
|
dropbox_user: user_email
|
34
34
|
dropbox_password: user_password
|
35
|
-
|
35
|
+
|
36
36
|
test:
|
37
37
|
...
|
38
|
-
|
38
|
+
|
39
39
|
production:
|
40
40
|
...
|
41
41
|
|
@@ -47,6 +47,6 @@ In your model:
|
|
47
47
|
:storage => :Dropboxstorage,
|
48
48
|
:path => "/:attachment/:attachment/:id/:style/:filename"
|
49
49
|
end
|
50
|
-
|
51
|
-
|
50
|
+
|
51
|
+
|
52
52
|
You can add the path option to the config/paperclipdropbox.yml file for ease of use.
|
data/lib/paperclipdropbox.rb
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
require "yaml"
|
2
|
+
require "dropbox"
|
3
|
+
|
4
|
+
namespace :paperclipdropbox do
|
5
|
+
|
6
|
+
|
7
|
+
desc "Get User Authorise URL"
|
8
|
+
task :authorize => :environment do
|
9
|
+
|
10
|
+
SESSION_FILE = "#{Rails.root}/config/dropboxsession.yml"
|
11
|
+
|
12
|
+
if File.exists?(SESSION_FILE)
|
13
|
+
@dropboxsession = Dropbox::Session.deserialize(File.read(SESSION_FILE))
|
14
|
+
else
|
15
|
+
@options = (YAML.load_file("#{Rails.root}/config/paperclipdropbox.yml")[Rails.env].symbolize_keys)
|
16
|
+
|
17
|
+
@dropbox_user = @options[:dropbox_user]
|
18
|
+
@dropbox_password = @options[:dropbox_password]
|
19
|
+
@dropbox_key = '8ti7qntpcysl91j'
|
20
|
+
@dropbox_secret = 'i0tshr4cpd1pa4e'
|
21
|
+
|
22
|
+
@dropboxsession = Dropbox::Session.new(@dropbox_key, @dropbox_secret)
|
23
|
+
@dropboxsession.mode = :dropbox
|
24
|
+
@dropboxsession.authorizing_user = @dropbox_user
|
25
|
+
@dropboxsession.authorizing_password = @dropbox_password
|
26
|
+
end
|
27
|
+
begin
|
28
|
+
@dropboxsession.authorize!
|
29
|
+
|
30
|
+
puts "Authorized - #{@dropboxsession.authorized?}"
|
31
|
+
rescue
|
32
|
+
begin
|
33
|
+
puts "Please login to dropbox using this link : #{@dropboxsession.authorize_url}"
|
34
|
+
puts "then run this rake task again."
|
35
|
+
rescue
|
36
|
+
puts "Already Authorized - #{@dropboxsession.authorized?}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
File.open(SESSION_FILE, "w") do |f|
|
41
|
+
f.puts @dropboxsession.serialize
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
data/paperclipdropbox.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclipdropbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-07-18 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paperclip
|
16
|
-
requirement: &
|
16
|
+
requirement: &8222736 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *8222736
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: dropbox
|
27
|
-
requirement: &
|
27
|
+
requirement: &8222448 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,18 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *8222448
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: yaml
|
38
|
+
requirement: &8222148 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *8222148
|
36
47
|
description: Dropbox storage support for paperclip file attachment
|
37
48
|
email:
|
38
49
|
- paul@ketelle.com
|
@@ -46,6 +57,7 @@ files:
|
|
46
57
|
- Rakefile
|
47
58
|
- lib/paperclipdropbox.rb
|
48
59
|
- lib/paperclipdropbox/version.rb
|
60
|
+
- lib/tasks/paperclipdropbox.rake
|
49
61
|
- paperclipdropbox.gemspec
|
50
62
|
homepage: https://github.com/dripster82/paperclipdropbox
|
51
63
|
licenses: []
|