Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRiedler committed Dec 16, 2024
1 parent 8224c07 commit 5db35a5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 39 deletions.
22 changes: 12 additions & 10 deletions gemfiles/sprockets_4_0.gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "http://rubygems.org"
source 'http://rubygems.org'

gem "appraisal"
gem "haml", "~> 6.3"
gem "slim", "~> 5.2"
gem "minitest", "~> 5.25"
gem "rake", "~> 13.2"
gem "rubocop", require: false
gem "rubocop-rake", require: false
gem "sprockets", "4.0.3"
gem 'appraisal'
gem 'haml', '~> 6.3'
gem 'minitest', '~> 5.25'
gem 'rake', '~> 13.2'
gem 'rubocop', require: false
gem 'rubocop-rake', require: false
gem 'slim', '~> 5.2'
gem 'sprockets', '4.0.3'

gemspec path: "../"
gemspec path: '../'
22 changes: 12 additions & 10 deletions gemfiles/sprockets_4_1.gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "http://rubygems.org"
source 'http://rubygems.org'

gem "appraisal"
gem "haml", "~> 6.3"
gem "slim", "~> 5.2"
gem "minitest", "~> 5.25"
gem "rake", "~> 13.2"
gem "rubocop", require: false
gem "rubocop-rake", require: false
gem "sprockets", "4.1.1"
gem 'appraisal'
gem 'haml', '~> 6.3'
gem 'minitest', '~> 5.25'
gem 'rake', '~> 13.2'
gem 'rubocop', require: false
gem 'rubocop-rake', require: false
gem 'slim', '~> 5.2'
gem 'sprockets', '4.1.1'

gemspec path: "../"
gemspec path: '../'
22 changes: 12 additions & 10 deletions gemfiles/sprockets_4_2.gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "http://rubygems.org"
source 'http://rubygems.org'

gem "appraisal"
gem "haml", "~> 6.3"
gem "slim", "~> 5.2"
gem "minitest", "~> 5.25"
gem "rake", "~> 13.2"
gem "rubocop", require: false
gem "rubocop-rake", require: false
gem "sprockets", "4.2.1"
gem 'appraisal'
gem 'haml', '~> 6.3'
gem 'minitest', '~> 5.25'
gem 'rake', '~> 13.2'
gem 'rubocop', require: false
gem 'rubocop-rake', require: false
gem 'slim', '~> 5.2'
gem 'sprockets', '4.2.1'

gemspec path: "../"
gemspec path: '../'
16 changes: 8 additions & 8 deletions lib/handlebars_assets/handlebars_template.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'English'
require 'json'

module HandlebarsAssets
Expand Down Expand Up @@ -88,17 +89,16 @@ def choose_engine(data)

def compile(source)
# remove trailing \n on file, for some reason the directives pipeline adds this
trim_source = source.chomp($/)
trim_source = source.chomp($INPUT_RECORD_SEPARATOR)

# handle the case of multiple frameworks combined with ember
# DEFER: use extension setup for ember
data =
if (HandlebarsAssets::Config.multiple_frameworks? && @template_path.ember?) ||
(HandlebarsAssets::Config.ember? && !HandlebarsAssets::Config.multiple_frameworks?)
compile_ember(trim_source)
else
compile_default(trim_source)
end
if (HandlebarsAssets::Config.multiple_frameworks? && @template_path.ember?) ||
(HandlebarsAssets::Config.ember? && !HandlebarsAssets::Config.multiple_frameworks?)
compile_ember(trim_source)
else
compile_default(trim_source)
end
end

def compile_ember(source)
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module CompilerSupport

def compile_hbs(source)
compiler_src = Pathname(HandlebarsAssets::Config.compiler_path).join(HandlebarsAssets::Config.compiler).read
ExecJS.compile("#{compiler_src}").call('Handlebars.precompile', source, HandlebarsAssets::Config.options)
ExecJS.compile(compiler_src.to_s).call('Handlebars.precompile', source, HandlebarsAssets::Config.options)
end

def hbs_compiled(template_name, source)
Expand Down

0 comments on commit 5db35a5

Please sign in to comment.