Sha256: ee485d60529ec277a470207da3e717434e8ac13a96942af3b5bd0bf48e898d92
Contents?: true
Size: 593 Bytes
Versions: 18
Compression:
Stored size: 593 Bytes
Contents
class Module def include_all_modules_from(parent_module) parent_module.constants.each do |const| mod = parent_module.const_get(const) if mod.class == Module send(:include, mod) include_all_modules_from(mod) end end end end def helper(*helper_names) returning @helper_proxy ||= Object.new do |helper| helper_names.each { |h| helper.extend "#{h}_helper".classify.constantize } end end require 'application' class << helper include_all_modules_from ActionView end @controller = ApplicationController.new helper :application rescue nil
Version data entries
18 entries across 18 versions & 5 rubygems