| Module | Sketches::Config |
| In: |
lib/sketches/config.rb
|
Returns true if the editor shall be ran as a background or a foreground process, returns false otherwise.
Config.background # => false
# File lib/sketches/config.rb, line 68 def Config.background @@sketches_background end
Sets the background mode to the specified mode.
Config.background = true
# File lib/sketches/config.rb, line 77 def Config.background=(mode) @@sketches_background = mode end
Use the specified new_editor to edit sketches. new_editor may be either a String or a lambda which accepts the path of the sketch and returns the command to run.
Config.editor = 'gvim'
Config.editor = lambda { |path|
"xterm -fg gray -bg black -e vim #{path} &"
}
# File lib/sketches/config.rb, line 147 def Config.editor=(new_editor) @@sketches_editor = new_editor end
Returns true if the sketch is eval‘d immediatly on editor quit (only if background = false)
Config.eval_after_editor_quit # => false
# File lib/sketches/config.rb, line 88 def Config.eval_after_editor_quit @@sketches_eval_after_editor_quit end
When background is false, can eval immediately after editor quits.
Config.eval_after_editor_quit = true
# File lib/sketches/config.rb, line 97 def Config.eval_after_editor_quit=(mode) @@sketches_eval_after_editor_quit = mode end
Sets the terminal to optionally run the editor within to the specified new_term. new_term may either be a String or a Proc.
Config.terminal = 'gnome-terminal'
Config.terminal = lambda { |cmd|
"xterm -fg gray -bg black -e #{cmd.dump} &"
}
# File lib/sketches/config.rb, line 122 def Config.terminal=(new_term) @@sketches_terminal = new_term end
Returns the directory to store temporary sketches in.
Config.tmpdir # => "/tmp"
# File lib/sketches/config.rb, line 49 def Config.tmpdir @@sketches_tmpdir end