Sha256: a7880a9bdabc31b3aab992aff296850acb9a4953bb1e3ce89f1cf0100cb8cf33

Contents?: true

Size: 1.1 KB

Versions: 14

Compression:

Stored size: 1.1 KB

Contents

module MaterialDesignLite
  module Sass
    class << self
      def load!
        if defined?(::Rails)
          register_rails_engine
        elsif defined?(::Sprockets)
          register_sprockets
        end

        configure_sass
      end

      def gem_path
        @gem_path ||= File.expand_path('..', File.dirname(__FILE__))
      end

      def stylesheets_path
        File.join(gem_path, 'vendor/assets/stylesheets')
      end

      def javascripts_path
        File.join(gem_path, 'vendor/assets/javascripts')
      end

      def fonts_path
        File.join(gem_path, 'vendor/assets/fonts')
      end

      private

        def configure_sass
          require 'sass'

          ::Sass.load_paths << stylesheets_path
        end

        def register_rails_engine
          require 'material_design_lite/sass/engine'
          require 'autoprefixer-rails'
        end

        def register_sprockets
          Sprockets.append_path(stylesheets_path)
          Sprockets.append_path(javascripts_path)
          Sprockets.append_path(fonts_path)
        end
    end
  end
end

MaterialDesignLite::Sass.load!

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
material_design_lite-sass-1.3.0.1 lib/material_design_lite-sass.rb
material_design_lite-sass-1.3.0 lib/material_design_lite-sass.rb
material_design_lite-sass-1.2.1 lib/material_design_lite-sass.rb
material_design_lite-sass-1.2.0 lib/material_design_lite-sass.rb
material_design_lite-sass-1.1.3 lib/material_design_lite-sass.rb
material_design_lite-sass-1.1.2 lib/material_design_lite-sass.rb
material_design_lite-sass-1.1.1 lib/material_design_lite-sass.rb
material_design_lite-sass-1.1.0 lib/material_design_lite-sass.rb
material_design_lite-sass-1.0.6.3 lib/material_design_lite-sass.rb
material_design_lite-sass-1.0.6.2 lib/material_design_lite-sass.rb
material_design_lite-sass-1.0.6.1 lib/material_design_lite-sass.rb
material_design_lite-sass-1.0.6 lib/material_design_lite-sass.rb
material_design_lite-sass-1.0.5 lib/material_design_lite-sass.rb
material_design_lite-sass-1.0.4.2 lib/material_design_lite-sass.rb