Skip to content

Commit

Permalink
Fix RubyInline problem in Windows Ruby >= 3.1 with patched version
Browse files Browse the repository at this point in the history
  • Loading branch information
fenrir-naru committed Dec 7, 2024
1 parent 92e429e commit df596f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,15 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Fix Ruby library
- name: Fix RubyInline
if: matrix.os == 'windows-latest'
# https://github.com/IBM/aspera-cli
# copy the file [Ruby main dir]\lib\libx64-ucrt-ruby310.dll.a to [Ruby main dir]\lib\libx64-ucrt-ruby310.a (remove the dll extension)
shell: cmd
run: |
cd /d ${{ steps.ruby-inst.outputs.ruby-prefix }}\lib
start /b /wait ruby -e "exit(Gem::Version.new('${{ matrix.ruby }}') >= Gem::Version.new('3.1') ? 0 : 1)"
if %errorlevel% == 0 (
setlocal enableDelayedExpansion
for %%F in (libx64-ucrt-ruby*.dll.a) do (
set "filename=%%F"
copy "!filename!" "!filename:.dll.a=.a!"
)
gem install specific_install hoe minitest
gem specific_install https://github.com/fenrir-naru/rubyinline.git fix_windoze -i vendor/bundle
)
dir
cd >nul
- name: Run the default task
run: bundle exec rake
Expand Down
6 changes: 4 additions & 2 deletions spec/sdr/replica_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require 'gps_pvt/Replica'

begin; require 'inline'; rescue LoadError; end

class NativeGenerator
inline(:C){|builder|
builder.include('<vector>')
Expand Down Expand Up @@ -47,7 +49,7 @@ class NativeGenerator
}
__C_CODE__
}
end if require 'inline'
end if defined?(Module::inline)

RSpec::describe GPS_PVT::Replica::GPS_CA_Code do
let(:gen_type){described_class}
Expand All @@ -67,7 +69,7 @@ class NativeGenerator
}.join(', ')}" if idx_diff
expect(idx_diff).to be_nil, msg_fail
}
end if defined?(:NativeGenerator)
end if defined?(NativeGenerator)
it "has functionality to retreat replica" do
prn_range.each{|prn|
gen_f, gen_b = 2.times.collect{gen_type::new(prn)}
Expand Down

0 comments on commit df596f3

Please sign in to comment.