Module: Mutton::Config
- Included in:
- Mutton
- Defined in:
- lib/mutton/config.rb
Instance Attribute Summary collapse
-
#handlebars_file ⇒ Object
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.
-
#javascript_asset_path ⇒ Object
writeonly
Sets the attribute javascript_asset_path.
-
#logger ⇒ Object
provide a custom logger if you are magically using this from outside rails.
-
#template_namespace ⇒ Object
javascript namespace for compiled templates templates will be accessed by this value JHT.
-
#template_path ⇒ Object
path to templates directory.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#default_template_path ⇒ Object
shipped default path.
-
#helper_path ⇒ Object
path to javascript helpers every javascript file in this directory will be concatenated with handlebars during compilation.
-
#sprockets_path ⇒ Object
sprockets needs to know where hbs files are stored its 1 up from the template path in sprockets-speak.
-
#subscribe_notifications ⇒ Object
(also: #subscribe_notifications?)
when true, instrumentation will be logged at debug level.
-
#vendor_version ⇒ Object
shipped version of handlebars.
Instance Attribute Details
#handlebars_file ⇒ Object
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
38 39 40 41 |
# File 'lib/mutton/config.rb', line 38 def # don't want to force the user to serve my handlebars.js from sprockets so... @handlebars_file ||= File.('../../../vendor/assets/javascripts/mutton/handlebars.js', __FILE__) end |
#javascript_asset_path=(value) ⇒ Object (writeonly)
Sets the attribute javascript_asset_path
3 4 5 |
# File 'lib/mutton/config.rb', line 3 def javascript_asset_path=(value) @javascript_asset_path = value end |
#logger ⇒ Object
provide a custom logger if you are magically using this from outside rails. logger is set during engine configuration ti Rails.logger
8 9 10 |
# File 'lib/mutton/config.rb', line 8 def logger @logger end |
#template_namespace ⇒ Object
javascript namespace for compiled templates templates will be accessed by this value JHT
30 31 32 |
# File 'lib/mutton/config.rb', line 30 def template_namespace @template_namespace ||= 'JHT' end |
#template_path ⇒ Object
path to templates directory
15 16 17 18 |
# 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 |
Instance Method Details
#configure {|_self| ... } ⇒ Object
10 11 12 |
# File 'lib/mutton/config.rb', line 10 def configure yield self end |
#default_template_path ⇒ Object
shipped default path
59 60 61 62 |
# 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 |
#helper_path ⇒ Object
path to javascript helpers every javascript file in this directory will be concatenated with handlebars during compilation
23 24 25 |
# File 'lib/mutton/config.rb', line 23 def helper_path @helper_path ||= File.join(Mutton.template_path, 'helpers') end |
#sprockets_path ⇒ Object
sprockets needs to know where hbs files are stored its 1 up from the template path in sprockets-speak
54 55 56 |
# File 'lib/mutton/config.rb', line 54 def sprockets_path File.('../', Mutton.template_path) end |
#subscribe_notifications ⇒ Object Also known as: subscribe_notifications?
when true, instrumentation will be logged at debug level
44 45 46 |
# File 'lib/mutton/config.rb', line 44 def subscribe_notifications @subscribe_notifications ||= true end |
#vendor_version ⇒ Object
shipped version of handlebars
65 66 67 |
# File 'lib/mutton/config.rb', line 65 def vendor_version 'v3.0.3' end |