Class: DuoRuby::Server::FrontendCompiler
- Inherits:
-
Object
- Object
- DuoRuby::Server::FrontendCompiler
- Defined in:
- lib/duoruby/server/frontend_compiler.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(root) ⇒ FrontendCompiler
constructor
A new instance of FrontendCompiler.
Constructor Details
#initialize(root) ⇒ FrontendCompiler
Returns a new instance of FrontendCompiler.
11 12 13 |
# File 'lib/duoruby/server/frontend_compiler.rb', line 11 def initialize(root) @root = root end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/duoruby/server/frontend_compiler.rb', line 15 def call Opal.reset_paths! Opal.use_gem("opal-browser") Opal.use_gem("paggio") Opal.append_path(File.join(Gem::Specification.find_by_name("opal-browser").gem_dir, "opal")) append_frontend_gems builder = Opal::Builder.new builder.stubs.concat(DuoRuby.config.frontend_stubs) builder.append_paths(File.join(@root, "app"), File.("../..", __dir__)) builder.build("opal") builder.build("setup/frontend") builder.to_s end |