Class: Sass::Importers::DeprecatedPath

Inherits:
Filesystem show all
Defined in:
.ruby-sass/lib/sass/importers/deprecated_path.rb

Overview

This importer emits a deprecation warning the first time it is used to import a file. It is used to deprecate the current working directory from the list of automatic sass load paths.

Constant Summary

Instance Attribute Summary

Attributes inherited from Filesystem

#root

Instance Method Summary (collapse)

Methods inherited from Filesystem

#eql?, #find_relative, #hash, #key, #mtime, #public_url, #watched_file?

Methods inherited from Base

#find_relative, #key, #mtime, #public_url, #watched_file?

Constructor Details

#initialize(root) ⇒ DeprecatedPath

Returns a new instance of DeprecatedPath

Parameters:

  • root (String)

    The absolute, expanded path to the folder that is deprecated.



8
9
10
11
12
# File '.ruby-sass/lib/sass/importers/deprecated_path.rb', line 8

def initialize(root)
  @specified_root = root
  @warning_given = false
  super
end

Constructor Details

#initialize(root) ⇒ DeprecatedPath

Returns a new instance of DeprecatedPath

Parameters:

  • root (String)

    The absolute, expanded path to the folder that is deprecated.



8
9
10
11
12
# File '.ruby-sass/lib/sass/importers/deprecated_path.rb', line 8

def initialize(root)
  @specified_root = root
  @warning_given = false
  super
end

Instance Method Details

#directories_to_watchObject



25
26
27
28
29
# File '.ruby-sass/lib/sass/importers/deprecated_path.rb', line 25

def directories_to_watch
  # The current working directory was not watched in Sass 3.2,
  # so we continue not to watch it while it's deprecated.
  []
end

#find(*args) ⇒ Object

See Also:



15
16
17
18
19
20
21
22
# File '.ruby-sass/lib/sass/importers/deprecated_path.rb', line 15

def find(*args)
  found = super
  if found && !@warning_given
    @warning_given = true
    Sass::Util.sass_warn deprecation_warning
  end
  found
end

#to_sObject

See Also:



32
33
34
# File '.ruby-sass/lib/sass/importers/deprecated_path.rb', line 32

def to_s
  "#{@root} (DEPRECATED)"
end