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.
@@ -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}", :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"
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 public_filename
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 :destroy_scribd_documents
105
- base.after_save :upload_to_scribd
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "scribd_fu"
3
- s.version = "1.2.3.1"
3
+ s.version = "1.2.3.2"
4
4
  s.date = "2009-03-18"
5
5
  s.summary = "Quick and easy interactions with Scribd's iPaper service"
6
6
  s.email = "matt@matt-darby.com"
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.3.1
4
+ version: 1.2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby