Skip to content

Commit fa8fbb5

Browse files
author
webdev778
authored
Merge pull request #753 from interscript/webdev778/ruby3.1-compat
Ruby >=3.1 compatibility
2 parents 8a60912 + 1d835a9 commit fa8fbb5

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

.github/workflows/rake.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,8 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
ruby: [ "3.0", 2.7, 2.6 ]
17+
ruby: [ 3.3, 3.2, 3.1, "3.0", 2.7, 2.6 ]
1818
os: [ ubuntu-latest, windows-latest, macos-latest ]
19-
include:
20-
- ruby: "3.1"
21-
os: 'ubuntu-latest'
22-
- ruby: "3.2"
23-
os: 'ubuntu-latest'
24-
- ruby: "3.1"
25-
os: 'macos-latest'
26-
- ruby: "3.2"
27-
os: 'macos-latest'
28-
2919
env:
3020
BUNDLE_WITHOUT: "secryst"
3121
SKIP_JS: "1"
@@ -49,4 +39,4 @@ jobs:
4939
working-directory: ./ruby
5040
run: |
5141
bundle install --with=jsexec
52-
bundle exec rspec -f f
42+
bundle exec rspec

lib/interscript.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def rababa_provision(model_name, model_uri)
125125

126126
([ENV["RABABA_DATA"]] + possible_paths).compact.each do |path|
127127
FileUtils.mkdir_p(path)
128-
write_path = path unless write_path
128+
write_path = path
129+
break
129130
rescue
130131
end
131132

@@ -137,8 +138,8 @@ def rababa_provision(model_name, model_uri)
137138
if File.exist?(model_path) && File.mtime(model_path) + 3600 >= Time.now
138139
return model_path
139140
else
140-
data = URI.open(model_uri).read
141-
File.write(model_path, data)
141+
data = URI.open(model_uri, encoding: "BINARY").read
142+
File.binwrite(model_path, data)
142143
return model_path
143144
end
144145
end

0 commit comments

Comments
 (0)