Sha256: 5c0b479f2a0c4c0a7bab62159b8524f0a0ddcbd8cbc5780d106207404727face

Contents?: true

Size: 750 Bytes

Versions: 6

Compression:

Stored size: 750 Bytes

Contents

module PgHero
  class Engine < ::Rails::Engine
    isolate_namespace PgHero

    initializer "pghero", group: :all do |app|
      # check if Rails api mode
      if app.config.respond_to?(:assets)
        if defined?(Sprockets) && Sprockets::VERSION >= "4"
          app.config.assets.precompile << "pghero/application.js"
          app.config.assets.precompile << "pghero/application.css"
        else
          # use a proc instead of a string
          app.config.assets.precompile << proc { |path| path == "pghero/application.js" }
          app.config.assets.precompile << proc { |path| path == "pghero/application.css" }
        end
      end

      PgHero.time_zone = PgHero.config["time_zone"] if PgHero.config["time_zone"]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pghero-2.0.3 lib/pghero/engine.rb
pghero-2.0.2 lib/pghero/engine.rb
pghero-2.0.1 lib/pghero/engine.rb
pghero-2.0.0 lib/pghero/engine.rb
pghero-1.7.0 lib/pghero/engine.rb
pghero-1.6.5 lib/pghero/engine.rb