summaryrefslogtreecommitdiff
path: root/app/helpers/webpack_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/webpack_helper.rb')
-rw-r--r--app/helpers/webpack_helper.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/app/helpers/webpack_helper.rb b/app/helpers/webpack_helper.rb
index 345ddcf023a..7f6a3f775cd 100644
--- a/app/helpers/webpack_helper.rb
+++ b/app/helpers/webpack_helper.rb
@@ -9,17 +9,17 @@ module WebpackHelper
chunks = []
action = case controller.action_name
- when 'create' then 'new'
- when 'update' then 'edit'
+ when "create" then "new"
+ when "update" then "edit"
else controller.action_name
- end
+ end
- route = [*controller.controller_path.split('/'), action].compact
+ route = [*controller.controller_path.split("/"), action].compact
until chunks.any? || route.empty?
- entrypoint = "pages.#{route.join('.')}"
+ entrypoint = "pages.#{route.join(".")}"
begin
- chunks = webpack_entrypoint_paths(entrypoint, extension: 'js')
+ chunks = webpack_entrypoint_paths(entrypoint, extension: "js")
rescue Gitlab::Webpack::Manifest::AssetMissingError
# no bundle exists for this path
end
@@ -27,7 +27,7 @@ module WebpackHelper
end
if chunks.empty?
- chunks = webpack_entrypoint_paths("default", extension: 'js')
+ chunks = webpack_entrypoint_paths("default", extension: "js")
end
javascript_include_tag(*chunks)
@@ -60,16 +60,16 @@ module WebpackHelper
if Rails.env.test? && Rails.configuration.webpack.dev_server.enabled
host = Rails.configuration.webpack.dev_server.host
port = Rails.configuration.webpack.dev_server.port
- protocol = Rails.configuration.webpack.dev_server.https ? 'https' : 'http'
+ protocol = Rails.configuration.webpack.dev_server.https ? "https" : "http"
"#{protocol}://#{host}:#{port}"
else
- ActionController::Base.asset_host.try(:chomp, '/')
+ ActionController::Base.asset_host.try(:chomp, "/")
end
end
def webpack_public_path
relative_path = Rails.application.config.relative_url_root
webpack_path = Rails.application.config.webpack.public_path
- File.join(webpack_public_host.to_s, relative_path.to_s, webpack_path.to_s, '')
+ File.join(webpack_public_host.to_s, relative_path.to_s, webpack_path.to_s, "")
end
end