Skip to content

Commit 0fa0c92

Browse files
Merge pull request #589 from ruby/katei/use-default-gem
Stop using bundled gems in the example
2 parents d7b4444 + 96fbb97 commit 0fa0c92

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ group :check do
1414
# Use the latest version of webrick for URI change in Ruby 3.4
1515
gem "webrick", "~> 1.8.2"
1616
gem "syntax_tree", "~> 3.5"
17-
gem "steep", "~> 1.9" if RUBY_VERSION >= "3.1.0"
17+
gem "steep", "1.10.0" if RUBY_VERSION >= "3.1.0"
1818
end

lib/ruby_wasm/build/toolchain.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def self.check_executable(command)
4646
%i[cc cxx ranlib ld ar].each do |name|
4747
define_method(name) do
4848
@tools_cache ||= {} #: Hash[String, String]
49-
@tools_cache[name] ||= find_tool(name)
49+
__skip__ = @tools_cache[name] ||= find_tool(name)
5050
@tools_cache[name]
5151
end
5252
end

lib/ruby_wasm/packager/component_adapter.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
module RubyWasm::Packager::ComponentAdapter
2-
module_function
3-
42
# The path to the component adapter for the given WASI execution model.
53
#
64
# @param exec_model [String] "command" or "reactor"
7-
def wasi_snapshot_preview1(exec_model)
5+
def self.wasi_snapshot_preview1(exec_model)
86
File.join(
97
File.dirname(__FILE__),
108
"component_adapter",

packages/npm-packages/ruby-wasm-wasi/example/require_relative/index.html

+3-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@
2121
end
2222
end
2323

24-
# "bundle install --standalone" does not care about bundled gems, so we need
25-
# to activate them manually.
26-
Gem::Dependency.new("csv").to_spec.activate
27-
28-
# The above patch does not break the original require_relative
29-
require 'csv'
30-
csv = CSV.new "foo\nbar\n"
24+
# The above patch should not break the original require_relative
25+
require 'uri'
26+
URI.parse('http://example.com')
3127

3228
# Load the main script
3329
require_relative 'main'

sig/ruby_wasm/cli.rbs

+4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ module RubyWasm
2929

3030
def initialize: (stdout: IO, stderr: IO) -> void
3131

32+
def run: (Array[String] args) -> void
33+
3234
def build: (Array[String] args) -> void
35+
def do_build_with_force_ruby_platform: (cli_options options) -> void
3336
def pack: (Array[String] args) -> void
3437

3538
private
@@ -49,5 +52,6 @@ module RubyWasm
4952

5053
self.@logger: Logger?
5154
def self.logger: () -> Logger
55+
def self.logger=: (Logger) -> void
5256
attr_accessor self.log_level: Symbol
5357
end

sig/ruby_wasm/packager.rbs

+4
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ class RubyWasm::Packager
7070
def build_strategy: () -> BuildStrategy
7171

7272
class BuildStrategy
73+
include RubyWasm::_Cacheable
74+
7375
@packager: RubyWasm::Packager
7476
def initialize: (RubyWasm::Packager) -> void
77+
def target: () -> RubyWasm::Target
78+
def artifact: () -> string
7579
def build: (RubyWasm::BuildExecutor, untyped options) -> String
7680
def specs_with_extensions: () -> Array[[untyped, Array[string]]]
7781
def build_gem_exts: (RubyWasm::BuildExecutor, string gem_home) -> void

0 commit comments

Comments
 (0)