Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FAQ] Is it possible to install simple gems? If not, how to simulate doing so? #404

Open
rubyFeedback opened this issue Mar 3, 2024 · 0 comments

Comments

@rubyFeedback
Copy link

I suggest a new FAQ entry e. g. dealing with ruby gems via ruby.wasm.

Now, I assume right now this is not possible - that is ok. Please mention it in the FAQ.

But ... let's assume that some gems are simple.

Like a hello world gem:

class HelloWorld
  def initialize
  end
  def result?
    'Hello world!'
  end
end

So we can use the ruby.wasm .write() method onto result? (or any other
method name that is similar, this here is just an example).

Such code should work just fine. Just that it may be stored in a .gem file.

Is there a way to get support for that? In such a simple case we can probably
just embed the text (content of hello_world.rb) into the String that is evaluated,
so just File.read() should suffice. But I wonder whether there is some official
support for this via ruby.wasm. Many simple gems could be made to work
that way. (Of course other gems that are more complicated or require
Thread may not work, but perhaps in the future.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant