mdarby-scribd_fu 1.2.3.1 → 1.2.3.2
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/attachment_fu/methods.rb +4 -4
- data/lib/scribd_fu.rb +2 -2
- data/scribd_fu.gemspec +1 -1
- metadata +1 -1
@@ -52,9 +52,9 @@ module ScribdFu
|
|
52
52
|
def upload_to_scribd
|
53
53
|
if scribdable? and self.scribd_id.blank?
|
54
54
|
with_file_path do |file_path|
|
55
|
-
if resource = scribd_login.upload(:file => "#{file_path}",
|
56
|
-
|
57
|
-
logger.info "[Scribd_fu] #{Time.now.rfc2822}: Object #{id} successfully uploaded for conversion to iPaper"
|
55
|
+
if resource = scribd_login.upload(:file => "#{file_path}",
|
56
|
+
:access => access_level)
|
57
|
+
logger.info "[Scribd_fu] #{Time.now.rfc2822}: Object #{id} successfully uploaded for conversion to iPaper."
|
58
58
|
|
59
59
|
self.scribd_id = resource.doc_id
|
60
60
|
self.scribd_access_key = resource.access_key
|
@@ -108,7 +108,7 @@ module ScribdFu
|
|
108
108
|
def with_file_path(&block) # :yields: full_file_path
|
109
109
|
# TODO We can probably do this using respond_to?
|
110
110
|
if scribd_config['storage'].eql?('s3')
|
111
|
-
yield
|
111
|
+
yield s3_url
|
112
112
|
elsif save_attachment? # file hasn't been saved, use the temp file
|
113
113
|
temp_rename = File.join(Dir.tmpdir, filename)
|
114
114
|
File.copy(temp_path, temp_rename)
|
data/lib/scribd_fu.rb
CHANGED
@@ -101,8 +101,8 @@ module ScribdFu
|
|
101
101
|
def self.extended(base)
|
102
102
|
base.class_inheritable_accessor :scribd_options
|
103
103
|
|
104
|
-
base.before_destroy
|
105
|
-
base.
|
104
|
+
base.before_destroy :destroy_scribd_documents
|
105
|
+
base.before_validation :upload_to_scribd
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
data/scribd_fu.gemspec
CHANGED