Sha256: e5ba94f1f5143f318de7f31fb3d67b1087e1c1eefff81b3115f225d4cd8fa643

Contents?: true

Size: 831 Bytes

Versions: 4

Compression:

Stored size: 831 Bytes

Contents

require 'mack-facets'

run_once do

  require File.join_from_here('app')
  
  init_message('helpers')

  module Mack
    module ControllerHelpers # :nodoc:
    end
  
    module ViewHelpers # :nodoc:
    end
  end

  # Find controller level Helpers and include them into their respective controllers
  Mack::ControllerHelpers.constants.each do |cont|
    h = "Mack::ControllerHelpers::#{cont}"
    if Object.const_defined?(cont)
      h.constantize.include_safely_into(cont.constantize)
    else
      Mack.logger.warn("Could not find: #{cont} controller for helper: #{h}")
    end
  end

  # Find view level Helpers and include them into the Mack::Rendering::ViewTemplate
  Mack::ViewHelpers.constants.each do |cont|
    h = "Mack::ViewHelpers::#{cont}".constantize
    Mack::Rendering::ViewTemplate.send(:include, h)
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mack-0.8.2 lib/mack/boot/helpers.rb
mack-0.8.1 lib/mack/boot/helpers.rb
mack-0.8.3 lib/mack/boot/helpers.rb
mack-0.8.3.1 lib/mack/boot/helpers.rb