Skip to content

Business intelligence made simple

Added support for Sprockets 4

Andrew Kanec68212650944
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1f75ad16..340aaa05 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
## 2.2.1 [unreleased]
+- Added support for Sprockets 4
- Improved Snowflake table preview
- Fixed bug with refresh link not showing
diff --git a/app/assets/stylesheets/blazer/application.css b/app/assets/stylesheets/blazer/application.css
index 07b1d368..4cb57fe8 100644
--- a/app/assets/stylesheets/blazer/application.css
+++ b/app/assets/stylesheets/blazer/application.css
@@ -1,6 +1,6 @@
/*
*= require ./bootstrap
- *= require ./selectize.default
+ *= require ./selectize
*= require ./github
*= require ./daterangepicker
*= require_self
diff --git a/app/assets/stylesheets/blazer/selectize.default.css b/app/assets/stylesheets/blazer/selectize.css
similarity index 100%
rename from app/assets/stylesheets/blazer/selectize.default.css
rename to app/assets/stylesheets/blazer/selectize.css
diff --git a/lib/blazer/engine.rb b/lib/blazer/engine.rb
index bf7ffec6..f2ad09d7 100644
--- a/lib/blazer/engine.rb
+++ b/lib/blazer/engine.rb
@@ -2,11 +2,22 @@ module Blazer
class Engine < ::Rails::Engine
isolate_namespace Blazer
- initializer "blazer" do |app|
- # use a proc instead of a string
- app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }
- app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff)\z/ }
- app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" }
+ initializer "blazer", group: :all do |app|
+ if defined?(Sprockets) && Sprockets::VERSION >= "4"
+ app.config.assets.precompile << "blazer/application.js"
+ app.config.assets.precompile << "blazer/application.css"
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.eot"
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.svg"
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.ttf"
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.woff"
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.woff2"
+ app.config.assets.precompile << "blazer/favicon.png"
+ else
+ # use a proc instead of a string
+ app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }
+ app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff|woff2)\z/ }
+ app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" }
+ end
Blazer.time_zone ||= Blazer.settings["time_zone"] || Time.zone
Blazer.audit = Blazer.settings.key?("audit") ? Blazer.settings["audit"] : true