Sha256: fcfd29f0037aa2d5618ea3feffaebfa95705d3eb2447612ec6d3775492d6b306

Contents?: true

Size: 1 KB

Versions: 19

Compression:

Stored size: 1 KB

Contents

require 'compass/compiler'
module Compass
  class Compiler
    attr_accessor :sass_options
    STYLESHEET = /stylesheet/
    def sass_options
      if CompassRails.asset_pipeline_enabled?
        @sass_options[:custom] ||= {}
        @sass_options[:custom] = {:resolver => ::Sass::Rails::Resolver.new(CompassRails.context)}
        @sass_options[:load_paths] ||= []
        unless @sass_options[:load_paths].any? {|k| k.is_a?(::Sass::Rails::Importer) }
          ::Rails.application.assets.paths.each do |path|
            next unless path.to_s =~ STYLESHEET
            Dir["#{path}/**/*"].each do |pathname|
              # args are: sprockets environment, the logical_path ex. 'stylesheets', and the full path name for the render
              context = ::CompassRails.context.new(::Rails.application.assets, File.basename(path), Pathname.new(pathname))
              @sass_options[:load_paths] << ::Sass::Rails::Importer.new(context)
            end
          end
        end
      end
      @sass_options
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
compass-rails-2.0.2 lib/compass-rails/patches/importer.rb
compass-rails-2.0.1 lib/compass-rails/patches/importer.rb
compass-rails-2.0.0 lib/compass-rails/patches/importer.rb
compass-rails-1.1.7 lib/compass-rails/patches/importer.rb
compass-rails-1.1.6 lib/compass-rails/patches/importer.rb
compass-rails-1.1.5 lib/compass-rails/patches/importer.rb
compass-rails-1.1.3 lib/compass-rails/patches/importer.rb
compass-rails-1.1.2 lib/compass-rails/patches/importer.rb
compass-rails-1.1.1 lib/compass-rails/patches/importer.rb
compass-rails-1.1.0 lib/compass-rails/patches/importer.rb
compass-rails-1.1.0.pre lib/compass-rails/patches/importer.rb
compass-rails-1.0.3 lib/compass-rails/patches/importer.rb
compass-rails-1.0.2 lib/compass-rails/patches/importer.rb
compass-rails-1.0.1 lib/compass-rails/patches/importer.rb
compass-rails-1.0.0 lib/compass-rails/patches/importer.rb
compass-rails-1.0.0.rc.4 lib/compass-rails/patches/importer.rb
compass-rails-1.0.0.rc.3 lib/compass-rails/patches/importer.rb
compass-rails-1.0.0.rc.2 lib/compass-rails/patches/importer.rb
compass-rails-1.0.0.rc.1 lib/compass-rails/patches/importer.rb