Module: MiniMagick::Configuration
- Included in:
- MiniMagick
- Defined in:
- lib/mini_magick/configuration.rb
Instance Attribute Summary collapse
-
#cli ⇒ Symbol
Set whether you want to use [ImageMagick](www.imagemagick.org) or [GraphicsMagick](www.graphicsmagick.org).
-
#cli_path ⇒ String
If you don’t have the CLI tools in your PATH, you can set the path to the executables.
-
#debug ⇒ Boolean
When set to ‘true`, it outputs each command to STDOUT in their shell version.
-
#logger ⇒ Logger
Logger for #debug, default is ‘MiniMagick::Logger.new(STDOUT)`, but you can override it, for example if you want the logs to be written to a file.
- #processor ⇒ Object
- #processor_path ⇒ Object
-
#timeout ⇒ Integer
If you don’t want commands to take too long, you can set a timeout (in seconds).
-
#validate_on_create ⇒ Boolean
If set to ‘true`, it will `identify` every newly created image, and raise `MiniMagick::Invalid` if the image is not valid.
-
#validate_on_write ⇒ Boolean
If set to ‘true`, it will `identify` every image that gets written (with Image#write), and raise `MiniMagick::Invalid` if the image is not valid.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cli ⇒ Symbol
Set whether you want to use [ImageMagick](www.imagemagick.org) or [GraphicsMagick](www.graphicsmagick.org).
12 13 14 |
# File 'lib/mini_magick/configuration.rb', line 12 def cli @cli end |
#cli_path ⇒ String
If you don’t have the CLI tools in your PATH, you can set the path to the executables.
22 23 24 |
# File 'lib/mini_magick/configuration.rb', line 22 def cli_path @cli_path end |
#debug ⇒ Boolean
When set to ‘true`, it outputs each command to STDOUT in their shell version.
39 40 41 |
# File 'lib/mini_magick/configuration.rb', line 39 def debug @debug end |
#logger ⇒ Logger
Logger for #debug, default is ‘MiniMagick::Logger.new(STDOUT)`, but you can override it, for example if you want the logs to be written to a file.
47 48 49 |
# File 'lib/mini_magick/configuration.rb', line 47 def logger @logger end |
#processor ⇒ Object
14 15 16 |
# File 'lib/mini_magick/configuration.rb', line 14 def processor @processor end |
#processor_path ⇒ Object
24 25 26 |
# File 'lib/mini_magick/configuration.rb', line 24 def processor_path @processor_path end |
#timeout ⇒ Integer
If you don’t want commands to take too long, you can set a timeout (in seconds).
32 33 34 |
# File 'lib/mini_magick/configuration.rb', line 32 def timeout @timeout end |
#validate_on_create ⇒ Boolean
If set to ‘true`, it will `identify` every newly created image, and raise `MiniMagick::Invalid` if the image is not valid. Useful for validating user input, although it adds a bit of overhead. Defaults to `true`.
55 56 57 |
# File 'lib/mini_magick/configuration.rb', line 55 def validate_on_create @validate_on_create end |
#validate_on_write ⇒ Boolean
If set to ‘true`, it will `identify` every image that gets written (with Image#write), and raise `MiniMagick::Invalid` if the image is not valid. Useful for validating that processing was sucessful, although it adds a bit of overhead. Defaults to `true`.
64 65 66 |
# File 'lib/mini_magick/configuration.rb', line 64 def validate_on_write @validate_on_write end |
Class Method Details
.extended(base) ⇒ Object
66 67 68 69 |
# File 'lib/mini_magick/configuration.rb', line 66 def self.extended(base) base.validate_on_create = true base.validate_on_write = true end |
Instance Method Details
#configure {|self| ... } ⇒ Object
79 80 81 |
# File 'lib/mini_magick/configuration.rb', line 79 def configure yield self end |