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/old/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

Overview

TODO2 ActionView::Base.field_error_proc = lambda do |html_tag, instance|

html_tag

end

Defined Under Namespace

Modules: ControllerHelper, FormBuilders, ViewHelper Classes: HamlBuilder, Theme, ViewBuilder

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.layout_configurations_dirObject

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_nameObject

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_themesObject



26
# File 'lib/abstract_interface.rb', line 26

def available_themes; @available_themes ||= [] end

.generate_helper_methods(*args) ⇒ Object



22
23
24
# File 'lib/abstract_interface.rb', line 22

def generate_helper_methods *args
  AbstractInterface::ViewBuilder.generate_helper_methods *args
end

.layout_definitions(theme) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/abstract_interface.rb', line 48

def layout_definitions theme
  name = "#{layout_configurations_dir.should_not_be!(:empty)}/#{theme}.yml"
  raise "File '#{name}' not exist!" unless Crystal::Environment.file_exist? name

  fname = Crystal::Environment.find_file name
  lds = YAML.load_file(fname)
  validate_layout_definition!(lds, theme)
  lds
end

.layouts_defined?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/abstract_interface.rb', line 44

def layouts_defined?
  !!layout_configurations_dir
end

.theme_metadata(theme) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/abstract_interface.rb', line 28

def  theme
  logger.warn "Complex calculation (AbstractInterface.theme_metadata) called in production!" if config.production?
  
   = {}

  name = "#{dir}/#{Crystal::Template::DIRECTORY_NAME}/#{theme}/metadata.rb"
  if Crystal::Environment.file_exist? name
    fname = Crystal::Environment.find_file name
    code = File.read fname
     = eval code
    .should! :be_a, Hash        
  end
  
  .to_openobject
end