Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Ruby Sass #1369

Merged
merged 5 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ env:
matrix:
fast_finish: true
include:
- gemfile: Gemfile
env: LANGUAGE_VERSION=3.7 IMPL=ruby-sass
- gemfile: Gemfile.sass_next
env: LANGUAGE_VERSION=3.8 IMPL=ruby-sass
- gemfile: Gemfile.sass_master
env: LANGUAGE_VERSION=4.0 IMPL=ruby-sass
- env: LANGUAGE_VERSION=4.0 IMPL=libsass COMMAND="../sassc/bin/sassc"
- env: LANGUAGE_VERSION=4.0 IMPL=dart-sass

Expand All @@ -46,10 +40,7 @@ before_install:
fi

script:
- if [ $IMPL == "ruby-sass" ]; then
bundle update sass;
bundle exec sass-spec.rb -V $LANGUAGE_VERSION --impl $IMPL;
elif [ $IMPL == "dart-sass" ]; then
- if [ $IMPL == "dart-sass" ]; then
bundle exec sass-spec.rb -V $LANGUAGE_VERSION --dart ../dart-sass;
else
bundle exec sass-spec.rb -V $LANGUAGE_VERSION --impl $IMPL -c $COMMAND;
Expand Down
13 changes: 5 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
source 'https://rubygems.org'

gemspec

gem "sass", git: "https://github.com/sass/ruby-sass.git", branch: "stable"

# In development, uncomment this instead.
# gem "sass", :path => "../sass"
# gem "pry"
# gem "pry-nav"
gem "minitest", "~> 5.8"
gem "command_line_reporter", '~> 3.0'
gem "ruby-terminfo", '~> 0.1.1'
gem "diffy", '~> 3.1'
gem "hrx", '~> 1.0'
33 changes: 5 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,48 +1,25 @@
GIT
remote: https://github.com/sass/ruby-sass.git
revision: 4c5c5758cb399abe91490826292fef26a81ffa37
branch: stable
specs:
sass (3.7.1)
sass-listen (~> 4.0.0)

PATH
remote: .
specs:
sass-spec (3.3.3)
command_line_reporter (~> 3.0)
diffy (~> 3.1)
hrx (~> 1.0)
minitest (~> 5.8)
ruby-terminfo (~> 0.1.1)

GEM
remote: https://rubygems.org/
specs:
colored (1.2)
command_line_reporter (3.3.6)
colored (>= 1.2)
diffy (3.3.0)
ffi (1.9.25)
hrx (1.0.0)
linked-list (~> 0.0.13)
linked-list (0.0.13)
minitest (5.11.3)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
ruby-terminfo (0.1.1)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.7)
sass!
sass-spec!
command_line_reporter (~> 3.0)
diffy (~> 3.1)
hrx (~> 1.0)
minitest (~> 5.8)
ruby-terminfo (~> 0.1.1)

BUNDLED WITH
1.16.2
5 changes: 0 additions & 5 deletions Gemfile.sass_master

This file was deleted.

5 changes: 0 additions & 5 deletions Gemfile.sass_next

This file was deleted.

26 changes: 4 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* [Running Specs](#running-specs)
* [Dart Sass](#dart-sass)
* [LibSass](#libsass)
* [Ruby Sass](#ruby-sass)
* [Spec Structure](#spec-structure)
* [HRX](#hrx)
* [Specifying Warnings](#specifying-warnings)
Expand Down Expand Up @@ -73,22 +72,6 @@ export SASSC_PATH=`pwd`/libsass/sassc/bin/sassc
bundle exec ./sass-spec.rb --impl libsass -c $SASSC_PATH
```

### Ruby Sass

Unlike other implementations, Ruby Sass is installed via Bundler and used by
default. All you need to do to run specs against it is:

```sh
bundle exec ./sass-spec.rb
```

If you want to run specs against your own clone of Ruby Sass, edit the `Gemfile`
and replace the `gem "sass"` line with:

```ruby
gem "sass", :path => "path/to/ruby/sass"
```

## Spec Structure

Each spec is defined by a directory with an `input.scss` or `input.sass` file
Expand Down Expand Up @@ -189,8 +172,8 @@ against `error`.
Sometimes different Sass implementations produce different but equally-valid CSS
outputs or error messages for the same input. To accommodate this,
implementation-specific output, error, and warning files may be created by
adding `-dart-sass`, `-libsass`, or `-ruby-sass` after the file's name (but
before its extension, in the case of `output.css`).
adding `-dart-sass` or `-libsass` after the file's name (but before its
extension, in the case of `output.css`).

When a spec is running for an implementation with an implementations-specific
expectation, the normal expectation is ignored completely in favor of the
Expand Down Expand Up @@ -255,12 +238,11 @@ normal. This should not be used for error specs.
```yaml
---
:ignore_for:
- ruby-sass
- libsass
```

This option indicates implementations that are never expected to be compatible
with a given spec. It's used for specs that Ruby Sass, [which is deprecated][],
will never support, as well as for specs for old features that some but not all
with a given spec. It's used for specs for old features that some but not all
implementations have dropped support for.

[which is deprecated]: http://sass.logdown.com/posts/7081811
Expand Down
6 changes: 4 additions & 2 deletions lib/sass_spec/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module SassSpec::CLI

def self.parse
options = {
engine_adapter: SassEngineAdapter.new,
engine_adapter: nil,
spec_directory: nil,
generate: false,
tap: false,
Expand Down Expand Up @@ -55,7 +55,7 @@ def self.parse
options[:tap] = true
end

opts.on("-c", "--command COMMAND", "Sets a specific binary to run (defaults to '#{options[:engine_adapter]}')") do |v|
opts.on("-c", "--command COMMAND", "Sets a specific binary to run") do |v|
options[:engine_adapter] = ExecutableEngineAdapter.new(v)
end

Expand Down Expand Up @@ -120,6 +120,8 @@ def self.parse
end
end.parse!

raise "Must specify either --dart or --command." if options[:engine_adapter].nil?

options[:spec_dirs_to_run] = ARGV.dup.map{|d| File.expand_path(d)} if ARGV.any?

if options[:implementation] && options[:engine_adapter].respond_to?(:set_description)
Expand Down
53 changes: 0 additions & 53 deletions lib/sass_spec/engine_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,59 +65,6 @@ def compile(sass_filename, style, precision)
end
end

class SassEngineAdapter < EngineAdapter
def describe
'ruby-sass'
end

def version
require 'sass/version'
Sass::VERSION
end

def language_version
require 'sass/version'
Sass::VERSION[0..2]
end

def compile(sass_filename, style, precision)
require 'sass'
# overloads STDERR
stderr = StringIO.new
# restore previous default encoding
encoding = Encoding.default_external
# Does not work as expected when tests are run in parallel
# It runs tests in threads, so stderr is shared across them
old_stderr, $stderr = $stderr, stderr
begin
Encoding.default_external = "UTF-8"
Sass::Script::Value::Number.precision = precision
sass_options = {}
sass_options[:style] = (style || :expanded).to_sym
sass_options[:cache] = false unless sass_options.has_key?(:cache)
css_output = Sass.compile_file(sass_filename.to_s, sass_options)
# strings come back as utf8 encoded
# internaly we only work with bytes
err_output = stderr.string
err_output.force_encoding('ASCII-8BIT')
css_output.force_encoding('ASCII-8BIT')
[css_output, err_output, 0]
rescue Sass::SyntaxError => e
err_output = stderr.string
# prepend the prefix to the message
# and indent all lines to match it
err_output += e.sass_backtrace_str("standard input") + "\n Use --trace for backtrace.\n"
err_output.force_encoding('ASCII-8BIT')
["", err_output, 65]
rescue => e
["", e.to_s, 2]
end
ensure
$stderr = old_stderr
Encoding.default_external = encoding
end
end

class DartEngineAdapter < EngineAdapter
attr_accessor :args

Expand Down
2 changes: 2 additions & 0 deletions lib/sass_spec/test_case_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def _resolve_options(dir)
else
{}
end
raise "#{dir.path}/options.yml is not a map!" unless self_options.is_a?(Hash)

rv = parent_options.merge(self_options) do |key, parent_value, self_value|
if ACCUMULATED_OPTIONS.include?(key)
(Array(parent_value) + Array(self_value)).uniq
Expand Down
34 changes: 0 additions & 34 deletions sass-spec.gemspec

This file was deleted.

5 changes: 0 additions & 5 deletions spec/core_functions/color/hsl/error/five_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,3 @@ Error: wrong number of arguments (5 for 3) for `hsl'
>> x: hsl(0, 100%, 50%, 0.5, 0);

-----^

<===> error-ruby-sass
Error: wrong number of arguments (given 5, expected 1..3) for `hsl'
on line 2 of /sass/spec/core_functions/color/hsl/error/five_args/input.scss
Use --trace for backtrace.
1 change: 0 additions & 1 deletion spec/core_functions/color/hsl/error/four_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
---
:todo:
- libsass # sass/libsass#2722
- ruby-sass # sass/ruby-sass#84

<===>
================================================================================
Expand Down
1 change: 0 additions & 1 deletion spec/core_functions/color/hsl/error/one_arg.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
---
:todo:
- libsass # sass/libsass#2722
- ruby-sass # sass/ruby-sass#84

<===>
================================================================================
Expand Down
15 changes: 0 additions & 15 deletions spec/core_functions/color/hsl/error/three_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ Error: argument `$hue` of `hsl($hue, $saturation, $lightness)` must be a number

-----^

<===> hue/type/error-ruby-sass
Error: $hue: "foo" is not a number for `hsl'
on line 2 of /sass/spec/core_functions/color/hsl/error/hue_type/input.scss
Use --trace for backtrace.

<===>
================================================================================
<===> saturation/type/input.scss
Expand All @@ -47,11 +42,6 @@ Error: argument `$saturation` of `hsl($hue, $saturation, $lightness)` must be a

-----^

<===> saturation/type/error-ruby-sass
Error: $saturation: "foo" is not a number for `hsl'
on line 2 of /sass/spec/core_functions/color/hsl/error/saturation_type/input.scss
Use --trace for backtrace.

<===>
================================================================================
<===> lightness/type/input.scss
Expand All @@ -74,8 +64,3 @@ Error: argument `$lightness` of `hsl($hue, $saturation, $lightness)` must be a n
>> x: hsl(0, 100%, "foo");

-----^

<===> lightness/type/error-ruby-sass
Error: $lightness: "foo" is not a number for `hsl'
on line 2 of /sass/spec/core_functions/color/hsl/error/lightness_type/input.scss
Use --trace for backtrace.
1 change: 0 additions & 1 deletion spec/core_functions/color/hsl/error/two_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
---
:todo:
- libsass # sass/libsass#2722
- ruby-sass # sass/ruby-sass#84

<===>
================================================================================
Expand Down
1 change: 0 additions & 1 deletion spec/core_functions/color/hsl/four_args/options.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
:todo:
- libsass # sass/libsass#2722
- ruby-sass # sass/ruby-sass#84
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:todo:
- libsass # sass/libsass#2726
:ignore_for:
- ruby-sass

<===> input.scss
a {
Expand Down
1 change: 0 additions & 1 deletion spec/core_functions/color/hsl/one_arg/options.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
:todo:
- libsass # sass/libsass#2722
- ruby-sass # sass/ruby-sass#84
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:todo:
- libsass # sass/libsass#2726
:ignore_for:
- ruby-sass

<===> input.scss
no-alpha {
Expand Down
Loading