diff --git a/lib/wasify.rb b/lib/wasify.rb index f1e1090..039dab3 100644 --- a/lib/wasify.rb +++ b/lib/wasify.rb @@ -34,6 +34,7 @@ def self.pack def self.generate_html(entrypoint) entrypoint_txt = DepsManager.add_entrypoint(entrypoint) + wasm_wasi_version = ENV["WASIFY_VERSION"] || "2.3.0" template = 'wasify/template.erb' html = ERB.new(File.read(File.join(__dir__, template))).result(binding) File.rename('index.html', 'index.html.bak') if File.exist?('index.html') diff --git a/lib/wasify/cmd_runner.rb b/lib/wasify/cmd_runner.rb index bcefde4..2cb8aa9 100644 --- a/lib/wasify/cmd_runner.rb +++ b/lib/wasify/cmd_runner.rb @@ -4,7 +4,8 @@ class Wasify # methods interacting with the command line class CMDRunner def self.download_binary - system('curl -LO https://github.com/ruby/ruby.wasm/releases/latest/download/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz') + version = ENV["WASIFY_VERSION"] || "2.3.0" + system("curl -LO https://github.com/ruby/ruby.wasm/releases/download/#{version}/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz") end def self.unzip_binary diff --git a/lib/wasify/template.erb b/lib/wasify/template.erb index 2c411e2..09f67cb 100644 --- a/lib/wasify/template.erb +++ b/lib/wasify/template.erb @@ -1,6 +1,6 @@ - +