Sha256: 92d4391c27082820b0727324b47c0ecb048537de34dfda65c197a22dc668dbfb

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

#!/usr/bin/env ruby

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

-> { its -> { a } }
trap('INT') { exit! }

require 'vedeu'

# This example application shows how configuration works.
#
# 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
    colour_mode 16777216
    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.new(argv).execute!
  end
end

VedeuConfigurationApp.start(ARGV)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.3.4 examples/configuration_app.rb
vedeu-0.3.3 examples/configuration_app.rb
vedeu-0.3.2 examples/configuration_app.rb
vedeu-0.3.1 examples/configuration_app.rb
vedeu-0.3.0 examples/configuration_app.rb