Skip to content

Commit

Permalink
Fixed Msys(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Aug 14, 2024
1 parent 3bb8823 commit d7f997a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
- name: Shall upload artifacts?
id: shall-upload
run: |
if [ "${{ matrix.package_ruby_ver }}" == 3.2.5" ] && [ "${{ matrix.env.CC }}" == "gcc" ]; then
if [ "${{ matrix.package_ruby_ver }}" == "3.2.5" ] && [ "${{ matrix.env.CC }}" == "gcc" ]; then
echo "upload=true" >> $GITHUB_OUTPUT
else
echo "upload=false" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion lib/tebako/cli_rubies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def version_check(version)
end

def version_check_msys(version)
if Gem::Version.new(version) < Gem::Version.new(DEFAULT_RUBY_VERSION) && RUBY_PLATFORM =~ /msys|mingw|cygwin/
if Gem::Version.new(version) < Gem::Version.new(MIN_RUBY_VERSION_WINDOWS) && RUBY_PLATFORM =~ /msys|mingw|cygwin/
raise Tebako::Error.new(
"Windows packaging works for Ruby #{MIN_RUBY_VERSION_WINDOWS} or above, version #{version} is not supported",
252
Expand Down
8 changes: 8 additions & 0 deletions spec/cli_rubies_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
end
end

context "when version is minimum on Windows" do
it "does not raise an error" do
version = "3.1.6"
stub_const("RUBY_PLATFORM", "msys")
expect { version_check_msys(version) }.not_to raise_error
end
end

context "when version is above minimum on Windows" do
it "does not raise an error" do
version = "3.2.5"
Expand Down

0 comments on commit d7f997a

Please sign in to comment.