I tried to upgrade to use Opal 0.7.0.beta. I want to compile to a static app and follow the steps in http://opalrb.org/docs/static_applications/
My Rakefile looks like the one below. The questions:
How do I need to rework the :build task to get rid of the deprecation message. i tried. to use Opal::Server instead of Opal::Environment but it did not work.
I get `Opal already loaded. Loading twice can cause troubles, please fix your setup.``
I get
undefined is not a function
in the generated javascriptOpal.mark_as_loaded(Opal.normalize_loadable_path("corelib/runtime"));
Thanks for Opal and thanks for any advice.
# Rakefile
require 'opal'
require 'opal/sprockets/environment'
require 'opal-jquery'
require 'erb'
require 'zip'
ZUPFNOTER_JS = "../deploy_files/build.js"
desc "Build our app to #{ZUPFNOTER_JS}"
task :build do
env = Opal::Environment.new
env.append_path "."
env.use_gem "vector2d"
File.open(ZUPFNOTER_JS, "w+") do |out|
out << env["application"].to_s
end
Dir.glob "../public/*.scss" do |f|
cmd = "sass #{f} > #{File.dirname(f)}/#{File.basename(f, ".scss")}.css"
puts sh cmd
end
end
...