lib/hanami/assets/compiler.rb in hanami-assets-1.3.4 vs lib/hanami/assets/compiler.rb in hanami-assets-1.3.5
- old
+ new
@@ -1,15 +1,17 @@
-require 'set'
-require 'find'
-require 'hanami/utils/class_attribute'
+# frozen_string_literal: true
+require "set"
+require "find"
+require "hanami/utils/class_attribute"
+
module Hanami
module Assets
# Missing Asset error
class MissingAsset < Error
def initialize(name, sources)
- sources = sources.map(&:to_s).join(', ')
+ sources = sources.map(&:to_s).join(", ")
super("Missing asset: `#{name}' (sources: #{sources})")
end
end
# Unknown Asset Engine error
@@ -26,22 +28,22 @@
#
# Vanilla javascripts or stylesheets are just copied over.
#
# @since 0.1.0
# @api private
- class Compiler # rubocop:disable Metrics/ClassLength
+ class Compiler
# @since 0.1.0
# @api private
DEFAULT_PERMISSIONS = 0o644
# @since 0.1.0
# @api private
- COMPILE_PATTERN = '*.*.*'.freeze # Example hello.js.es6
+ COMPILE_PATTERN = "*.*.*" # Example hello.js.es6
# @since 0.1.0
# @api private
- EXTENSIONS = { '.js' => true, '.css' => true, '.map' => true }.freeze
+ EXTENSIONS = {".js" => true, ".css" => true, ".map" => true}.freeze
include Utils::ClassAttribute
# @since 0.3.0
# @api private
@@ -65,13 +67,13 @@
# @since 0.1.0
# @api private
def self.compile(configuration, name)
return unless configuration.compile
- require 'tilt'
- require 'hanami/assets/cache'
- require 'hanami/assets/compilers/sass'
- require 'hanami/assets/compilers/less'
+ require "tilt"
+ require "hanami/assets/cache"
+ require "hanami/assets/compilers/sass"
+ require "hanami/assets/compilers/less"
fabricate(configuration, name).compile
end
# @since 0.3.0
# @api private