Sha256: ab0ff8cb4e99e94ff617e0e1f3f0d3ef6fcac9f24188d12db445b125082e59be

Contents?: true

Size: 960 Bytes

Versions: 5

Compression:

Stored size: 960 Bytes

Contents

require 'bootswatch-sass/version'

module BootswatchSass
  class << self
    # Inspired by bootstrap-sass & kaminari

    def load!
      configure_sass!
      register_rails_engine! if rails?
    end

    def configure_sass!
      ::Sass.load_paths << stylesheets_path
      ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
    end

    def register_rails_engine!
      require 'bootswatch-sass/engine' if rails?
    end

    # Environment

    def rails?
      defined?(::Rails)
    end

    # Paths

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

    def assets_path
      @assets_path ||= File.join(gem_path, 'assets')
    end

    def fonts_path
      File.join(assets_path, 'fonts')
    end

    def javascripts_path
      File.join(assets_path, 'javascripts')
    end

    def stylesheets_path
      File.join(assets_path, 'stylesheets')
    end
  end
end

BootswatchSass.load!

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bootswatch-sass-3.3.7 lib/bootswatch-sass.rb
bootswatch-sass-3.3.6.1 lib/bootswatch-sass.rb
bootswatch-sass-3.3.5 lib/bootswatch-sass.rb
bootswatch-sass-3.3.2 lib/bootswatch-sass.rb
bootswatch-sass-3.3.1.4 lib/bootswatch-sass.rb