Sha256: a34d0db1cd7f7b6539591620e8abe2d75cd74d6459f783123f8a24c7162676e1

Contents?: true

Size: 783 Bytes

Versions: 3

Compression:

Stored size: 783 Bytes

Contents

require 'omf_common/lobject'
OMF::Common::Loggable.init_log 'simple'


require 'omf_oml/table'

def load_environment
  require 'omf-web/content/file_repository'
  

  Dir.glob("#{File.dirname(__FILE__)}/data_sources/*.rb").each do |fn|
    load fn
  end
  
  require 'yaml'
  Dir.glob("#{File.dirname(__FILE__)}/widgets/*.yaml").each do |fn|
    h = YAML.load_file(fn)
    if w = h['widget']
      OMF::Web.register_widget w
    else
      MObject.error "Don't know what to do with '#{fn}'"
    end
  end
end


# Configure the web server
#
opts = {
  :app_name => 'simple',
  :page_title => 'Simple Demo',
  :handlers => {
    # delay connecting to databases to AFTER we may run as daemon
    :pre_rackup => lambda { load_environment },
  }
}
require 'omf_web'
OMF::Web.start(opts)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omf_web-0.9.9 example/simple/simple_viz_server.rb
omf_web-0.9.8 example/simple/simple_viz_server.rb
omf_web-0.9.7 example/simple/simple_viz_server.rb