Sha256: 76b277f3b402af684db6b5af758bd80023329af27c0972107226f94398552f9a

Contents?: true

Size: 1.68 KB

Versions: 1

Compression:

Stored size: 1.68 KB

Contents

require 'rubygems'
require 'bundler/setup'
require 'vedeu'

module Example
  extend self

  class ExampleCommand
    def self.dispatch
      %Q|{
          "interfaces": {
              "name": "example",
              "lines": {
                  "streams": [
                      {
                        "text": "Some text..."
                      },
                      {
                        "text": " "
                      },
                      {
                        "colour": {
                          "foreground": "#00ff00",
                          "background": "#0000ff"
                        },
                        "text": "The time is: #{Time.now}."
                      }
                  ]
              }
          }
      }|
    end
  end

  class App
    include Vedeu

    interface 'example',  {
                            y: 1,  x: 1,  width: 80, height: 5,
                            colour: { background: '#ff0000', foreground: '#000000' },
                            cursor: false
                          }
    interface 'command',  {
                            y: 6, x: 1, width: 80, height: 1,
                            colour: { background: '#4040cc', foreground: '#aadd00' },
                            cursor: true
                          }
    command 'time', {
                      entity:   ExampleCommand,
                      keyword: 'time',
                      keypress: 't'
                    }
    command 'exit', {
                      entity:   Vedeu::Exit,
                      keyword: 'exit',
                      keypress: 'q'
                    }

    def self.start
      Vedeu::Launcher.new([]).execute!
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.0.31 test/example_app/lib/app.rb