module Mutton::Config
Attributes
handlebars_file[W]
javascript_asset_path[W]
logger[RW]
provide a custom logger if you are magically using this from outside rails. logger is set during engine configuration ti Rails.logger
template_namespace[W]
template_path[W]
Public Instance Methods
configure() { |self| ... }
click to toggle source
# File lib/mutton/config.rb, line 10 def configure yield self end
default_template_path()
click to toggle source
shipped default path
# File lib/mutton/config.rb, line 59 def default_template_path # Rails.root.join('app', 'handlebars', 'templates') Rails.root.join('app', 'assets', 'javascripts', 'templates') end
handlebars_file()
click to toggle source
handlebars file for compilation change this if you want to use a beta or other version you dont need to wait for a gem update if handlebars releases a new version
# File lib/mutton/config.rb, line 38 def handlebars_file # don't want to force the user to serve my handlebars.js from sprockets so... @handlebars_file ||= File.expand_path('../../../vendor/assets/javascripts/mutton/handlebars.js', __FILE__) end
helper_path()
click to toggle source
path to javascript helpers every javascript file in this directory will be concatenated with handlebars during compilation
# File lib/mutton/config.rb, line 23 def helper_path @helper_path ||= File.join(Mutton.template_path, 'helpers') end
sprockets_path()
click to toggle source
sprockets needs to know where hbs files are stored its 1 up from the template path in sprockets-speak
# File lib/mutton/config.rb, line 54 def sprockets_path File.expand_path('../', Mutton.template_path) end
subscribe_notifications()
click to toggle source
when true, instrumentation will be logged at debug level
# File lib/mutton/config.rb, line 44 def subscribe_notifications @subscribe_notifications ||= true end
Also aliased as: subscribe_notifications?
template_namespace()
click to toggle source
javascript namespace for compiled templates templates will be accessed by this value JHT
# File lib/mutton/config.rb, line 30 def template_namespace @template_namespace ||= 'JHT' end
template_path()
click to toggle source
path to templates directory
# File lib/mutton/config.rb, line 15 def template_path @template_path ||= Rails.root.join('app', 'assets', 'javascripts', 'templates') # @template_path ||= Rails.root.join('app', 'handlebars', 'templates') end
vendor_version()
click to toggle source
shipped version of handlebars
# File lib/mutton/config.rb, line 65 def vendor_version 'v3.0.3' end