Skip to content

Commit

Permalink
Merge pull request #753 from interscript/webdev778/ruby3.1-compat
Browse files Browse the repository at this point in the history
Ruby >=3.1 compatibility
  • Loading branch information
webdev778 authored Dec 29, 2023
2 parents 8a60912 + 1d835a9 commit fa8fbb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/rake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ "3.0", 2.7, 2.6 ]
ruby: [ 3.3, 3.2, 3.1, "3.0", 2.7, 2.6 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
include:
- ruby: "3.1"
os: 'ubuntu-latest'
- ruby: "3.2"
os: 'ubuntu-latest'
- ruby: "3.1"
os: 'macos-latest'
- ruby: "3.2"
os: 'macos-latest'

env:
BUNDLE_WITHOUT: "secryst"
SKIP_JS: "1"
Expand All @@ -49,4 +39,4 @@ jobs:
working-directory: ./ruby
run: |
bundle install --with=jsexec
bundle exec rspec -f f
bundle exec rspec
7 changes: 4 additions & 3 deletions lib/interscript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def rababa_provision(model_name, model_uri)

([ENV["RABABA_DATA"]] + possible_paths).compact.each do |path|
FileUtils.mkdir_p(path)
write_path = path unless write_path
write_path = path
break
rescue
end

Expand All @@ -137,8 +138,8 @@ def rababa_provision(model_name, model_uri)
if File.exist?(model_path) && File.mtime(model_path) + 3600 >= Time.now
return model_path
else
data = URI.open(model_uri).read
File.write(model_path, data)
data = URI.open(model_uri, encoding: "BINARY").read
File.binwrite(model_path, data)
return model_path
end
end
Expand Down

0 comments on commit fa8fbb5

Please sign in to comment.