Class: GS::Configuration
- Inherits:
-
Object
- Object
- GS::Configuration
- Defined in:
- lib/gs-ruby/configuration.rb
Overview
A configuration object used to define the path to the Ghostscript command, any default options and the logger that should be used.
-
This is usually not instantiated directly, but rather by way of calling
GS.configure.
Instance Attribute Summary collapse
-
#bin_path ⇒ String
Gets the bin path to the Ghostscript command.
-
#default_options ⇒ Hash
Gets the default options.
-
#logger ⇒ Logger
Gets the logger object.
Instance Attribute Details
#bin_path ⇒ String
Gets the bin path to the Ghostscript command.
-
If no path has been set, it returns ‘gs’ as the default.
20 21 22 |
# File 'lib/gs-ruby/configuration.rb', line 20 def bin_path @bin_path ||= 'gs' end |
#default_options ⇒ Hash
Gets the default options.
-
If no default options have been set, it returns a set of options where
GS::BATCHis set by default.
52 53 54 |
# File 'lib/gs-ruby/configuration.rb', line 52 def ||= { GS::BATCH => nil } end |
#logger ⇒ Logger
Gets the logger object.
-
If no logger has been set, it instantiates and returns a new logger configured to log to $stdout.
62 63 64 65 66 |
# File 'lib/gs-ruby/configuration.rb', line 62 def logger @logger ||= Logger.new($stdout).tap do |logger| logger.progname = bin_path end end |