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.
- #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
- #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
118 119 120 |
# File 'lib/handlebars_assets/config.rb', line 118 def amd_with_template_namespace @amd_with_template_namespace || false end |
#compiler ⇒ Object
16 17 18 |
# File 'lib/handlebars_assets/config.rb', line 16 def compiler @compiler || 'handlebars.js' end |
#compiler_path ⇒ Object
24 25 26 |
# File 'lib/handlebars_assets/config.rb', line 24 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
45 46 47 |
# File 'lib/handlebars_assets/config.rb', line 45 def @haml_options || {} end |
#hamlbars_extensions ⇒ Object
100 101 102 |
# File 'lib/handlebars_assets/config.rb', line 100 def @hamlbars_extensions ||= ['.hamlbars'] end |
#handlebars_amd_path ⇒ Object
path specified by the require.js paths during configuration for the handlebars
124 125 126 |
# File 'lib/handlebars_assets/config.rb', line 124 def @handlebars_amd_path || 'handlebars' end |
#handlebars_extensions ⇒ Object
96 97 98 |
# File 'lib/handlebars_assets/config.rb', line 96 def @hbs_extensions ||= ['.hbs', '.handlebars'] end |
#known_helpers ⇒ Object
62 63 64 |
# File 'lib/handlebars_assets/config.rb', line 62 def known_helpers @known_helpers || [] end |
#known_helpers_only ⇒ Object
66 67 68 69 |
# File 'lib/handlebars_assets/config.rb', line 66 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
71 72 73 |
# File 'lib/handlebars_assets/config.rb', line 71 def @options ||= end |
#patch_files ⇒ Object
75 76 77 |
# File 'lib/handlebars_assets/config.rb', line 75 def patch_files Array(@patch_files) end |
#patch_path ⇒ Object
79 80 81 |
# File 'lib/handlebars_assets/config.rb', line 79 def patch_path @patch_path ||= compiler_path end |
#path_prefix ⇒ Object
83 84 85 |
# File 'lib/handlebars_assets/config.rb', line 83 def path_prefix @path_prefix ||= 'templates' end |
#precompile ⇒ Object
87 88 89 90 |
# File 'lib/handlebars_assets/config.rb', line 87 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
58 59 60 |
# File 'lib/handlebars_assets/config.rb', line 58 def @slim_options || {} end |
#slimbars_extensions ⇒ Object
104 105 106 |
# File 'lib/handlebars_assets/config.rb', line 104 def @slimbars_extensions ||= ['.slimbars'] end |
#template_namespace ⇒ Object
92 93 94 |
# File 'lib/handlebars_assets/config.rb', line 92 def template_namespace @template_namespace || 'HandlebarsTemplates' end |
Class Method Details
.configure {|_self| ... } ⇒ Object
20 21 22 |
# File 'lib/handlebars_assets/config.rb', line 20 def self.configure yield self end |
Instance Method Details
#amd? ⇒ Boolean
112 113 114 |
# File 'lib/handlebars_assets/config.rb', line 112 def amd? @amd || false end |
#ember? ⇒ Boolean
28 29 30 |
# File 'lib/handlebars_assets/config.rb', line 28 def ember? @ember || false end |
#ember_extensions ⇒ Object
108 109 110 |
# File 'lib/handlebars_assets/config.rb', line 108 def ember_extensions @ember_extensions ||= ['.ember'] end |
#haml_available? ⇒ Boolean
36 37 38 |
# File 'lib/handlebars_assets/config.rb', line 36 def haml_available? defined? ::Haml::Engine end |
#haml_enabled? ⇒ Boolean
40 41 42 43 |
# File 'lib/handlebars_assets/config.rb', line 40 def haml_enabled? @haml_enabled = true if @haml_enabled.nil? @haml_enabled end |
#multiple_frameworks? ⇒ Boolean
32 33 34 |
# File 'lib/handlebars_assets/config.rb', line 32 def multiple_frameworks? @multiple_frameworks end |
#slim_available? ⇒ Boolean
49 50 51 |
# File 'lib/handlebars_assets/config.rb', line 49 def slim_available? defined? ::Slim::Engine end |
#slim_enabled? ⇒ Boolean
53 54 55 56 |
# File 'lib/handlebars_assets/config.rb', line 53 def slim_enabled? @slim_enabled = true if @slim_enabled.nil? @slim_enabled end |