/usr/lib/ruby/vendor_ruby/sass/features.rb is in ruby-sass 3.4.6-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | require 'set'
module Sass
# Provides `Sass.has_feature?` which allows for simple feature detection
# by providing a feature name.
module Features
# This is the set of features that can be detected.
#
# When this is updated, the documentation of `feature-exists()` should be
# updated as well.
KNOWN_FEATURES = Set[*%w{
global-variable-shadowing
extend-selector-pseudoclass
units-level-3
at-error
}]
# Check if a feature exists by name. This is used to implement
# the Sass function `feature-exists($feature)`
#
# @param feature_name [String] The case sensitive name of the feature to
# check if it exists in this version of Sass.
# @return [Boolean] whether the feature of that name exists.
def has_feature?(feature_name)
KNOWN_FEATURES.include?(feature_name)
end
# Add a feature to Sass. Plugins can use this to easily expose their
# availability to end users. Plugins must prefix their feature
# names with a dash to distinguish them from official features.
#
# @example
# Sass.add_feature("-import-globbing")
# Sass.add_feature("-math-cos")
#
#
# @param feature_name [String] The case sensitive name of the feature to
# to add to Sass. Must begin with a dash.
def add_feature(feature_name)
unless feature_name[0] == ?-
raise ArgumentError.new("Plugin feature names must begin with a dash")
end
KNOWN_FEATURES << feature_name
end
end
extend Features
end
|