Module: AbstractInterface
- Defined in:
- lib/abstract_interface.rb,
lib/abstract_interface/theme.rb,
lib/abstract_interface/view_helper.rb,
lib/abstract_interface/haml_builder.rb,
lib/abstract_interface/view_builder.rb,
lib/abstract_interface/controller_helper.rb,
lib/abstract_interface/form_builders/themed_form_builder.rb,
lib/abstract_interface/form_builders/abstract_form_builder.rb,
lib/abstract_interface/form_builders/themed_form_tag_builder.rb
Defined Under Namespace
Modules: ControllerHelper, FormBuilders, ViewHelper
Classes: HamlBuilder, Theme, ViewBuilder
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.layout_configurations_dir ⇒ Object
Returns the value of attribute layout_configurations_dir.
20
21
22
|
# File 'lib/abstract_interface.rb', line 20
def layout_configurations_dir
@layout_configurations_dir
end
|
.plugin_name ⇒ Object
Returns the value of attribute plugin_name.
19
20
21
|
# File 'lib/abstract_interface.rb', line 19
def plugin_name
@plugin_name
end
|
Class Method Details
.available_themes ⇒ Object
26
|
# File 'lib/abstract_interface.rb', line 26
def available_themes; @available_themes ||= [] end
|
.generate_helper_methods(*args) ⇒ Object
.layout_definitions(theme) ⇒ Object
52
53
54
55
56
57
58
|
# File 'lib/abstract_interface.rb', line 52
def layout_definitions theme
fname = "#{layout_configurations_dir.should_not_be!(:empty)}/#{theme}.yml"
File.should! :exist?, fname
lds = YAML.load_file(fname)
validate_layout_definition!(lds, theme)
lds
end
|
.layouts_defined? ⇒ Boolean
48
49
50
|
# File 'lib/abstract_interface.rb', line 48
def layouts_defined?
!!layout_configurations_dir
end
|
TODO 3 don’t cache it becouse there’s a lots of text data that will be reside in memory.
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/abstract_interface.rb', line 32
def theme_metadata theme
metadata = {}
fname = "#{AbstractInterface.themes_dir}/#{theme}/metadata.rb"
if File.exist? fname
code = File.read fname
metadata = eval code
metadata.should! :be_a, Hash
end
metadata.to_openobject
end
|
.themes_dir ⇒ Object
44
45
46
|
# File 'lib/abstract_interface.rb', line 44
def themes_dir
"#{RAILS_ROOT}/vendor/plugins/#{AbstractInterface.plugin_name.should_not_be!(:blank)}/app/views/themes"
end
|