Sha256: af9ae0da2b7b4a180cc1dd30a7c93eee8043c3253ba6376acba62e61ea9cad96

Contents?: true

Size: 1.09 KB

Versions: 18

Compression:

Stored size: 1.09 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.
#
# 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

18 entries across 18 versions & 1 rubygems

Version Path
vedeu-0.4.31 examples/configuration_app.rb
vedeu-0.4.30 examples/configuration_app.rb
vedeu-0.4.29 examples/configuration_app.rb
vedeu-0.4.28 examples/configuration_app.rb
vedeu-0.4.27 examples/configuration_app.rb
vedeu-0.4.26 examples/configuration_app.rb
vedeu-0.4.25 examples/configuration_app.rb
vedeu-0.4.24 examples/configuration_app.rb
vedeu-0.4.23 examples/configuration_app.rb
vedeu-0.4.22 examples/configuration_app.rb
vedeu-0.4.21 examples/configuration_app.rb
vedeu-0.4.20 examples/configuration_app.rb
vedeu-0.4.19 examples/configuration_app.rb
vedeu-0.4.18 examples/configuration_app.rb
vedeu-0.4.17 examples/configuration_app.rb
vedeu-0.4.16 examples/configuration_app.rb
vedeu-0.4.15 examples/configuration_app.rb
vedeu-0.4.14 examples/configuration_app.rb