Sha256: 01fd27e2ddbd0d489f8454b772f58a38f545cc2fdcf9ef498ba6e0121734ecdf

Contents?: true

Size: 963 Bytes

Versions: 13

Compression:

Stored size: 963 Bytes

Contents

require 'sprockets/sass_functions'
require 'active_support/deprecation'

module Sprockets
  module SassFunctions
    if instance_methods.map(&:to_sym).include?(:asset_path)
      undef_method :asset_path
    end

    def asset_path(path, kind = nil)
      ActiveSupport::Deprecation.warn "asset_path with two arguments is deprecated. Use asset_path(#{path}) instead." if kind

      Sass::Script::String.new(sprockets_context.asset_path(path.value), :string)
    end

    if instance_methods.map(&:to_sym).include?(:asset_url)
      undef_method :asset_url
    end

    def asset_url(path, kind = nil)
      ActiveSupport::Deprecation.warn "asset_url with two arguments is deprecated. Use asset_url(#{path}) instead." if kind

      Sass::Script::String.new("url(" + sprockets_context.asset_path(path.value) + ")")
    end

    def asset_data_url(path)
      Sass::Script::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sass-rails-4.0.5/lib/sass/rails/helpers.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/sass-rails-4.0.5/lib/sass/rails/helpers.rb
sass-rails-4.0.5 lib/sass/rails/helpers.rb
sass-rails-4.0.4 lib/sass/rails/helpers.rb
sass-rails-5.0.0.beta1 lib/sass/rails/helpers.rb
sass-rails3-4.0.1 lib/sass/rails/helpers.rb
sass-rails-4.0.3 lib/sass/rails/helpers.rb
sass-rails-4.0.2 lib/sass/rails/helpers.rb
sass-rails-4.0.1 lib/sass/rails/helpers.rb
sass-rails-4.0.0 lib/sass/rails/helpers.rb
sass-rails-4.0.0.rc2 lib/sass/rails/helpers.rb
sass-rails-4.0.0.rc1 lib/sass/rails/helpers.rb
sass-rails-4.0.0.beta1 lib/sass/rails/helpers.rb