Sha256: 8195c7de71d369040258b4eefa775480433c91cd8d6b7fe16f93ed5238952390

Contents?: true

Size: 1.21 KB

Versions: 8

Compression:

Stored size: 1.21 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') }
  end

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

end

VedeuConfigurationApp.start(ARGV)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.4.40 examples/configuration_app.rb
vedeu-0.4.39 examples/configuration_app.rb
vedeu-0.4.38 examples/configuration_app.rb
vedeu-0.4.37 examples/configuration_app.rb
vedeu-0.4.36 examples/configuration_app.rb
vedeu-0.4.35 examples/configuration_app.rb
vedeu-0.4.34 examples/configuration_app.rb
vedeu-0.4.33 examples/configuration_app.rb