paperclipdropbox 1.0.6 → 1.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/lib/paperclipdropbox/railtie.rb +0 -1
- data/lib/paperclipdropbox/version.rb +1 -1
- data/lib/tasks/paperclipdropbox.rake +28 -19
- metadata +2 -2
@@ -9,46 +9,55 @@ namespace :paperclipdropbox do
|
|
9
9
|
|
10
10
|
SESSION_FILE = "#{Rails.root}/config/dropboxsession.yml"
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
puts ""
|
13
|
+
puts ""
|
14
|
+
puts ""
|
15
|
+
|
16
|
+
@dropboxsession = Paperclip::Storage::Dropboxstorage.dropbox_session
|
17
|
+
|
18
|
+
if @dropboxsession.blank?
|
19
|
+
if File.exists?("#{Rails.root}/config/paperclipdropbox.yml")
|
20
|
+
@options = (YAML.load_file("#{Rails.root}/config/paperclipdropbox.yml")[Rails.env].symbolize_keys)
|
21
|
+
end
|
22
|
+
|
21
23
|
@dropbox_key = @options.blank? ? '8ti7qntpcysl91j' : @options[:dropbox_key]
|
22
24
|
@dropbox_secret = @options.blank? ? 'i0tshr4cpd1pa4e' : @options[:dropbox_secret]
|
23
25
|
|
24
26
|
@dropboxsession = Dropbox::Session.new(@dropbox_key, @dropbox_secret)
|
25
27
|
@dropboxsession.mode = :dropbox
|
26
28
|
|
27
|
-
|
29
|
+
puts "Visit #{@dropboxsession.authorize_url} to log in to Dropbox. Hit enter when you have done this."
|
28
30
|
|
29
|
-
|
31
|
+
STDIN.gets
|
30
32
|
|
31
33
|
end
|
32
34
|
|
33
35
|
begin
|
34
36
|
@dropboxsession.authorize
|
35
|
-
|
37
|
+
puts ""
|
36
38
|
puts "Authorized - #{@dropboxsession.authorized?}"
|
37
39
|
rescue
|
38
40
|
begin
|
39
|
-
|
40
|
-
puts "
|
41
|
-
|
41
|
+
puts ""
|
42
|
+
puts "Visit #{@dropboxsession.authorize_url} to log in to Dropbox. Hit enter when you have done this."
|
43
|
+
|
44
|
+
STDIN.gets
|
45
|
+
@dropboxsession.authorize
|
46
|
+
puts ""
|
47
|
+
puts "Authorized - #{@dropboxsession.authorized?}"
|
42
48
|
rescue
|
43
|
-
|
44
|
-
puts "Already Authorized - #{@dropboxsession.authorized?}"
|
49
|
+
puts ""
|
50
|
+
puts "Already Authorized - #{@dropboxsession.authorized?}" unless @dropboxsession.blank?
|
51
|
+
puts "Failed Authorization. Please try delete /config/dropboxsession.yml and try again." if @dropboxsession.blank?
|
45
52
|
end
|
46
53
|
end
|
47
54
|
|
48
55
|
puts ""
|
49
56
|
puts ""
|
50
|
-
|
51
|
-
|
57
|
+
unless @dropboxsession.blank?
|
58
|
+
File.open(SESSION_FILE, "w") do |f|
|
59
|
+
f.puts @dropboxsession.serialize
|
60
|
+
end
|
52
61
|
end
|
53
62
|
end
|
54
63
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: paperclipdropbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Paul Ketelle
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2012-01-09 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: paperclip
|