Sha256: 6f99a791a9c97869240637ac3adb9820b8038ba73e3892bbd38235632ae4ee00

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

require 'epuber-stylus'
require 'epuber-stylus/sprockets'

module Stylus
  # Internal: The Railtie responsible for integrate the Stylus library with
  # a Rails application.
  #
  # Some of the customizations of using Stylus alongside Rails:
  #
  # * The application will use the Stylus stylesheet engine;
  # * The Sprockets instance (present at Rails.application.assets) will be configured
  #   with the Stylus templates and the configurations defined at 'config.assets' will
  #   affect how Stylus compile your stylesheets;
  # * The assets load path - the folders living on app/assets/stylesheets,
  #   lib/assets/stylesheets and vendor/assets/stylesheets on your app - will be
  #   added to the Stylus path registry.
  class Railtie < ::Rails::Railtie

    # Internal: Set the Stylesheet engine to 'stylus', so the generator constants
    # will be loaded from the `Stylus::Generators` namespace.
    config.app_generators.stylesheet_engine :stylus

    # Internal: Initializer block that uses the Stylus.setup utility to configure
    # both Stylus and the Sprockets instance that lives on 'app.assets'. The entire
    # configuration object will be passed along.
    #
    # Returns nothing.
    config.assets.configure do |env|
      Stylus.setup(env, config.assets.merge(rails: true))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
epuber-stylus-1.2.0 lib/epuber-stylus/railtie.rb
epuber-stylus-1.1.1 lib/epuber-stylus/railtie.rb
epuber-stylus-1.1.0 lib/epuber-stylus/railtie.rb