Sha256: 637eeb580dc6b888cd9563432a67a25e6893feff341e644a748b1d65dccfe8a5

Contents?: true

Size: 777 Bytes

Versions: 12

Compression:

Stored size: 777 Bytes

Contents

# This contains functions for use with a project *only* using Compass.
module Sass::Script::Functions
  def image_path(source, options = {})
    if defined?(::Sprockets)
      ::Sass::Script::String.new sprockets_context.image_path(source.value).to_s, :string
    elsif defined?(::Compass)
      image_url(source, Sass::Script::Bool.new(true))
    else
      # Revert to the old compass-agnostic path determination
      asset_sans_quotes = source.value.gsub('"', '')
      Sass::Script::String.new("/images/#{asset_sans_quotes}", :string)
    end
  end

  protected
  def sprockets_context # :nodoc:
    if options.key?(:sprockets)
      options[:sprockets][:context]
    else
      # Compatibility with sprockets pre 2.10.0
      options[:importer].context
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
rails_admin-0.6.0 lib/rails_admin/bootstrap-sass/compass_functions.rb
bootstrap-sass-3.0.2.1 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-3.0.2.0 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-3.0.1.0 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-3.0.1.0.rc lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-3.0.0.0 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-3.0.0.0.rc2 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-3.0.0.0.rc lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-2.3.2.2 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-2.3.2.1 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-2.3.2.0 lib/bootstrap-sass/compass_functions.rb
bootstrap-sass-2.3.1.3 lib/bootstrap-sass/compass_functions.rb