From cb97ae44fdf3ea4fb75950eda837da0f76920309 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Fri, 12 Jul 2024 22:02:18 +0200 Subject: [PATCH 1/3] Add `bigdecimal` as a dependency This is to address the following warning on Ruby 3.3: ``` /home/apf/dev/rails-sqlserver/tiny_tds/lib/tiny_tds.rb:3: warning: bigdecimal was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add bigdecimal to your Gemfile or gemspec. ``` --- tiny_tds.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/tiny_tds.gemspec b/tiny_tds.gemspec index be86ee1d..7183733e 100644 --- a/tiny_tds.gemspec +++ b/tiny_tds.gemspec @@ -20,6 +20,7 @@ Gem::Specification.new do |s| s.license = 'MIT' s.required_ruby_version = '>= 2.7.0' s.metadata['msys2_mingw_dependencies'] = 'freetds' + s.add_dependency 'bigdecimal', '~> 3' s.add_development_dependency 'mini_portile2', '~> 2.5.0' s.add_development_dependency 'rake', '~> 13.0.0' s.add_development_dependency 'rake-compiler', '~> 1.2' From e979b0b3d2e91e50e8485cff0e5e27f12f3df83a Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Tue, 16 Jul 2024 22:39:36 +0200 Subject: [PATCH 2/3] Use `gem unpack` to get precompiled extensions on Windows --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1de19ce..0d790ac6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,18 +124,18 @@ jobs: run: | $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" + $gemToUnpack = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - Write-Host "Looking to install $gemToInstall" - gem install --local --install-dir=./tmp "$gemToInstall" + Write-Host "Looking to unpack $gemToUnpack" + gem unpack --target ./tmp "$gemToUnpack" # Restore precompiled code - $source = (Resolve-Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path + $source = (Resolve-Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path $destination = (Resolve-Path ".\lib\tiny_tds").Path Get-ChildItem $source -Recurse -Exclude "*.rb" | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)} # Restore ports - Copy-Item -Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse + Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL uses: potatoqualitee/mssqlsuite@v1.7 @@ -245,18 +245,18 @@ jobs: run: | $rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim() $gemVersion = (Get-Content VERSION).Trim() - $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" + $gemToUnpack = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" - Write-Host "Looking to install $gemToInstall" - gem install --local --install-dir=./tmp "$gemToInstall" + Write-Host "Looking to unpack $gemToUnpack" + gem unpack --target ./tmp "$gemToUnpack" # Restore precompiled code - $source = (Resolve-Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path + $source = (Resolve-Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\lib\tiny_tds").Path $destination = (Resolve-Path ".\lib\tiny_tds").Path Get-ChildItem $source -Recurse -Exclude "*.rb" | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)} # Restore ports - Copy-Item -Path ".\tmp\gems\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse + Copy-Item -Path ".\tmp\tiny_tds-$gemVersion-$rubyArchitecture\ports" -Destination "." -Recurse - name: Setup MSSQL uses: potatoqualitee/mssqlsuite@v1.7 From a9c5d88f431af031d507b828efdb143b645f234b Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Wed, 17 Jul 2024 23:01:26 +0200 Subject: [PATCH 3/3] Remove `--local` flag --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d790ac6..a7539edc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" Write-Host "Looking to install $gemToInstall" - gem install --local "$gemToInstall" + gem install "$gemToInstall" - name: Test if TinyTDS loads shell: pwsh @@ -203,7 +203,7 @@ jobs: $gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem" Write-Host "Looking to install $gemToInstall" - gem install --local "$gemToInstall" + gem install "$gemToInstall" - name: Test if TinyTDS loads shell: pwsh @@ -319,7 +319,7 @@ jobs: shell: pwsh run: | $gemVersion = (Get-Content VERSION).Trim() - gem install --local "tiny_tds-$gemVersion.gem" + gem install "tiny_tds-$gemVersion.gem" - name: Test if TinyTDS loads shell: pwsh @@ -458,7 +458,7 @@ jobs: shell: bash run: | gemVersion=$(