Module: OMF::Web
- Defined in:
- lib/omf_web.rb,
lib/omf-web/version.rb,
lib/omf-web/thin/runner.rb,
lib/omf-web/thin/server.rb,
lib/omf-web/session_store.rb,
lib/omf-web/data_source_proxy.rb,
lib/omf-web/content/repository.rb,
lib/omf-web/content/content_proxy.rb,
lib/omf-web/content/git_repository.rb,
lib/omf-web/content/file_repository.rb,
lib/omf-web/widget/UNUSED/code/code.rb,
lib/omf-web/content/irods_repository.rb,
lib/omf-web/content/static_repository.rb
Defined Under Namespace
Modules: Rack, Tab, Theme, Widget
Classes: ContentProxy, ContentRepository, ContentRepositoryException, DataSourceProxy, FileContentRepository, GitContentRepository, IRodsContentRepository, ReadOnlyContentRepositoryException, Runner, Server, SessionContext, SessionStore, StaticContentRepository
Constant Summary
collapse
- VERSION =
'1.2.9'
- TOP_DIR =
Used for finding the example directory
File.dirname(File.dirname(File.dirname(__FILE__)))
- @@datasources =
{}
- @@widgets =
{}
Class Method Summary
collapse
Class Method Details
39
40
41
42
43
44
45
46
47
|
# File 'lib/omf_web.rb', line 39
def self.load_widget_from_file(file_name)
require 'yaml'
y = YAML.load_file(file_name)
if w = y['widget']
OMF::Web.register_widget w
else
OMF::Base::LObject.error "Doesn't seem to be a widget definition. Expected 'widget' but found '#{y.keys.join(', ')}'"
end
end
|
.register_datasource(data_source, opts = {}) ⇒ Object
27
28
29
30
31
|
# File 'lib/omf_web.rb', line 27
def self.register_datasource(data_source, opts = {})
require 'omf-web/data_source_proxy'
OMF::Web::DataSourceProxy.register_datasource(data_source, opts)
end
|
33
34
35
36
37
|
# File 'lib/omf_web.rb', line 33
def self.register_widget(widget_descr)
require 'omf-web/widget'
wdescr = deep_symbolize_keys widget_descr
OMF::Web::Widget.register_widget(wdescr)
end
|
.start(opts, &block) ⇒ Object
VERSION = ‘git:release-5.4’
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/omf_web.rb', line 12
def self.start(opts, &block)
require 'omf-web/thin/runner'
if layout = opts.delete(:layout)
load_widget_from_file(layout)
end
runner = OMF::Web::Runner.new(ARGV, opts)
block.call if block
runner.run!
end
|
.use_tab(tab_id) ⇒ Object
49
50
51
|
# File 'lib/omf_web.rb', line 49
def self.use_tab(tab_id)
OMF::Web::Tab.use_tab tab_id.to_sym
end
|