Skip to content

Commit

Permalink
Detect older versions of broken rubygems
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed May 7, 2024
1 parent 6a17db0 commit 6cd3c23
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions ext/sass/Rakefile
Expand Up @@ -52,21 +52,23 @@ file 'cli.rb' => %w[dart-sass] do |t|

validate_gemspec = <<~'VALIDATE_GEMSPEC'
spec = Gem.loaded_specs['sass-embedded']
platform = spec&.platform
if platform.is_a?(Gem::Platform) && platform.os == 'linux' && platform.version.nil?
update = if Gem.disable_system_update_message
'updating Ruby to version 3.2 or later'
else
"running 'gem update --system' to update RubyGems"
end
install = if defined?(Bundler)
"running 'rm -f Gemfile.lock && bundle install'"
else
"running 'gem install sass-embedded'"
end
raise LoadError, "The gemspec for #{spec.name} at #{spec.loaded_from} was broken. " \
"Try #{update}, and then try #{install} to reinstall."
if Gem::Platform.new('aarch64-linux-musl') === Gem::Platform.new('aarch64-linux') # rubocop:disable Style/CaseEquality
spec = Gem.loaded_specs['sass-embedded']
platform = spec&.platform
if platform.is_a?(Gem::Platform) && platform.os == 'linux'
update = if Gem.disable_system_update_message
'updating Ruby to version 3.2 or later'
else
"running 'gem update --system' to update RubyGems"
end
install = if defined?(Bundler)
"running 'rm -f Gemfile.lock && bundle install'"
else
"running 'gem install sass-embedded'"
end
raise LoadError, "The gemspec for #{spec.name} at #{spec.loaded_from} was broken. " \
"Try #{update}, and then try #{install} to reinstall."
end
end
VALIDATE_GEMSPEC

Expand Down

0 comments on commit 6cd3c23

Please sign in to comment.