Class: Spackle::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/spackle/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#callback_commandObject

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_formatterObject

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_fileObject

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

#tempdirObject

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