Module: GDCM::Configuration
- Included in:
- GDCM
- Defined in:
- lib/gdcm/configuration.rb
Instance Attribute Summary collapse
-
#debug ⇒ Boolean
readonly
When get to ‘true`, it outputs each command to STDOUT in their shell version.
-
#logger ⇒ Logger
Logger for #debug, default is ‘GDCM::Logger.new(STDOUT)`, but you can override it, for example if you want the logs to be written to a file.
-
#shell_api ⇒ String
Instructs GDCM how to execute the shell commands.
-
#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.
-
#whiny ⇒ Object
Returns the value of attribute whiny.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#debug ⇒ Boolean (readonly)
When get to ‘true`, it outputs each command to STDOUT in their shell version.
19 20 21 |
# File 'lib/gdcm/configuration.rb', line 19 def debug @debug end |
#logger ⇒ Logger
Logger for #debug, default is ‘GDCM::Logger.new(STDOUT)`, but you can override it, for example if you want the logs to be written to a file.
27 28 29 |
# File 'lib/gdcm/configuration.rb', line 27 def logger @logger end |
#shell_api ⇒ String
Instructs GDCM how to execute the shell commands. Available APIs are “open3” (default) and “posix-spawn” (requires the “posix-spawn” gem).
55 56 57 |
# File 'lib/gdcm/configuration.rb', line 55 def shell_api @shell_api end |
#timeout ⇒ Integer
If you don’t want commands to take too long, you can set a timeout (in seconds).
12 13 14 |
# File 'lib/gdcm/configuration.rb', line 12 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`.
36 37 38 |
# File 'lib/gdcm/configuration.rb', line 36 def validate_on_create @validate_on_create end |
#whiny ⇒ Object
Returns the value of attribute whiny.
46 47 48 |
# File 'lib/gdcm/configuration.rb', line 46 def whiny @whiny end |
Class Method Details
.extended(base) ⇒ Object
57 58 59 60 61 62 |
# File 'lib/gdcm/configuration.rb', line 57 def self.extended(base) base.validate_on_create = true base.whiny = true base.shell_api = "open3" base.logger = Logger.new($stdout).tap { |l| l.level = Logger::INFO } end |
Instance Method Details
#configure {|self| ... } ⇒ Object
71 72 73 |
# File 'lib/gdcm/configuration.rb', line 71 def configure yield self end |