lib/sewing_kit/railtie.rb in sewing_kit-0.130.0 vs lib/sewing_kit/railtie.rb in sewing_kit-0.130.1
- old
+ new
@@ -1,20 +1,20 @@
# frozen_string_literal: true
-require 'rails'
-require 'rails/railtie'
-require 'sewing_kit/webpack/compiler'
-require 'sewing_kit/webpack/helper'
-require 'sewing_kit/webpack/dev'
-require 'sewing_kit/webpack/server'
+require "rails"
+require "rails/railtie"
+require "sewing_kit/webpack/compiler"
+require "sewing_kit/webpack/helper"
+require "sewing_kit/webpack/dev"
+require "sewing_kit/webpack/server"
+
module SewingKit
class Railtie < ::Rails::Railtie
- # rubocop:disable Metrics/BlockLength
config.after_initialize do
- is_development = Rails.env.development? && ENV['SK_SIMULATE_PRODUCTION'] != '1'
- if is_development && (Rails.const_defined?(:Server) || ENV['SK_FORCE_DEV_SERVER'])
+ is_development = Rails.env.development? && ENV["SK_SIMULATE_PRODUCTION"] != "1"
+ if is_development && (Rails.const_defined?(:Server) || ENV["SK_FORCE_DEV_SERVER"])
webpack_dev = SewingKit::Webpack::Dev.new
webpack_dev.start
end
ActiveSupport.on_load(:action_controller) do
@@ -23,11 +23,9 @@
ActiveSupport.on_load(:action_view) do
include SewingKit::Webpack::Helper
end
end
- # rubocop:enable Metrics/BlockLength
-
rake_tasks do
load "tasks/sewing_kit.rake"
end
end
end