Module: HandlebarsAssets::Config
Overview
Change config options in an initializer:
HandlebarsAssets::Config.path_prefix = ‘app/templates’
Instance Attribute Summary collapse
-
#amd ⇒ Object
writeonly
Sets the attribute amd.
-
#amd_with_template_namespace ⇒ Object
indicate whether the template should be added to the global template namespace.
-
#chomp_underscore_for_partials ⇒ Object
writeonly
Sets the attribute chomp_underscore_for_partials.
- #compiler ⇒ Object
- #compiler_path ⇒ Object
-
#ember ⇒ Object
writeonly
Sets the attribute ember.
-
#haml_enabled ⇒ Object
writeonly
Sets the attribute haml_enabled.
- #haml_options ⇒ Object
- #hamlbars_extensions ⇒ Object
-
#handlebars_amd_path ⇒ Object
path specified by the require.js paths during configuration for the handlebars.
- #handlebars_extensions ⇒ Object
- #known_helpers ⇒ Object
- #known_helpers_only ⇒ Object
-
#multiple_frameworks ⇒ Object
writeonly
Sets the attribute multiple_frameworks.
- #options ⇒ Object
- #patch_files ⇒ Object
- #patch_path ⇒ Object
- #path_prefix ⇒ Object
- #precompile ⇒ Object
-
#slim_enabled ⇒ Object
writeonly
Sets the attribute slim_enabled.
- #slim_options ⇒ Object
- #slimbars_extensions ⇒ Object
- #template_namespace ⇒ Object
Class Method Summary collapse
Instance Method Summary collapse
- #amd? ⇒ Boolean
-
#chomp_underscore_for_partials? ⇒ Boolean
Indicate if leading underscore should be allowed when creating partial definition.
- #ember? ⇒ Boolean
- #ember_extensions ⇒ Object
- #haml_available? ⇒ Boolean
- #haml_enabled? ⇒ Boolean
- #multiple_frameworks? ⇒ Boolean
- #slim_available? ⇒ Boolean
- #slim_enabled? ⇒ Boolean
Instance Attribute Details
#amd=(value) ⇒ Object (writeonly)
Sets the attribute amd
9 10 11 |
# File 'lib/handlebars_assets/config.rb', line 9 def amd=(value) @amd = value end |
#amd_with_template_namespace ⇒ Object
indicate whether the template should be added to the global template namespace
119 120 121 |
# File 'lib/handlebars_assets/config.rb', line 119 def amd_with_template_namespace @amd_with_template_namespace || false end |
#chomp_underscore_for_partials=(value) ⇒ Object (writeonly)
Sets the attribute chomp_underscore_for_partials
9 10 11 |
# File 'lib/handlebars_assets/config.rb', line 9 def chomp_underscore_for_partials=(value) @chomp_underscore_for_partials = value end |
#compiler ⇒ Object
17 18 19 |
# File 'lib/handlebars_assets/config.rb', line 17 def compiler @compiler || 'handlebars.js' end |
#compiler_path ⇒ Object
25 26 27 |
# File 'lib/handlebars_assets/config.rb', line 25 def compiler_path @compiler_path || HandlebarsAssets.path end |
#ember=(value) ⇒ Object (writeonly)
Sets the attribute ember
9 10 11 |
# File 'lib/handlebars_assets/config.rb', line 9 def ember=(value) @ember = value end |
#haml_enabled=(value) ⇒ Object (writeonly)
Sets the attribute haml_enabled
9 10 11 |
# File 'lib/handlebars_assets/config.rb', line 9 def haml_enabled=(value) @haml_enabled = value end |
#haml_options ⇒ Object
46 47 48 |
# File 'lib/handlebars_assets/config.rb', line 46 def @haml_options || {} end |
#hamlbars_extensions ⇒ Object
101 102 103 |
# File 'lib/handlebars_assets/config.rb', line 101 def @hamlbars_extensions ||= ['.hamlbars'] end |
#handlebars_amd_path ⇒ Object
path specified by the require.js paths during configuration for the handlebars
125 126 127 |
# File 'lib/handlebars_assets/config.rb', line 125 def @handlebars_amd_path || 'handlebars' end |
#handlebars_extensions ⇒ Object
97 98 99 |
# File 'lib/handlebars_assets/config.rb', line 97 def @hbs_extensions ||= ['.hbs', '.handlebars'] end |
#known_helpers ⇒ Object
63 64 65 |
# File 'lib/handlebars_assets/config.rb', line 63 def known_helpers @known_helpers || [] end |
#known_helpers_only ⇒ Object
67 68 69 70 |
# File 'lib/handlebars_assets/config.rb', line 67 def known_helpers_only @known_helpers_only = false if @known_helpers_only.nil? @known_helpers_only end |
#multiple_frameworks=(value) ⇒ Object (writeonly)
Sets the attribute multiple_frameworks
9 10 11 |
# File 'lib/handlebars_assets/config.rb', line 9 def multiple_frameworks=(value) @multiple_frameworks = value end |
#options ⇒ Object
72 73 74 |
# File 'lib/handlebars_assets/config.rb', line 72 def @options ||= end |
#patch_files ⇒ Object
76 77 78 |
# File 'lib/handlebars_assets/config.rb', line 76 def patch_files Array(@patch_files) end |
#patch_path ⇒ Object
80 81 82 |
# File 'lib/handlebars_assets/config.rb', line 80 def patch_path @patch_path ||= compiler_path end |
#path_prefix ⇒ Object
84 85 86 |
# File 'lib/handlebars_assets/config.rb', line 84 def path_prefix @path_prefix ||= 'templates' end |
#precompile ⇒ Object
88 89 90 91 |
# File 'lib/handlebars_assets/config.rb', line 88 def precompile @precompile = true if @precompile.nil? @precompile end |
#slim_enabled=(value) ⇒ Object (writeonly)
Sets the attribute slim_enabled
9 10 11 |
# File 'lib/handlebars_assets/config.rb', line 9 def slim_enabled=(value) @slim_enabled = value end |
#slim_options ⇒ Object
59 60 61 |
# File 'lib/handlebars_assets/config.rb', line 59 def @slim_options || {} end |
#slimbars_extensions ⇒ Object
105 106 107 |
# File 'lib/handlebars_assets/config.rb', line 105 def @slimbars_extensions ||= ['.slimbars'] end |
#template_namespace ⇒ Object
93 94 95 |
# File 'lib/handlebars_assets/config.rb', line 93 def template_namespace @template_namespace || 'HandlebarsTemplates' end |
Class Method Details
.configure {|_self| ... } ⇒ Object
21 22 23 |
# File 'lib/handlebars_assets/config.rb', line 21 def self.configure yield self end |
Instance Method Details
#amd? ⇒ Boolean
113 114 115 |
# File 'lib/handlebars_assets/config.rb', line 113 def amd? @amd || false end |
#chomp_underscore_for_partials? ⇒ Boolean
Indicate if leading underscore should be allowed when creating partial definition. Allows compatibility with handlebars-rails github.com/cowboyd/handlebars-rails/blob/f73a2d11df8aa2c21d335b8f04a8c5b59ae6a790/lib/handlebars-rails/tilt.rb#L18
133 134 135 |
# File 'lib/handlebars_assets/config.rb', line 133 def chomp_underscore_for_partials? @chomp_underscore_for_partials || false end |
#ember? ⇒ Boolean
29 30 31 |
# File 'lib/handlebars_assets/config.rb', line 29 def ember? @ember || false end |
#ember_extensions ⇒ Object
109 110 111 |
# File 'lib/handlebars_assets/config.rb', line 109 def ember_extensions @ember_extensions ||= ['.ember'] end |
#haml_available? ⇒ Boolean
37 38 39 |
# File 'lib/handlebars_assets/config.rb', line 37 def haml_available? defined? ::Haml::Engine end |
#haml_enabled? ⇒ Boolean
41 42 43 44 |
# File 'lib/handlebars_assets/config.rb', line 41 def haml_enabled? @haml_enabled = true if @haml_enabled.nil? @haml_enabled end |
#multiple_frameworks? ⇒ Boolean
33 34 35 |
# File 'lib/handlebars_assets/config.rb', line 33 def multiple_frameworks? @multiple_frameworks end |
#slim_available? ⇒ Boolean
50 51 52 |
# File 'lib/handlebars_assets/config.rb', line 50 def slim_available? defined? ::Slim::Engine end |
#slim_enabled? ⇒ Boolean
54 55 56 57 |
# File 'lib/handlebars_assets/config.rb', line 54 def slim_enabled? @slim_enabled = true if @slim_enabled.nil? @slim_enabled end |