Module: MiniMagick::Configuration
- Included in:
- MiniMagick
- Defined in:
- lib/mini_magick/configuration.rb
Instance Attribute Summary collapse
-
#cli_prefix ⇒ String+
Adds a prefix to the CLI command.
-
#errors ⇒ Boolean
If set to ‘false`, it will not raise errors when ImageMagick returns status code different than 0.
-
#logger ⇒ Logger
Logger for commands, default is ‘Logger.new($stdout)`, but you can override it, for example if you want the logs to be written to a file.
-
#timeout ⇒ Integer
If you don’t want commands to take too long, you can set a timeout (in seconds).
-
#tmpdir ⇒ String
Temporary directory used by MiniMagick, default is ‘Dir.tmpdir`, but you can override it.
-
#warnings ⇒ Object
If set to ‘false`, it will not forward warnings from ImageMagick to standard error.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cli_prefix ⇒ String+
Adds a prefix to the CLI command. For example, you could use ‘firejail` to run all commands in a sandbox. Can be a string, or an array of strings. e.g. ’firejail’, or [‘firejail’, ‘–force’]
16 17 18 |
# File 'lib/mini_magick/configuration.rb', line 16 def cli_prefix @cli_prefix end |
#errors ⇒ Boolean
If set to ‘false`, it will not raise errors when ImageMagick returns status code different than 0. Defaults to `true`.
46 47 48 |
# File 'lib/mini_magick/configuration.rb', line 46 def errors @errors end |
#logger ⇒ Logger
Logger for commands, default is ‘Logger.new($stdout)`, but you can override it, for example if you want the logs to be written to a file.
31 32 33 |
# File 'lib/mini_magick/configuration.rb', line 31 def logger @logger end |
#timeout ⇒ Integer
If you don’t want commands to take too long, you can set a timeout (in seconds).
24 25 26 |
# File 'lib/mini_magick/configuration.rb', line 24 def timeout @timeout end |
#tmpdir ⇒ String
Temporary directory used by MiniMagick, default is ‘Dir.tmpdir`, but you can override it.
38 39 40 |
# File 'lib/mini_magick/configuration.rb', line 38 def tmpdir @tmpdir end |
#warnings ⇒ Object
If set to ‘false`, it will not forward warnings from ImageMagick to standard error.
51 52 53 |
# File 'lib/mini_magick/configuration.rb', line 51 def warnings @warnings end |
Class Method Details
.extended(base) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/mini_magick/configuration.rb', line 53 def self.extended(base) base.tmpdir = Dir.tmpdir base.errors = true base.logger = Logger.new($stdout).tap { |l| l.level = Logger::INFO } base.warnings = true end |
Instance Method Details
#configure {|self| ... } ⇒ Object
67 68 69 |
# File 'lib/mini_magick/configuration.rb', line 67 def configure yield self end |