-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move broken rubygems detection to ext/sass/cli.rb
- Loading branch information
Showing
2 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
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." | ||
end | ||
|
||
require_relative 'sass/embedded' |