Skip to content

Commit b13abc2

Browse files
committed
Fix deprecation warnings in 3.5.0
1 parent f8ee6a5 commit b13abc2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/tailwindcss/commands.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ def executable(exe_path: DEFAULT_DIR)
3434
MESSAGE
3535
end
3636
else
37-
if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match(Gem::Platform.new(p)) }
37+
if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), nil) }
3838
raise UnsupportedPlatformException, <<~MESSAGE
3939
tailwindcss-rails does not support the #{platform} platform
4040
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
4141
MESSAGE
4242
end
4343

4444
exe_file = Dir.glob(File.expand_path(File.join(exe_path, "*", "tailwindcss"))).find do |f|
45-
Gem::Platform.match(Gem::Platform.new(File.basename(File.dirname(f))))
45+
Gem::Platform.match_gem?(Gem::Platform.new(File.basename(File.dirname(f))), nil)
4646
end
4747
end
4848

test/lib/tailwindcss/commands_test.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def mock_exe_directory(platform)
77
FileUtils.mkdir(File.join(dir, platform))
88
path = File.join(dir, platform, "tailwindcss")
99
FileUtils.touch(path)
10-
Gem::Platform.stub(:match, true) do
10+
Gem::Platform.stub(:match_gem?, true) do
1111
yield(dir, path)
1212
end
1313
end
@@ -35,7 +35,7 @@ def mock_local_tailwindcss_install
3535
end
3636

3737
test ".executable raises UnsupportedPlatformException when we're not on a supported platform" do
38-
Gem::Platform.stub(:match, false) do # nothing is supported
38+
Gem::Platform.stub(:match_gem?, false) do # nothing is supported
3939
assert_raises(Tailwindcss::Commands::UnsupportedPlatformException) do
4040
Tailwindcss::Commands.executable
4141
end
@@ -66,7 +66,7 @@ def mock_local_tailwindcss_install
6666
end
6767

6868
test ".executable returns the executable in TAILWINDCSS_INSTALL_DIR when we're not on a supported platform" do
69-
Gem::Platform.stub(:match, false) do # nothing is supported
69+
Gem::Platform.stub(:match_gem?, false) do # nothing is supported
7070
mock_local_tailwindcss_install do |local_install_dir, expected|
7171
result = nil
7272
begin

0 commit comments

Comments
 (0)