attachment_on_the_fly 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/attachment_on_the_fly.gemspec +3 -2
- data/lib/attachment_on_the_fly.rb +2 -9
- data/pkg/attachment_on_the_fly-0.0.0.gem +0 -0
- metadata +2 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{attachment_on_the_fly}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.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"]
|
@@ -23,7 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
"VERSION",
|
24
24
|
"attachment_on_the_fly.gemspec",
|
25
25
|
"init.rb",
|
26
|
-
"lib/attachment_on_the_fly.rb"
|
26
|
+
"lib/attachment_on_the_fly.rb",
|
27
|
+
"pkg/attachment_on_the_fly-0.0.0.gem"
|
27
28
|
]
|
28
29
|
s.homepage = %q{http://github.com/drpentode/Attachment-on-the-Fly}
|
29
30
|
s.rdoc_options = ["--charset=UTF-8"]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# the paperclip attachment attribute should be called "attachment" on the model
|
4
4
|
#
|
5
5
|
Paperclip::Attachment.class_eval do
|
6
|
-
require
|
6
|
+
require 'ftools'
|
7
7
|
require 'fileutils'
|
8
8
|
require 'tempfile'
|
9
9
|
|
@@ -60,22 +60,15 @@ Paperclip::Attachment.class_eval do
|
|
60
60
|
file_name = path_arr.pop
|
61
61
|
path = path_arr.join("/")
|
62
62
|
|
63
|
-
puts "attachment path " + path
|
64
|
-
|
65
63
|
original = path + "/" + instance.attachment.original_filename
|
66
64
|
newfilename = path + "/" + prefix + file_name
|
67
|
-
puts "new file name " + newfilename
|
68
65
|
|
69
66
|
return newfilename if File.exist?(newfilename)
|
70
67
|
|
71
|
-
puts "In file " + original
|
72
|
-
|
73
68
|
if !File.exist?(original)
|
74
69
|
return newfilename
|
75
70
|
end
|
76
71
|
|
77
|
-
puts "Out file " + newfilename
|
78
|
-
|
79
72
|
if kind == "height"
|
80
73
|
# resize_image infilename, outfilename , 0, height
|
81
74
|
`convert -colorspace RGB -geometry x#{height} -quality 100 #{original} #{newfilename} 2>&1 > /dev/null`
|
@@ -86,7 +79,7 @@ Paperclip::Attachment.class_eval do
|
|
86
79
|
# resize_image infilename, outfilename, height, width
|
87
80
|
`convert -colorspace RGB -geometry #{height}x#{height} -quality 100 #{original} #{newfilename} 2>&1 > /dev/null`
|
88
81
|
end
|
89
|
-
|
82
|
+
|
90
83
|
newfilename
|
91
84
|
end
|
92
85
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attachment_on_the_fly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Sutherland
|
@@ -30,6 +30,7 @@ files:
|
|
30
30
|
- attachment_on_the_fly.gemspec
|
31
31
|
- init.rb
|
32
32
|
- lib/attachment_on_the_fly.rb
|
33
|
+
- pkg/attachment_on_the_fly-0.0.0.gem
|
33
34
|
has_rdoc: true
|
34
35
|
homepage: http://github.com/drpentode/Attachment-on-the-Fly
|
35
36
|
licenses: []
|