@@ -17,8 +17,6 @@ rvm:
- 2.1.7
- 2.2.3
- 2.3.0
- jruby-9.0.0.0
- rbx-2.2.7
gemfile: Gemfile
env:
- MATHN=true RUBOCOP=false
@@ -32,9 +30,6 @@ branches:
notifications:
irc: {channels: "irc.freenode.org#sass"}
matrix:
allow_failures:
- rvm: rbx-2.2.7
- rvm: jruby-9.0.0.0
include:
- rvm: 2.2.3
env: MATHN=true RUBOCOP=true
@@ -1,6 +1,6 @@
--readme README.md
--markup markdown
--markup-provider maruku
--markup-provider redcarpet
--default-return ""
--title "Sass Documentation"
--query 'object.type != :classvariable'
@@ -77,6 +77,13 @@ For more details, see [this blog post][interp-blog] and
CSS. The only exception is `#{}`, which will inject a SassScript value as
before.

## 3.4.24 (Unreleased)

* Elements without a namespace (such as `div`) are no longer unified with
elements with the empty namespace (such as `|div`). This unification didn't
match the results returned by `is-superselector()`, and was not guaranteed to
be valid.

## 3.4.23 (19 December 2016)

* The Sass logger is now instantiated on a per-thread/per-fiber basis
@@ -100,13 +100,13 @@ class Engine
# `text`: `String`
# : The text in the line, without any whitespace at the beginning or end.
#
# `tabs`: `Fixnum`
# `tabs`: `Integer`
# : The level of indentation of the line.
#
# `index`: `Fixnum`
# `index`: `Integer`
# : The line number in the original document.
#
# `offset`: `Fixnum`
# `offset`: `Integer`
# : The number of bytes in on the line that the text begins.
# This ends up being the number of bytes of leading whitespace.
#
@@ -69,14 +69,14 @@ def sass_filename
# The name of the mixin in which the error occurred.
# This could be `nil` if the error occurred outside a mixin.
#
# @return [Fixnum]
# @return [String]
def sass_mixin
sass_backtrace.first[:mixin]
end

# The line of the Sass template on which the error occurred.
#
# @return [Fixnum]
# @return [Integer]
def sass_line
sass_backtrace.first[:line]
end
@@ -153,7 +153,7 @@ class << self
# Returns an error report for an exception in CSS format.
#
# @param e [Exception]
# @param line_offset [Fixnum] The number of the first line of the Sass template.
# @param line_offset [Integer] The number of the first line of the Sass template.
# @return [String] The error report
# @raise [Exception] `e`, if the
# {file:SASS_REFERENCE.md#full_exception-option `:full_exception`} option
@@ -72,7 +72,7 @@ def stylesheet_needs_update?(css_file, template_file, importer = nil)
# Returns whether a Sass or SCSS stylesheet has been modified since a given time.
#
# @param template_file [String] The location of the Sass or SCSS template.
# @param mtime [Fixnum] The modification time to check against.
# @param mtime [Time] The modification time to check against.
# @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
# Defaults to the filesystem importer.
# @return [Boolean] Whether the stylesheet has been modified.
@@ -103,7 +103,7 @@ def self.stylesheet_needs_update?(css_file, template_file, importer = nil)
# so it's better to use when checking multiple stylesheets at once.
#
# @param template_file [String] The location of the Sass or SCSS template.
# @param mtime [Fixnum] The modification time to check against.
# @param mtime [Time] The modification time to check against.
# @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
# Defaults to the filesystem importer.
# @return [Boolean] Whether the stylesheet has been modified.
@@ -16,9 +16,9 @@ module Script
# Parses a string of SassScript
#
# @param value [String] The SassScript
# @param line [Fixnum] The number of the line on which the SassScript appeared.
# @param line [Integer] The number of the line on which the SassScript appeared.
# Used for error reporting
# @param offset [Fixnum] The number of characters in on `line` that the SassScript started.
# @param offset [Integer] The number of characters in on `line` that the SassScript started.
# Used for error reporting
# @param options [{Symbol => Object}] An options hash;
# see {file:SASS_REFERENCE.md#options the Sass options documentation}
@@ -441,8 +441,8 @@ def self.declare(method_name, args, options = {})
# If no signatures match, the first signature is returned for error messaging.
#
# @param method_name [Symbol] The name of the Ruby function to be called.
# @param arg_arity [Fixnum] The number of unnamed arguments the function was passed.
# @param kwarg_arity [Fixnum] The number of keyword arguments the function was passed.
# @param arg_arity [Integer] The number of unnamed arguments the function was passed.
# @param kwarg_arity [Integer] The number of keyword arguments the function was passed.
#
# @return [{Symbol => Object}, nil]
# The signature options for the matching signature,
@@ -19,13 +19,13 @@ class Lexer
# `source_range`: \[`Sass::Source::Range`\]
# : The range in the source file in which the token appeared.
#
# `pos`: \[`Fixnum`\]
# `pos`: \[`Integer`\]
# : The scanner position at which the SassScript token appeared.
Token = Struct.new(:type, :value, :source_range, :pos)

# The line number of the lexer's current position.
#
# @return [Fixnum]
# @return [Integer]
def line
return @line unless @tok
@tok.source_range.start_pos.line
@@ -34,7 +34,7 @@ def line
# The number of bytes into the current line
# of the lexer's current position (1-based).
#
# @return [Fixnum]
# @return [Integer]
def offset
return @offset unless @tok
@tok.source_range.start_pos.offset
@@ -146,9 +146,9 @@ def string_re(open, close)
}

# @param str [String, StringScanner] The source text to lex
# @param line [Fixnum] The 1-based line on which the SassScript appears.
# @param line [Integer] The 1-based line on which the SassScript appears.
# Used for error reporting and sourcemap building
# @param offset [Fixnum] The 1-based character (not byte) offset in the line in the source.
# @param offset [Integer] The 1-based character (not byte) offset in the line in the source.
# Used for error reporting and sourcemap building
# @param options [{Symbol => Object}] An options hash;
# see {file:SASS_REFERENCE.md#options the Sass options documentation}
@@ -7,22 +7,22 @@ module Script
class Parser
# The line number of the parser's current position.
#
# @return [Fixnum]
# @return [Integer]
def line
@lexer.line
end

# The column number of the parser's current position.
#
# @return [Fixnum]
# @return [Integer]
def offset
@lexer.offset
end

# @param str [String, StringScanner] The source text to parse
# @param line [Fixnum] The line on which the SassScript appears.
# @param line [Integer] The line on which the SassScript appears.
# Used for error reporting and sourcemap building
# @param offset [Fixnum] The character (not byte) offset where the script starts in the line.
# @param offset [Integer] The character (not byte) offset where the script starts in the line.
# Used for error reporting and sourcemap building
# @param options [{Symbol => Object}] An options hash; see
# {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
@@ -10,7 +10,7 @@ class Node

# The line of the document on which this node appeared.
#
# @return [Fixnum]
# @return [Integer]
attr_accessor :line

# The source range in the document on which this node appeared.
@@ -149,7 +149,7 @@ def unary_div
# Returns the hash code of this value. Two objects' hash codes should be
# equal if the objects are equal.
#
# @return [Fixnum] The hash code.
# @return [Integer for Ruby 2.4.0+, Fixnum for earlier Ruby versions] The hash code.
def hash
value.hash
end
@@ -176,7 +176,7 @@ def ==(other)
eq(other).to_bool
end

# @return [Fixnum] The integer value of this value
# @return [Integer] The integer value of this value
# @raise [Sass::SyntaxError] if this value isn't an integer
def to_i
raise Sass::SyntaxError.new("#{inspect} is not an integer.")
@@ -17,8 +17,8 @@ class Color < Base
# @private
#
# Convert a ruby integer to a rgba components
# @param color [Fixnum]
# @return [Array<Fixnum>] Array of 4 numbers representing r,g,b and alpha
# @param color [Integer]
# @return [Array<Integer>] Array of 4 numbers representing r,g,b and alpha
def self.int_to_rgba(color)
rgba = (0..3).map {|n| color >> (n << 3) & 0xff}.reverse
rgba[-1] = rgba[-1] / 255.0
@@ -293,23 +293,23 @@ def self.from_hex(hex_string, alpha = nil)

# The red component of the color.
#
# @return [Fixnum]
# @return [Integer]
def red
hsl_to_rgb!
@attrs[:red]
end

# The green component of the color.
#
# @return [Fixnum]
# @return [Integer]
def green
hsl_to_rgb!
@attrs[:green]
end

# The blue component of the color.
#
# @return [Fixnum]
# @return [Integer]
def blue
hsl_to_rgb!
@attrs[:blue]
@@ -342,7 +342,7 @@ def lightness
# The alpha channel (opacity) of the color.
# This is 1 unless otherwise defined.
#
# @return [Fixnum]
# @return [Integer]
def alpha
@attrs[:alpha].to_f
end
@@ -357,31 +357,31 @@ def alpha?

# Returns the red, green, and blue components of the color.
#
# @return [Array<Fixnum>] A frozen three-element array of the red, green, and blue
# @return [Array<Integer>] A frozen three-element array of the red, green, and blue
# values (respectively) of the color
def rgb
[red, green, blue].freeze
end

# Returns the red, green, blue, and alpha components of the color.
#
# @return [Array<Fixnum>] A frozen four-element array of the red, green,
# @return [Array<Integer>] A frozen four-element array of the red, green,
# blue, and alpha values (respectively) of the color
def rgba
[red, green, blue, alpha].freeze
end

# Returns the hue, saturation, and lightness components of the color.
#
# @return [Array<Fixnum>] A frozen three-element array of the
# @return [Array<Integer>] A frozen three-element array of the
# hue, saturation, and lightness values (respectively) of the color
def hsl
[hue, saturation, lightness].freeze
end

# Returns the hue, saturation, lightness, and alpha components of the color.
#
# @return [Array<Fixnum>] A frozen four-element array of the hue,
# @return [Array<Integer>] A frozen four-element array of the hue,
# saturation, lightness, and alpha values (respectively) of the color
def hsla
[hue, saturation, lightness, alpha].freeze
@@ -306,7 +306,7 @@ def inspect(opts = {})
end
alias_method :to_sass, :inspect

# @return [Fixnum] The integer value of the number
# @return [Integer] The integer value of the number
# @raise [Sass::SyntaxError] if the number isn't an integer
def to_i
super unless int?
@@ -16,9 +16,9 @@ class Parser
# warnings and source maps.
# @param importer [Sass::Importers::Base] The importer used to import the
# file being parsed. Used for source maps.
# @param line [Fixnum] The 1-based line on which the source string appeared,
# @param line [Integer] The 1-based line on which the source string appeared,
# if it's part of another document.
# @param offset [Fixnum] The 1-based character (not byte) offset in the line on
# @param offset [Integer] The 1-based character (not byte) offset in the line on
# which the source string starts. Used for error reporting and sourcemap
# building.
def initialize(str, filename, importer, line = 1, offset = 1)
@@ -1093,7 +1093,7 @@ def interp_ident_or_var
end

def str
@strs.push ""
@strs.push String.new("")
yield
@strs.last
ensure
@@ -40,7 +40,7 @@ def self.escape_char(c)
# escaping all significant characters.
#
# @param str [String] The text of the regexp
# @param flags [Fixnum] Flags for the created regular expression
# @param flags [Integer] Flags for the created regular expression
# @return [Regexp]
# @private
def self.quote(str, flags = 0)
@@ -8,7 +8,7 @@ module Selector
class AbstractSequence
# The line of the Sass template on which this selector was declared.
#
# @return [Fixnum]
# @return [Integer]
attr_reader :line

# The name of the file in which this selector was declared.
@@ -19,8 +19,8 @@ class AbstractSequence
# Sets the line of the Sass template on which this selector was declared.
# This also sets the line for all child selectors.
#
# @param line [Fixnum]
# @return [Fixnum]
# @param line [Integer]
# @return [Integer]
def line=(line)
members.each {|m| m.line = line}
@line = line
@@ -42,7 +42,7 @@ def filename=(filename)
# Subclasses should define `#_hash` rather than overriding this method,
# which automatically handles memoizing the result.
#
# @return [Fixnum]
# @return [Integer]
def hash
@_hash ||= _hash
end
@@ -83,7 +83,7 @@ def to_s(opts = {})
# The base is given by {Sass::Selector::SPECIFICITY_BASE}. This can be a
# number or a range representing possible specificities.
#
# @return [Fixnum, Range]
# @return [Integer, Range]
def specificity
_specificity(members)
end
@@ -6,8 +6,8 @@ class Sequence < AbstractSequence
# Sets the line of the Sass template on which this selector was declared.
# This also sets the line for all child selectors.
#
# @param line [Fixnum]
# @return [Fixnum]
# @param line [Integer]
# @return [Integer]
def line=(line)
members.each {|m| m.line = line if m.is_a?(SimpleSequence)}
@line = line