mdarby-scribd_fu 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/attachment_fu/methods.rb +4 -4
- data/lib/scribd_fu.rb +2 -2
- data/scribd_fu.gemspec +1 -1
- metadata +2 -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}", :access => access_level)
|
56
|
+
logger.info "[Scribd_fu] #{Time.now.rfc2822}: Uploaded '#{file_path}' to Scribd"
|
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 public_filename
|
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.after_save :upload_to_scribd
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
data/scribd_fu.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdarby-scribd_fu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
@@ -14,6 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rscribd
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|