Skip to content

Commit 059198d

Browse files
committed
Fix required_ruby_version override
1 parent 55a7a94 commit 059198d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Rakefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ task default: :test
44

55
require 'rake/extensiontask'
66
gem_spec = Gem::Specification.load("sassc.gemspec")
7+
8+
# HACK: Prevent rake-compiler from overriding required_ruby_version,
9+
# because the shared library here is Ruby-agnostic.
10+
# See https://github.com/rake-compiler/rake-compiler/issues/153
11+
module FixRequiredRubyVersion
12+
def required_ruby_version=(*); end
13+
end
14+
Gem::Specification.send(:prepend, FixRequiredRubyVersion)
15+
716
Rake::ExtensionTask.new('libsass', gem_spec) do |ext|
817
ext.name = 'libsass'
918
ext.ext_dir = 'ext'
@@ -18,11 +27,6 @@ Rake::ExtensionTask.new('libsass', gem_spec) do |ext|
1827

1928
ext.cross_compiling do |spec|
2029
spec.files.reject! { |path| File.fnmatch?('ext/*', path) }
21-
22-
23-
# Reset the required ruby version requirements.
24-
# This is set by rake-compiler, but the shared library here is Ruby-agnostic.
25-
spec.required_ruby_version = gem_spec.required_ruby_version
2630
end
2731
end
2832

0 commit comments

Comments
 (0)