attachment_on_the_fly 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.1.0
@@ -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.0.7"
8
+ s.version = "0.1.0"
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{2010-12-21}
12
+ s.date = %q{2011-02-17}
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 = [
@@ -27,11 +27,10 @@ Gem::Specification.new do |s|
27
27
  ]
28
28
  s.homepage = %q{http://github.com/drpentode/Attachment-on-the-Fly}
29
29
  s.require_paths = ["lib"]
30
- s.rubygems_version = %q{1.3.7}
30
+ s.rubygems_version = %q{1.5.0}
31
31
  s.summary = %q{A Paperclip mix-in to allow auto-generation of resized images}
32
32
 
33
33
  if s.respond_to? :specification_version then
34
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
35
34
  s.specification_version = 3
36
35
 
37
36
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -41,11 +41,12 @@ Paperclip::Attachment.class_eval do
41
41
  # if our method string does not match, we kick things back up to super ... this keeps ActiveRecord chugging along happily
42
42
  super
43
43
  end
44
-
45
- return image_name
44
+ return image_name
46
45
  end
47
46
 
48
47
  def generate_image(kind, height = 0, width = 0)
48
+ convert_command_path = (Paperclip.options[:command_path] ? Paperclip.options[:command_path] + "/" : "")
49
+
49
50
  prefix = ""
50
51
 
51
52
  if kind == "height"
@@ -80,13 +81,16 @@ Paperclip::Attachment.class_eval do
80
81
 
81
82
  if kind == "height"
82
83
  # resize_image infilename, outfilename , 0, height
83
- `convert -colorspace RGB -geometry x#{height} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null`
84
+ command = "#{convert_command_path}convert -colorspace RGB -geometry x#{height} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null"
85
+ `#{command}`
84
86
  elsif kind == "width"
85
87
  # resize_image infilename, outfilename, width
86
- `convert -colorspace RGB -geometry #{width} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null`
88
+ command = "#{convert_command_path}convert -colorspace RGB -geometry #{width} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null"
89
+ `#{command}`
87
90
  elsif kind == "both"
88
91
  # resize_image infilename, outfilename, height, width
89
- `convert -colorspace RGB -geometry #{width}x#{height} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null`
92
+ command = "#{convert_command_path}convert -colorspace RGB -geometry #{width}x#{height} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null"
93
+ `#{command}`
90
94
  end
91
95
 
92
96
  return new_path
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attachment_on_the_fly
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 7
9
- version: 0.0.7
4
+ prerelease:
5
+ version: 0.1.0
10
6
  platform: ruby
11
7
  authors:
12
8
  - Jeff Sutherland
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-12-21 00:00:00 -07:00
13
+ date: 2011-02-17 00:00:00 -07:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,8 +21,6 @@ dependencies:
25
21
  requirements:
26
22
  - - ">="
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
24
  version: "0"
31
25
  type: :runtime
32
26
  version_requirements: *id001
@@ -61,21 +55,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
55
  requirements:
62
56
  - - ">="
63
57
  - !ruby/object:Gem::Version
64
- segments:
65
- - 0
66
58
  version: "0"
67
59
  required_rubygems_version: !ruby/object:Gem::Requirement
68
60
  none: false
69
61
  requirements:
70
62
  - - ">="
71
63
  - !ruby/object:Gem::Version
72
- segments:
73
- - 0
74
64
  version: "0"
75
65
  requirements: []
76
66
 
77
67
  rubyforge_project:
78
- rubygems_version: 1.3.7
68
+ rubygems_version: 1.5.0
79
69
  signing_key:
80
70
  specification_version: 3
81
71
  summary: A Paperclip mix-in to allow auto-generation of resized images