Class: Spackle::Configuration
- Inherits:
-
Object
- Object
- Spackle::Configuration
- Defined in:
- lib/spackle/configuration.rb
Instance Attribute Summary collapse
-
#callback_command ⇒ Object
The command to invoke when Spackle finds errors.
-
#error_formatter ⇒ Object
Which ErrorFormatter class to use when formatting errors.
-
#spackle_file ⇒ Object
Filename to use when writing the formatted Spackle results.
-
#tempdir ⇒ Object
Where to store the Spackle error files.
Instance Method Summary collapse
-
#set_defaults_for(mode) ⇒ Object
Configure Spackle with defaults.
Instance Attribute Details
#callback_command ⇒ Object
The command to invoke when Spackle finds errors. It will receive a single argument, being the path to the Spackle errors file. If left unspecified, no command is invoked.
6 7 8 |
# File 'lib/spackle/configuration.rb', line 6 def callback_command @callback_command end |
#error_formatter ⇒ Object
Which ErrorFormatter class to use when formatting errors. Specified as a symbol or string matching a class in spackle/error_formatters. i.e. config.error_formatter = :vim_quickfix
15 16 17 |
# File 'lib/spackle/configuration.rb', line 15 def error_formatter @error_formatter end |
#spackle_file ⇒ Object
Filename to use when writing the formatted Spackle results. If unspecified, defaults to a filename based on the name of your project’s root directory, or “default.spackle” it can’t figure out where your root directory is
21 22 23 |
# File 'lib/spackle/configuration.rb', line 21 def spackle_file @spackle_file end |
#tempdir ⇒ Object
Where to store the Spackle error files. If unspecified, Spackle will default to /tmp
10 11 12 |
# File 'lib/spackle/configuration.rb', line 10 def tempdir @tempdir end |
Instance Method Details
#set_defaults_for(mode) ⇒ Object
Configure Spackle with defaults. Currently only accepts :vim as an argument.
25 26 27 28 29 30 31 32 33 |
# File 'lib/spackle/configuration.rb', line 25 def set_defaults_for(mode) case mode.to_sym when :vim self.callback_command = "spackle-vim-load-quickfix" self.error_formatter = :vim_quickfix else raise ArgumentError.new("unknown Spackle mode: '#{mode}'") end end |