Sha256: 0dda154a96971edb6c02594d02871a8f35c69dd4c0242ed92e92cf77dc7209bc
Contents?: true
Size: 452 Bytes
Versions: 23
Compression:
Stored size: 452 Bytes
Contents
module StaticMatic::HelpersMixin # Loads any helpers present in the helpers dir and mixes them into the template helpers def load_helpers Dir["#{@src_dir}/helpers/**/*_helper.rb"].each do |helper| load_helper(helper) end end def load_helper(helper) load helper module_name = File.basename(helper, '.rb').gsub(/(^|\_)./) { |c| c.upcase }.gsub(/\_/, '') Haml::Helpers.class_eval("include #{module_name}") end end
Version data entries
23 entries across 23 versions & 3 rubygems