Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal-rails
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ec7b38440042
Choose a base ref
...
head repository: opal/opal-rails
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 347ef784cb42
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 25, 2015

  1. Don’t inject load code if it’s empty

    The plan is to make it empty if the main asset is not processed by opal.
    elia committed Mar 25, 2015
    Copy the full SHA
    2bdbc79 View commit details
  2. Copy the full SHA
    347ef78 View commit details
Showing with 7 additions and 3 deletions.
  1. +1 −1 app/helpers/opal_helper.rb
  2. +6 −2 lib/opal/rails/engine.rb
2 changes: 1 addition & 1 deletion app/helpers/opal_helper.rb
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ def javascript_include_tag(*sources)

sources_copy.map do |source|
loading_code = Opal::Processor.load_asset_code(sprockets, source)
script_tags << javascript_tag(loading_code)
script_tags << javascript_tag(loading_code) if loading_code.present?
end
script_tags
end
8 changes: 6 additions & 2 deletions lib/opal/rails/engine.rb
Original file line number Diff line number Diff line change
@@ -21,8 +21,12 @@ class Engine < ::Rails::Engine
end

initializer 'opal.asset_paths', :after => 'sprockets.environment', :group => :all do |app|
app.assets.append_path app.root.join('tmp/opal_spec').to_s
app.assets.append_path app.root.join(app.config.opal.spec_location).to_s
spec_location = app.root.join(app.config.opal.spec_location).to_s
runner_dir = app.root.join('tmp/opal_spec')
runner_dir.mkpath

app.assets.append_path runner_dir.to_s
app.assets.append_path spec_location
Opal.paths.each do |path|
app.assets.append_path path
end