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

Class Method Summary collapse

Class Attribute Details

.plugin_nameObject

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_themesObject



25
# File 'lib/interface_builder.rb', line 25

def available_themes; @available_themes ||= [] end

.dont_wrap_into_placeholderObject

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_dirObject



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