Skip to content

Commit

Permalink
fix: explicitly cast the platform string to a Gem::Platform
Browse files Browse the repository at this point in the history
to work around rubygems/rubygems#5938

Closes #200
  • Loading branch information
XLoopLion committed Sep 19, 2022
1 parent 2405dca commit 3c62032
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tailwindcss/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def platform
def executable(
exe_path: File.expand_path(File.join(__dir__, "..", "..", "exe"))
)
if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match(p) }
if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match(Gem::Platform.new(p)) }
raise UnsupportedPlatformException, <<~MESSAGE
tailwindcss-rails does not support the #{platform} platform
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
MESSAGE
end

exe_path = Dir.glob(File.expand_path(File.join(exe_path, "*", "tailwindcss"))).find do |f|
Gem::Platform.match(File.basename(File.dirname(f)))
Gem::Platform.match(Gem::Platform.new(File.basename(File.dirname(f))))
end

if exe_path.nil?
Expand Down

0 comments on commit 3c62032

Please sign in to comment.