paperclipdropbox 0.0.4 → 0.0.5

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.
@@ -1,3 +1,3 @@
1
1
  module Paperclipdropbox
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -60,24 +60,30 @@ module Paperclip
60
60
  unless Rails.cache.exist?('DropboxSession:uid')
61
61
  log("get Dropbox Session User_id")
62
62
  Rails.cache.write('DropboxSession:uid', dropbox_session.account.uid)
63
+ dropbox_session.account.uid
64
+ else
65
+ log("read Dropbox User_id")
66
+ Rails.cache.read('DropboxSession:uid')
63
67
  end
64
- log("read Dropbox User_id")
65
- Rails.cache.read('DropboxSession:uid')
66
68
  end
67
69
 
68
70
  private
69
71
  def dropbox_session
70
72
  unless Rails.cache.exist?('DropboxSession')
71
- log("create new Dropbox Session")
72
- dropboxsession = Dropbox::Session.new(@dropbox_key, @dropbox_secret)
73
- dropboxsession.mode = :dropbox
74
- dropboxsession.authorizing_user = @dropbox_user
75
- dropboxsession.authorizing_password = @dropbox_password
76
- dropboxsession.authorize!
77
- Rails.cache.write('DropboxSession', dropboxsession)
73
+ if @dropboxsession.blank?
74
+ log("create new Dropbox Session")
75
+ @dropboxsession = Dropbox::Session.new(@dropbox_key, @dropbox_secret)
76
+ @dropboxsession.mode = :dropbox
77
+ @dropboxsession.authorizing_user = @dropbox_user
78
+ @dropboxsession.authorizing_password = @dropbox_password
79
+ @dropboxsession.authorize!
80
+ Rails.cache.write('DropboxSession', dropboxsession)
81
+ end
82
+ @dropboxsession
83
+ else
84
+ log("reading Dropbox Session")
85
+ Rails.cache.read('DropboxSession')
78
86
  end
79
- log("reading Dropbox Session")
80
- Rails.cache.read('DropboxSession')
81
87
  end
82
88
  end
83
89
  end
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
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-29 00:00:00.000000000Z
12
+ date: 2011-07-04 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: paperclip
16
- requirement: &9547344 !ruby/object:Gem::Requirement
16
+ requirement: &9524100 !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: *9547344
24
+ version_requirements: *9524100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: dropbox
27
- requirement: &9547032 !ruby/object:Gem::Requirement
27
+ requirement: &9523836 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *9547032
35
+ version_requirements: *9523836
36
36
  description: Dropbox storage support for paperclip file attachment
37
37
  email:
38
38
  - paul@ketelle.com