lib/sewing_kit/webpack/manifest/development.rb in sewing_kit-0.130.0 vs lib/sewing_kit/webpack/manifest/development.rb in sewing_kit-0.130.1
- old
+ new
@@ -1,27 +1,28 @@
# frozen_string_literal: true
-require 'sewing_kit/webpack/manifest/base'
+require "sewing_kit/webpack/manifest/base"
+
module SewingKit
module Webpack
class Manifest
class Development < Base
def initialize
super
@metadata_path = nil
end
def asset_bundle_name(_user_agent)
- 'dev'
+ "dev"
end
def asset_dependencies(entrypoint_name, _user_agent)
current_metadata = metadata
- if current_metadata.key?('development')
- current_metadata['development']['hangTight']
+ if current_metadata.key?("development")
+ current_metadata["development"]["hangTight"]
else
- current_metadata['entrypoints'][entrypoint_name]
+ current_metadata["entrypoints"][entrypoint_name]
end
end
def clear_cache!
super
@@ -50,11 +51,11 @@
end
result = load_metadata_from_node
metadata = normalize_metadata(result)
- @metadata_path = metadata && metadata['path']
+ @metadata_path = metadata && metadata["path"]
metadata
end
private
@@ -67,14 +68,14 @@
end
def load_metadata_from_node
begin
stdout, stderr, status = Open3.capture3(
- 'node_modules/.bin/sewing-kit', 'manifest', "--mode=development"
+ "node_modules/.bin/sewing-kit", "manifest", "--mode=development"
)
rescue => e
- raise NodeSewingKitNotRunnable.new('development', e)
+ raise NodeSewingKitNotRunnable.new("development", e)
end
raise NodeSewingKitManifestMissing, stderr unless status.success?
parse_metadata(stdout)
@@ -82,10 +83,10 @@
end
class OnlyUseInProductionError < StandardError
def initialize
super("The SewingKit::Webpack::Manifest#manifest is intended "\
- "for deploying assets to a CDN. Do not use it in development.")
+ "for deploying assets to a CDN. Do not use it in development.")
end
end
end
end
end