Vedeu Configuration

Vedeu provides a simple DSL for configuration.

Vedeu.configure do

  # add configuration options here, each of which are listed
  # below...

end

If you need to access the value of Vedeu's configuration for whatever reason, simply ask for it:

# => The current value of 'base_path'
Vedeu.config.base_path

Configuration Options

background

Sets the background of the terminal.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_background identifier id'>background</span> <span class='string val'>'#ff0000'</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

base_path

Override the base path for the application (for locating templates and other resources). By default the base path is just cwd but this will not work for many applications.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_base_path identifier id'>base_path</span> <span class='string val'>'/path/to/application'</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

colour

Sets the background and foreground of the terminal.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_colour identifier id'>colour</span> <span class='label val'>background:</span> <span class='string val'>'#ff0000'</span><span class='comma token'>,</span> <span class='label val'>foreground:</span> <span class='string val'>'#ffff00'</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

colour_mode

Sets the colour mode of the terminal.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_colour_mode identifier id'>colour_mode</span> <span class='integer val'>256</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

compression / compression!

Compression reduces the number of escape sequences being sent to the terminal which improves redraw/render/refresh rate. By default it is enabled.

Sets boolean to enable/disable compression. Vedeu’s default setting is for compression to be enabled. Setting ‘compression` to false will disable compression.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_compression! fid id'>compression!</span> <span class='comment val'># enabled (default)</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_compression identifier id'>compression</span> <span class='rubyid_false false kw'>false</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>
  • Be aware that running an application without compression will affect performance.

cooked / cooked!

Sets the terminal mode to ‘cooked`. Default terminal mode is `raw`. Also, see Vedeu::Config::API#raw!

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_cooked! fid id'>cooked!</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

debug / debug!

Sets boolean to enable/disable debugging. Vedeu’s default setting is for debugging to be disabled. Using ‘debug!` or setting `debug` to true will enable debugging.

Enabling debugging will:

  • Enable ‘Vedeu::Logging::Timer` meaning various timing information is output to the log file.

  • Produce a full a backtrace to STDOUT and the log file upon unrecoverable error or unhandled exception.

    Vedeu.configure do

    <span class='rubyid_debug! fid id'>debug!</span>
    <span class='comment val'># ...</span>
    

    end

    Vedeu.configure do

    <span class='rubyid_debug identifier id'>debug</span> <span class='rubyid_false false kw'>false</span>
    <span class='comment val'># ...</span>
    

    end

drb / drb!

Sets boolean to run a DRb server.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_drb! fid id'>drb!</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

drb_host

Sets the hostname or IP address of the DRb server.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_drb_host identifier id'>drb_host</span> <span class='string val'>'localhost'</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

drb_port

Sets the port of the DRb server.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_drb_port identifier id'>drb_port</span> <span class='integer val'>12345</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

drb_height

Sets the height of the fake terminal in the DRb server.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_drb_height identifier id'>drb_height</span> <span class='integer val'>25</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

drb_width

Sets the width of the fake terminal in the DRb server.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_drb_width identifier id'>drb_width</span> <span class='integer val'>80</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

foreground

Sets the foreground of the terminal.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_foreground identifier id'>foreground</span> <span class='string val'>'#ffff00'</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

interactive / interactive!

Sets boolean to allow user input. The default behaviour of Vedeu is to be interactive.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_interactive! fid id'>interactive!</span> <span class='comment val'># => same as `interactive true` or</span>
               <span class='comment val'>#    `standalone false`</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_interactive identifier id'>interactive</span> <span class='rubyid_true true kw'>true</span> <span class='comment val'># => Allow user input.</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_interactive identifier id'>interactive</span> <span class='rubyid_false false kw'>false</span> <span class='comment val'># => Disallow user input.</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

log

Sets the location of the log file.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_log identifier id'>log</span> <span class='string val'>'/var/log/vedeu.log'</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

log_only

Only log specific message types. A complete list of message types can be found at Vedeu::Logging::Log.message_types.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_log_only identifier id'>log_only</span> <span class='symbol val'>:debug</span><span class='comma token'>,</span> <span class='symbol val'>:event</span>

  <span class='comment val'># or</span>
  <span class='rubyid_log_only identifier id'>log_only</span> <span class='lbrack token'>[</span><span class='symbol val'>:debug</span><span class='comma token'>,</span> <span class='symbol val'>:info</span><span class='rbrack token'>]</span>

  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

log_except

Log specific message types except those given. A complete list of message types can be found at Vedeu::Logging::Log.message_types.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_log_except identifier id'>log_except</span> <span class='symbol val'>:debug</span><span class='comma token'>,</span> <span class='symbol val'>:event</span>

  <span class='comment val'># or</span>
  <span class='rubyid_log_except identifier id'>log_except</span> <span class='lbrack token'>[</span><span class='symbol val'>:debug</span><span class='comma token'>,</span> <span class='symbol val'>:info</span><span class='rbrack token'>]</span>

  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

loggable?

Returns true if the given type was included in the :log_only configuration option or not included in the :log_except option.

profile / profile!

Sets boolean to enable/disable profiling. Vedeu’s default setting is for profiling to be disabled. Using ‘profile!` or setting `profile` to true will enable profiling.

Profile uses ‘ruby-prof’ to write a ‘profile.html’ file to the /tmp directory which contains a call trace of the running application. Upon exit, this file can be examined to ascertain certain behaviours of Vedeu.

raw / raw!

Sets the terminal mode to ‘raw`. Default terminal mode is `raw`. Also, see Vedeu::Config::API#cooked!

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_raw! fid id'>raw!</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

renderer / renderers

Sets the renderers for Vedeu. Each renderer added must have the class method ‘.render’ defined as this will be called when rendering content.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_renderer identifier id'>renderer</span> <span class='rubyid_MyRenderer constant id'>MyRenderer</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_renderers identifier id'>renderers</span> <span class='rubyid_MyRenderer constant id'>MyRenderer</span><span class='comma token'>,</span> <span class='rubyid_MyOtherRenderer constant id'>MyOtherRenderer</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

root

Sets the root of the client application. Vedeu will execute this controller with action and optional arguments first.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_root identifier id'>root</span> <span class='symbol val'>:controller</span><span class='comma token'>,</span> <span class='symbol val'>:action</span><span class='comma token'>,</span> <span class='rubyid_args identifier id'>args</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

run_once / run_once!

Sets boolean to run the Vedeu main application loop once. In effect, using ‘run_once!` or setting `run_once` to true will allow Vedeu to initialize, run any client application code, cleanup, then terminate.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_run_once! fid id'>run_once!</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

standalone / standalone!

Sets boolean to prevent user intervention. This is the same as setting Sets boolean to allow user input. The default behaviour of Vedeu is to be interactive.

<span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_Vedeu constant id'</span><span class='gt op'>></span><span class='rubyid_Vedeu constant id'>Vedeu</span><span class='lt op'><</span><span class='regexp val'>/span><span class='dot token'>.</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span><span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_configure identifier id'</span><span class='gt op'>></span><span class='rubyid_configure identifier id'>configure</span><span class='lt op'><</span><span class='regexp val'>/span> <span class='rubyid_do do kw'>do</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span>
  <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_interactive! fid id'</span><span class='gt op'>></span><span class='rubyid_interactive! fid id'>interactive!</span><span class='lt op'><</span><span class='regexp val'>/span> <span class='comment val'># => same as `interactive true` or</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span>
               <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'comment val'</span><span class='gt op'>></span><span class='comment val'>#    `standalone false`</span></span>
  <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'comment val'</span><span class='gt op'>></span><span class='comment val'># ...</span></span>
<span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_end end kw'</span><span class='gt op'>></span><span class='rubyid_end end kw'>end</span><span class='lt op'><</span><span class='regexp val'>/span>

<span class='rubyid_Vedeu constant id'>Vedeu</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span><span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'dot token'</span><span class='gt op'>></span><span class='dot token'>.</span><span class='lt op'><</span><span class='regexp val'>/span><span class='rubyid_configure identifier id'>configure</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span> <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_do do kw'</span><span class='gt op'>></span><span class='rubyid_do do kw'>do</span><span class='lt op'><</span><span class='regexp val'>/span>
  <span class='rubyid_interactive identifier id'>interactive</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span> <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_true true kw'</span><span class='gt op'>></span><span class='rubyid_true true kw'>true</span><span class='lt op'><</span><span class='regexp val'>/span> <span class='comment val'># => Allow user input.</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span>
  <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'comment val'</span><span class='gt op'>></span><span class='comment val'># ...</span></span>
<span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_end end kw'</span><span class='gt op'>></span><span class='rubyid_end end kw'>end</span><span class='lt op'><</span><span class='regexp val'>/span>

<span class='rubyid_Vedeu constant id'>Vedeu</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span><span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'dot token'</span><span class='gt op'>></span><span class='dot token'>.</span><span class='lt op'><</span><span class='regexp val'>/span><span class='rubyid_configure identifier id'>configure</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span> <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_do do kw'</span><span class='gt op'>></span><span class='rubyid_do do kw'>do</span><span class='lt op'><</span><span class='regexp val'>/span>
  <span class='rubyid_interactive identifier id'>interactive</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span> <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_false false kw'</span><span class='gt op'>></span><span class='rubyid_false false kw'>false</span><span class='lt op'><</span><span class='regexp val'>/span> <span class='comment val'># => Disallow user input.</s</span><span class='rubyid_pan identifier id'>pan</span><span class='gt op'>></span>
  <span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'comment val'</span><span class='gt op'>></span><span class='comment val'># ...</span></span>
<span class='lt op'><</span><span class='rubyid_span identifier id'>span</span> <span class='rubyid_class class kw'>class</span><span class='assign token'>=</span><span class='string val'>'rubyid_end end kw'</span><span class='gt op'>></span><span class='rubyid_end end kw'>end</span><span class='lt op'><</span><span class='regexp val'>/span>
</span>
to false.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_standalone! fid id'>standalone!</span> <span class='comment val'># => same as `standalone true` or</span>
              <span class='comment val'>#    `interactive false`</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_standalone identifier id'>standalone</span> <span class='rubyid_true true kw'>true</span> <span class='comment val'># => Disallow user input.</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_standalone identifier id'>standalone</span> <span class='rubyid_false false kw'>false</span> <span class='comment val'># => Allow user input.</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

stderr

Sets the value of STDERR.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_stderr identifier id'>stderr</span> <span class='rubyid_IO constant id'>IO</span><span class='dot token'>.</span><span class='rubyid_console identifier id'>console</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

stdin

Sets the value of STDIN.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_stdin identifier id'>stdin</span> <span class='rubyid_IO constant id'>IO</span><span class='dot token'>.</span><span class='rubyid_console identifier id'>console</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

stdout

Sets the value of STDOUT.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_stdout identifier id'>stdout</span> <span class='rubyid_IO constant id'>IO</span><span class='dot token'>.</span><span class='rubyid_console identifier id'>console</span>
  <span class='comment val'># ...</span>
<span class='rubyid_end end kw'>end</span>

terminal_mode

Sets the terminal mode. Valid values can be either ‘:cooked’, ‘:fake’ or :raw’.

<span class='rubyid_Vedeu constant id'>Vedeu</span><span class='dot token'>.</span><span class='rubyid_configure identifier id'>configure</span> <span class='rubyid_do do kw'>do</span>
  <span class='rubyid_terminal_mode identifier id'>terminal_mode</span> <span class='symbol val'>:cooked</span>

  <span class='comment val'># or...</span>

  <span class='rubyid_terminal_mode identifier id'>terminal_mode</span> <span class='symbol val'>:fake</span>

  <span class='comment val'># or...</span>

  <span class='rubyid_terminal_mode identifier id'>terminal_mode</span> <span class='symbol val'>:raw</span>

  <span class='comment val'># or...</span>

  <span class='rubyid_terminal_mode identifier id'>terminal_mode</span> <span class='assign token'>=</span> <span class='symbol val'>:raw</span>
  <span class='rubyid_terminal_mode identifier id'>terminal_mode</span> <span class='assign token'>=</span> <span class='symbol val'>:fake</span>
  <span class='rubyid_terminal_mode identifier id'>terminal_mode</span> <span class='assign token'>=</span> <span class='symbol val'>:cooked</span>

  <span class='comment val'># ... some code</span>
<span class='rubyid_end end kw'>end</span>