Class: Postmortem::Configuration

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

Overview

Provides interface for configuring Postmortem and implements sensible defaults.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#colorizeObject



9
10
11
# File 'lib/postmortem/configuration.rb', line 9

def colorize
  defined?(@colorize) ? @colorize : true
end

#log_pathObject

Returns the value of attribute log_path.



7
8
9
# File 'lib/postmortem/configuration.rb', line 7

def log_path
  @log_path
end

#mail_skip_deliveryObject



31
32
33
# File 'lib/postmortem/configuration.rb', line 31

def mail_skip_delivery
  defined?(@mail_skip_delivery) ? @mail_skip_delivery : true
end

Instance Method Details

#layoutObject



21
22
23
24
25
# File 'lib/postmortem/configuration.rb', line 21

def layout
  default = File.expand_path(File.join(__dir__, '..', '..', 'layout', 'default'))
  path = Pathname.new(@layout || default)
  path.extname.empty? ? path.sub_ext('.html.erb') : path
end

#layout=(val) ⇒ Object



17
18
19
# File 'lib/postmortem/configuration.rb', line 17

def layout=(val)
  @layout = Pathname.new(val)
end

#preview_directoryObject



27
28
29
# File 'lib/postmortem/configuration.rb', line 27

def preview_directory
  @preview_directory ||= Pathname.new(File.join(Dir.tmpdir, 'postmortem'))
end

#preview_directory=(val) ⇒ Object



13
14
15
# File 'lib/postmortem/configuration.rb', line 13

def preview_directory=(val)
  @preview_directory = Pathname.new(val)
end