attachment_on_the_fly 0.1.1 → 0.1.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/VERSION +1 -1
- data/attachment_on_the_fly.gemspec +2 -2
- data/lib/attachment_on_the_fly.rb +12 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{attachment_on_the_fly}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jeff Sutherland"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-18}
|
13
13
|
s.description = %q{A Paperclip mix-in to allow auto-generation of resized images}
|
14
14
|
s.email = %q{jefferey.sutherland@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -76,7 +76,17 @@ Paperclip::Attachment.class_eval do
|
|
76
76
|
return new_path if File.exist?(newfilename)
|
77
77
|
|
78
78
|
if !File.exist?(original)
|
79
|
-
|
79
|
+
if Paperclip.options[:whiny]
|
80
|
+
raise AttachmentOnTheFlyError.new("Original asset could not be read from disk at #{original}")
|
81
|
+
else
|
82
|
+
Paperclip.log("Original asset could not be read from disk at #{original}")
|
83
|
+
if Paperclip.options[:missing_image_path]
|
84
|
+
return Paperclip.options[:missing_image_path]
|
85
|
+
else
|
86
|
+
Paperclip.log("Please configure Paperclip.options[:missing_image_path] to prevent return of broken image path")
|
87
|
+
return new_path
|
88
|
+
end
|
89
|
+
end
|
80
90
|
end
|
81
91
|
|
82
92
|
command = ""
|
@@ -95,7 +105,7 @@ Paperclip::Attachment.class_eval do
|
|
95
105
|
`#{command}`
|
96
106
|
|
97
107
|
if $? != 0
|
98
|
-
raise AttachmentOnTheFlyError.new("Execution of convert failed")
|
108
|
+
raise AttachmentOnTheFlyError.new("Execution of convert failed. Please set path in Paperclip.options[:command_path] or ensure that file permissions are correct.")
|
99
109
|
end
|
100
110
|
|
101
111
|
return new_path
|