Module: InterfaceBuilder
- Defined in:
- lib/interface_builder.rb,
lib/interface_builder/theme.rb,
lib/interface_builder/view_helper.rb,
lib/interface_builder/haml_builder.rb,
lib/interface_builder/view_builder.rb,
lib/interface_builder/controller_helper.rb,
lib/interface_builder/form_builders/themed_form_builder.rb,
lib/interface_builder/form_builders/abstract_form_builder.rb,
lib/interface_builder/form_builders/themed_form_tag_builder.rb
Defined Under Namespace
Modules: ControllerHelper, FormBuilders, ViewHelper Classes: HamlBuilder, Theme, ViewBuilder
Class Attribute Summary collapse
-
.plugin_name ⇒ Object
Returns the value of attribute plugin_name.
Class Method Summary collapse
- .available_themes ⇒ Object
-
.dont_wrap_into_placeholder ⇒ Object
Templates that should be wrapped if it doesn’t defined for current theme.
- .generate_helper_methods(*args) ⇒ Object
-
.theme_metadata(theme) ⇒ Object
TODO 3 don’t cache it becouse there’s a lots of text data that will be reside in memory.
- .themes_dir ⇒ Object
Class Attribute Details
.plugin_name ⇒ Object
Returns the value of attribute plugin_name.
19 20 21 |
# File 'lib/interface_builder.rb', line 19 def plugin_name @plugin_name end |
Class Method Details
.available_themes ⇒ Object
25 |
# File 'lib/interface_builder.rb', line 25 def available_themes; @available_themes ||= [] end |
.dont_wrap_into_placeholder ⇒ Object
Templates that should be wrapped if it doesn’t defined for current theme
28 |
# File 'lib/interface_builder.rb', line 28 def dont_wrap_into_placeholder; @dont_wrap_into_placeholder ||= Set.new end |
.generate_helper_methods(*args) ⇒ Object
21 22 23 |
# File 'lib/interface_builder.rb', line 21 def generate_helper_methods *args InterfaceBuilder::ViewBuilder.generate_helper_methods *args end |
.theme_metadata(theme) ⇒ Object
TODO 3 don’t cache it becouse there’s a lots of text data that will be reside in memory.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/interface_builder.rb', line 31 def theme = {} fname = "#{InterfaceBuilder.themes_dir}/#{theme}/metadata.rb" if File.exist? fname code = File.read fname = eval code .should! :be_a, Hash end .to_openobject end |
.themes_dir ⇒ Object
43 44 45 |
# File 'lib/interface_builder.rb', line 43 def themes_dir "#{RAILS_ROOT}/vendor/plugins/#{InterfaceBuilder.plugin_name.should_not_be!(:blank)}/app/views/themes" end |