enhance 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,11 +13,12 @@ class Enhance::Enhancer
13
13
  # max_side : maximum size of the enhanced image
14
14
  # file_root : root of the server if not the same as root
15
15
  def initialize app, root, options = {}
16
+ root = root.call if root.respond_to? :call
16
17
  @app = app
17
- @extensions = [options[:extensions]].flatten || %w( jpg png jpeg gif )
18
+ @extensions = [options[:extensions] || %w( jpg png jpeg gif )].flatten
18
19
  @routes = options[:routes] || %w( images )
19
- @folders = [options[:folders]].flatten.compact
20
- @folders = [File.join(root, "public")] if @folders.blank?
20
+ folders = options[:folders].respond_to?(:call) ? options[:folders].call : options[:folders]
21
+ @folders = [folders || File.join(root, "public")].flatten.compact
21
22
  @quality = options[:quality] || 100
22
23
  @command_path = options[:convert_path] || "#{Paperclip.options[:command_path] if defined?(Paperclip)}"
23
24
  @command_path += "/" unless @command_path.empty?
@@ -42,7 +43,6 @@ class Enhance::Enhancer
42
43
  File.exists?(f) ? f : nil
43
44
  end
44
45
 
45
-
46
46
  if request && (filename = convert(request, matches['filename'], CGI.unescape(matches['geometry']))) && filename.gsub!(/^#{@file_root}/, '')
47
47
  env["PATH_INFO"] = filename
48
48
  @server.call env
@@ -1,3 +1,3 @@
1
1
  module Enhance
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enhance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-26 00:00:00.000000000Z
12
+ date: 2011-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &70355417546340 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70355417546340
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: utilities
27
- requirement: &70355417545920 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70355417545920
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rack-test
38
- requirement: &70355417536420 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,7 +53,12 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70355417536420
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  description: Middleware to "enhance" and resize images on the fly.
48
63
  email: gmalette@gmail.com
49
64
  executables: []
@@ -79,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
94
  version: '0'
80
95
  requirements: []
81
96
  rubyforge_project:
82
- rubygems_version: 1.8.10
97
+ rubygems_version: 1.8.24
83
98
  signing_key:
84
99
  specification_version: 3
85
100
  summary: Image resizing on the fly