Sha256: b832f9257041a1208ba063b1e1336edfaf30e5e3bf12154aec8f0990d9b72fc5

Contents?: true

Size: 1.13 KB

Versions: 30

Compression:

Stored size: 1.13 KB

Contents

#!/usr/bin/env ruby

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

trap('INT') { exit! }

# require 'bundler/setup' # uncomment to remove the need to do `bundle exec`.
require 'vedeu'

# An example application to demonstrate 'Hello World'.
#
# If you have cloned this repository from GitHub, you can run this example:
#
#     ./examples/hello_world.rb
#
class HelloWorldApp

  Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }

  Vedeu.configure do
    # debug!
    log '/tmp/vedeu_hello_world.log'
  end

  Vedeu.interface 'messages' do
    background '#000000'
    foreground '#00ff00'
    geometry do
      centred!
      height   5
      width    20
    end
    keymap do
      key('q') { Vedeu.exit }
    end
  end

  Vedeu.renders do
    view 'messages' do
      lines do
        line do
          centre 'Hello World!', width: 20
        end
        line
        line do
          centre "Press 'q' to exit.", width: 20
        end
      end
    end
  end

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

end # HelloWorldApp

HelloWorldApp.start(ARGV)

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
vedeu-0.6.20 test/support/examples/hello_world.rb
vedeu-0.6.19 test/support/examples/hello_world.rb
vedeu-0.6.18 test/support/examples/hello_world.rb
vedeu-0.6.17 test/support/examples/hello_world.rb
vedeu-0.6.16 test/support/examples/hello_world.rb
vedeu-0.6.15 test/support/examples/hello_world.rb
vedeu-0.6.14 test/support/examples/hello_world.rb
vedeu-0.6.13 test/support/examples/hello_world.rb
vedeu-0.6.12 test/support/examples/hello_world.rb
vedeu-0.6.11 test/support/examples/hello_world.rb
vedeu-0.6.10 test/support/examples/hello_world.rb
vedeu-0.6.9 test/support/examples/hello_world.rb
vedeu-0.6.8 test/support/examples/hello_world.rb
vedeu-0.6.7 test/support/examples/hello_world.rb
vedeu-0.6.6 examples/hello_world.rb
vedeu-0.6.5 examples/hello_world.rb
vedeu-0.6.4 examples/hello_world.rb
vedeu-0.6.3 examples/hello_world.rb
vedeu-0.6.2 examples/hello_world.rb
vedeu-0.6.1 examples/hello_world.rb