我可以在Opal中使用Ruby宝石吗? [英] Can I use Ruby gems in Opal?
问题描述
opal-jquery
和维也纳$ c $你可以添加一个gem的<$ c <> $ c> lib
通过使用 Opal.use_gem
缺陷是:
- 使用String可变性
- 依赖于String和Symbol之间的区别 li>
- 炮击(
``
和%x {}
)
修复/解决其中一些问题的可用工具包括: 你可以看看 https:// github .com / opal / opal-rspec There's You can add a gem's Common pitfalls are: Available tools to fix/workaround some of those issues are: You can look at the https://github.com/opal/opal-rspec 这篇关于我可以在Opal中使用Ruby宝石吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
Opal :: Processor.stub_file('fileutils')
例如:
除非RUBY_ENGINE =='opal'
unparsable / break代码
opal- rspec的
源代码来查看这个行为:
opal-irb
and opal-jquery
and vienna
but is there any way to use gems directly in the browser via Opal?lib
path to Opal load paths by using Opal.use_gem
``
and %x{}
)
Opal::Processor.stub_file('fileutils')
RUBY_ENGINE
,
example:
unless RUBY_ENGINE == 'opal'
unparsable/breaking code here
end
opal-rspec
source code to see this stuff in action: