Sha256: ba4a6acb06f92de9e9338c8d2ff4401de101a45c8e099631705e2a547c768e87

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

dir = File.dirname(__FILE__)
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)

require "ustyle/version"
require "ustyle/utils"
require "ustyle/hash"

module Ustyle
  class << self
    def load!
      require "ustyle/sass_functions"
      require "ustyle/icons"

      if defined?(::Rails)
        require "ustyle/engine"
      elsif sprockets?
        require "ustyle/sprockets"
        require "ustyle/sinatra"
      end

      ::Sass.load_paths << File.join(assets_path, "stylesheets")
    end

    def sprockets?
      defined?(::Sprockets)
    end

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

    def assets_path
      @assets_path ||= File.join gem_path, "vendor", "assets"
    end

    def asset_directories
      %w(stylesheets javascripts images fonts)
    end

    def sprockets_env
      @sprockets_env ||= ::Sprockets::Environment.new
    end

    def autoprefixer_config app
      file   = File.join Ustyle.gem_path, 'config/autoprefixer.yml'
      params = YAML.load_file(file).symbolize_keys
      opts   = { }
      opts[:safe] = true if params.delete(:safe)
      [params, opts]
    end
  end
end

Ustyle.load!

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ustyle-1.5.8 lib/ustyle.rb
ustyle-1.4.1 lib/ustyle.rb
ustyle-1.4.0 lib/ustyle.rb
ustyle-1.3.12 lib/ustyle.rb
ustyle-1.3.6 lib/ustyle.rb