Sha256: 787251ab288d8960f3cefd7672ed7097c1d04d7cf0f5bf996b9a50c32885e1ae

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 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
      file   = File.join Ustyle.gem_path, 'config/autoprefixer.yml'
      params = YAML.load_file(file).symbolize_keys
      params
    end
  end
end

Ustyle.load!

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ustyle-1.11.1 lib/ustyle.rb
ustyle-1.10.0 lib/ustyle.rb
ustyle-1.8.7 lib/ustyle.rb
ustyle-1.8.1 lib/ustyle.rb
ustyle-1.8.0 lib/ustyle.rb
ustyle-1.7.0 lib/ustyle.rb
ustyle-1.6.1 lib/ustyle.rb