Sha256: 15f11c0b78b1ee3d5b15ba241840dc054c9d51a078db8972a714327da6469298

Contents?: true

Size: 1.42 KB

Versions: 16

Compression:

Stored size: 1.42 KB

Contents

#!/usr/bin/env ruby

lib_dir = File.dirname(__FILE__) + '/../lib'
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)

require 'vedeu'

# This example application shows how configuration works.
#
# If you have cloned this repository from GitHub, you can run this example:
#
#     ./examples/configuration_app.rb
#
# First, we use the configuration API to switch debugging on, and set the
# logging to go to a file in the /tmp directory.
#
# By passing the arguments: --log /path/to/log_file.log when executing this
# example, we can demonstrate that the client application configuration is
# overridden by command line arguments.
#
# Use 'space' to refresh, 'q' to exit.
#
class VedeuConfigurationApp

  include Vedeu

  configure do
    # debug!
    log '/tmp/vedeu_configuration_app.log'
  end

  interface 'config' do
    geometry do
      width  40
      height 2
      centred!
    end
  end

  renders do
    view 'config' do
      lines do
        line Configuration.log.inspect + ' ' + Process.pid.to_s
      end
    end
  end

  keymap('config') do
    key(' ') { Vedeu.trigger(:_refresh_, 'config') }

    key('q')        { Vedeu.trigger(:_exit_) }
    key(:escape)    { Vedeu.trigger(:_mode_switch_) }
    key(:shift_tab) { Vedeu.trigger(:_focus_prev_) }
    key(:tab)       { Vedeu.trigger(:_focus_next_) }
  end

  def self.start(argv = ARGV)
    Vedeu::Launcher.execute!(argv)
  end

end

VedeuConfigurationApp.start(ARGV)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vedeu-0.4.56 examples/configuration_app.rb
vedeu-0.4.55 examples/configuration_app.rb
vedeu-0.4.54 examples/configuration_app.rb
vedeu-0.4.53 examples/configuration_app.rb
vedeu-0.4.52 examples/configuration_app.rb
vedeu-0.4.51 examples/configuration_app.rb
vedeu-0.4.50 examples/configuration_app.rb
vedeu-0.4.49 examples/configuration_app.rb
vedeu-0.4.48 examples/configuration_app.rb
vedeu-0.4.47 examples/configuration_app.rb
vedeu-0.4.46 examples/configuration_app.rb
vedeu-0.4.45 examples/configuration_app.rb
vedeu-0.4.44 examples/configuration_app.rb
vedeu-0.4.43 examples/configuration_app.rb
vedeu-0.4.42 examples/configuration_app.rb
vedeu-0.4.41 examples/configuration_app.rb