Skip to content

Commit b1fdef8

Browse files
authored
Merge pull request #1375 from sass/no-version
Drop support for multiple language versions
2 parents 499ca9a + cddcb0b commit b1fdef8

200 files changed

Lines changed: 1375 additions & 16075 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ env:
1515
matrix:
1616
fast_finish: true
1717
include:
18-
- env: LANGUAGE_VERSION=4.0 IMPL=libsass COMMAND="../sassc/bin/sassc"
19-
- env: LANGUAGE_VERSION=4.0 IMPL=dart-sass
18+
- env: IMPL=libsass COMMAND="../sassc/bin/sassc"
19+
- env: IMPL=dart-sass
2020

2121
before_install:
2222
- if ./tools/skipped-for-impl.sh; then exit 0; fi
@@ -41,7 +41,7 @@ before_install:
4141

4242
script:
4343
- if [ $IMPL == "dart-sass" ]; then
44-
bundle exec sass-spec.rb -V $LANGUAGE_VERSION --dart ../dart-sass;
44+
bundle exec sass-spec.rb --dart ../dart-sass;
4545
else
46-
bundle exec sass-spec.rb -V $LANGUAGE_VERSION --impl $IMPL -c $COMMAND;
46+
bundle exec sass-spec.rb --impl $IMPL -c $COMMAND;
4747
fi

lib/sass_spec/cli.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ def self.parse
4242
options[:verbose] = true
4343
end
4444

45-
opts.on("-V", "--version LANGUAGE_VERSION", "Select the Sass Language Version to test.") do |v|
46-
unless SassSpec::LANGUAGE_VERSIONS.include?(v)
47-
raise ArgumentError.new("Version #{v} is not valid. " +
48-
"Did you mean one of: #{SassSpec::LANGUAGE_VERSIONS.join(', ')}")
49-
end
50-
options[:language_version] = v
51-
end
52-
5345
opts.on("-t", "--tap", "Output TAP compatible report") do
5446
options[:tap] = true
5547
end

lib/sass_spec/engine_adapter.rb

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ def describe
77
not_implemented
88
end
99

10-
# The version string of the implementation
11-
def version
12-
not_implemented
13-
end
14-
15-
def to_s
16-
describe
17-
end
18-
1910
# Compile a Sass file and return the results
2011
# @return [css_output, std_error, status_code]
2112
def compile(sass_filename, precision)
@@ -36,6 +27,7 @@ def initialize(command, description = nil)
3627
@command = command
3728
@timeout = 90
3829
@description = description || command
30+
@version = `#{@command} -v`
3931
end
4032

4133
def set_description(description)
@@ -46,13 +38,6 @@ def describe
4638
@description
4739
end
4840

49-
def version
50-
require 'open3'
51-
stdout, stderr, status = Open3.capture3("#{@command} -v", :binmode => true)
52-
stdout.to_s
53-
end
54-
55-
5641
def compile(sass_filename, precision)
5742
command = File.absolute_path(@command)
5843
dirname, basename = File.split(sass_filename)
@@ -66,6 +51,10 @@ def compile(sass_filename, precision)
6651
[result[:stdout], result[:stderr], result[:status].exitstatus]
6752
end
6853
end
54+
55+
def to_s
56+
"#{@description} #{@version}"
57+
end
6958
end
7059

7160
class DartEngineAdapter < EngineAdapter
@@ -108,23 +97,24 @@ def initialize(path)
10897
@stdout.set_encoding 'binary'
10998
@stderr.set_encoding 'binary'
11099
end
100+
@version = `dart #{@path}/bin/sass.dart --version`
111101
end
112102

113103
def describe
114104
"dart-sass"
115105
end
116106

117-
def version
118-
`dart #{@path}/bin/sass.dart --version`
119-
end
120-
121107
def compile(sass_filename, precision)
122108
dirname, basename = File.split(sass_filename)
123109
@stdin.puts "!cd #{File.absolute_path(dirname)}"
124110
@stdin.puts "--no-color --no-unicode #{@args} #{basename}"
125111
[next_chunk(@stdout), next_chunk(@stderr), next_chunk(@stdout).to_i]
126112
end
127113

114+
def to_s
115+
"Dart Sass #{@version}"
116+
end
117+
128118
private
129119

130120
def next_chunk(io)

lib/sass_spec/runner.rb

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class SassSpec::Runner
88

99
def initialize(options = {})
1010
@options = options
11-
@options[:language_version] = language_version.to_s
1211
end
1312

1413
def get_input_dirs
@@ -37,8 +36,7 @@ def get_input_files
3736

3837
def run
3938
unless @options[:silent] || @options[:tap]
40-
puts "Recursively searching under #{get_input_dirs.join(", ")} for test files to test '#{@options[:engine_adapter]}' against language version #{@options[:language_version]}."
41-
puts @options[:engine_adapter].version
39+
puts "Recursively searching under #{get_input_dirs.join(", ")} for test files to test #{@options[:engine_adapter]}."
4240
end
4341

4442
test_cases = _get_cases
@@ -74,21 +72,6 @@ def run
7472
result
7573
end
7674

77-
def language_version
78-
unless defined?(@language_version)
79-
@language_version = if @options[:language_version]
80-
Gem::Version.new(@options[:language_version])
81-
elsif @options[:engine_adapter].respond_to?(:language_version)
82-
Gem::Version.new(@options[:engine_adapter].language_version)
83-
else
84-
warn "No language version specified. " +
85-
"Using #{SassSpec::MAX_LANGUAGE_VERSION}"
86-
SassSpec::MAX_LANGUAGE_VERSION
87-
end
88-
end
89-
@language_version
90-
end
91-
9275
def impl
9376
@options[:engine_adapter].describe
9477
end
@@ -98,12 +81,6 @@ def _get_cases
9881
get_input_files().each do |filename|
9982
dir = SassSpec::Directory.new(File.dirname(filename))
10083
metadata = SassSpec::TestCaseMetadata.new(dir)
101-
unless metadata.valid_for_version?(language_version)
102-
if @options[:verbose]
103-
warn "#{metadata.name} does not apply to Sass #{language_version}"
104-
end
105-
next
106-
end
10784

10885
unless metadata.valid_for_impl?(impl)
10986
if @options[:verbose]

lib/sass_spec/test_case_metadata.rb

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -106,33 +106,8 @@ def precision
106106
@options[:precision]
107107
end
108108

109-
def start_version
110-
@start_version ||= Gem::Version.new(@options[:start_version] || SassSpec::MIN_LANGUAGE_VERSION)
111-
end
112-
113-
def end_version
114-
unless defined?(@end_version)
115-
@end_version = if @options[:end_version]
116-
Gem::Version.new(@options[:end_version])
117-
else
118-
nil
119-
end
120-
end
121-
@end_version
122-
end
123-
124-
def valid_for_version?(version)
125-
version = Gem::Version.new(version) if version.is_a?(String)
126-
valid = start_version <= version
127-
if end_version
128-
valid &&= version <= end_version
129-
end
130-
valid
131-
end
132-
133109
def valid_for_impl?(impl)
134110
!ignore_for?(impl)
135111
end
136-
137112
end
138113
end

spec/basic/16_hex_arithmetic.hrx

Lines changed: 0 additions & 152 deletions
This file was deleted.

spec/basic/23_basic_value_interpolation-4.0.hrx

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)