At long last! This PR adds Ruby library support to ModShot. ModShot will now ship ruby standard libraries with it, and you should be able to use it in your code anywhere. This should allow the use of arbitrary ruby gems too, but I don't have a way to automatically build them yet (you can manually place them into lib/ruby after building I suppose)
This also ships the default Mozilla certificate store with ModShot, so OpenSSL can work. The net/http library should work without any issues in RGSS code, just require 'net/http'.
Detailed changes:
Build Eliza's ruby with with-openssl=True to enable the openssl extension (conanfile.py)
Copy the built libraries and extensions to the ModShot dist folder under lib/ruby (conanfile.py and make-appimage.sh)
Automatically download the Mozilla CA store from curl and put it in ssl/cacert.pem in the dist folder (conanfile.py and make-appimage.sh
Add lib/ruby into our ruby library search path early on in the ruby initialization process (binding-mri.cpp)
Initialize ruby properly using ruby_options, which should evaluate the prelude (contains important stuff like IO#read_nonblock) and some encoding stuff (so no need to require enc/encdb and stuff) (binding-mri.cpp)
Add the SSL_CERT_FILE environment variable to point it to our shipped certificate store (binding-mri.cpp)
A test build is available here for windows, and you can test it by running $game_temp.message_text = Net::HTTP.get(URI('http://example.com'))[0..62] in an event somewhere (should output the first lines of HTML in a in-game textbox.
At long last! This PR adds Ruby library support to ModShot. ModShot will now ship ruby standard libraries with it, and you should be able to use it in your code anywhere. This should allow the use of arbitrary ruby gems too, but I don't have a way to automatically build them yet (you can manually place them into
lib/ruby
after building I suppose)This also ships the default Mozilla certificate store with ModShot, so OpenSSL can work. The
net/http
library should work without any issues in RGSS code, justrequire 'net/http'
.Detailed changes:
with-openssl=True
to enable the openssl extension (conanfile.py)lib/ruby
(conanfile.py and make-appimage.sh)ssl/cacert.pem
in the dist folder (conanfile.py and make-appimage.shlib/ruby
into our ruby library search path early on in the ruby initialization process (binding-mri.cpp)ruby_options
, which should evaluate the prelude (contains important stuff like IO#read_nonblock) and some encoding stuff (so no need to requireenc/encdb
and stuff) (binding-mri.cpp)SSL_CERT_FILE
environment variable to point it to our shipped certificate store (binding-mri.cpp)A test build is available here for windows, and you can test it by running
$game_temp.message_text = Net::HTTP.get(URI('http://example.com'))[0..62]
in an event somewhere (should output the first lines of HTML in a in-game textbox.