From 9f64d45defbbf6253e68bd0d7c694af8e1572937 Mon Sep 17 00:00:00 2001 From: Alex Riedler Date: Sun, 15 Dec 2024 18:42:14 -0500 Subject: [PATCH] chore: rename functions --- lib/handlebars_assets/handlebars_template.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/handlebars_assets/handlebars_template.rb b/lib/handlebars_assets/handlebars_template.rb index 1f3ba1e..4ea19ea 100644 --- a/lib/handlebars_assets/handlebars_template.rb +++ b/lib/handlebars_assets/handlebars_template.rb @@ -104,9 +104,9 @@ def initialize(options) end def choose_engine(data) - if @template_path.is_haml? + if @template_path.haml? Haml::Template.new(HandlebarsAssets::Config.haml_options) { data } - elsif @template_path.is_slim? + elsif @template_path.slim? Slim::Template.new(HandlebarsAssets::Config.slim_options) { data } else NoOpEngine.new(data) @@ -119,7 +119,7 @@ def compile(source) # handle the case of multiple frameworks combined with ember # DEFER: use extension setup for ember - if (HandlebarsAssets::Config.multiple_frameworks? && @template_path.is_ember?) || + if (HandlebarsAssets::Config.multiple_frameworks? && @template_path.ember?) || (HandlebarsAssets::Config.ember? && !HandlebarsAssets::Config.multiple_frameworks?) compile_ember(trim_source) else @@ -145,7 +145,7 @@ def compile_default(source) if HandlebarsAssets::Config.amd? handlebars_amd_path = HandlebarsAssets::Config.handlebars_amd_path if HandlebarsAssets::Config.amd_with_template_namespace - if @template_path.is_partial? + if @template_path.partial? unindent <<-PARTIAL define(['#{handlebars_amd_path}'],function(Handlebars){ var t = #{template}; @@ -160,7 +160,7 @@ def compile_default(source) }); TEMPLATE end - elsif @template_path.is_partial? + elsif @template_path.partial? unindent <<-PARTIAL define(['#{handlebars_amd_path}'],function(Handlebars){ var t = #{template}; @@ -177,7 +177,7 @@ def compile_default(source) }); TEMPLATE end - elsif @template_path.is_partial? + elsif @template_path.partial? unindent <<-PARTIAL (function() { Handlebars.registerPartial(#{@template_path.name}, #{template}); @@ -246,7 +246,7 @@ def name def relative_path path = @full_path.match(%r{.*#{HandlebarsAssets::Config.path_prefix}/((.*/)*([^.]*)).*$})[1] - if is_partial? && ::HandlebarsAssets::Config.chomp_underscore_for_partials? + if partial? && ::HandlebarsAssets::Config.chomp_underscore_for_partials? # handle case if partial is in root level of template folder path.gsub!(/^_/, '') # handle case if partial is in a subfolder within the template folder