Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit faf93bf

Browse files
committedMay 20, 2015
[snapshot]
1 parent bc63d07 commit faf93bf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
 

Diff for: ‎app/controllers/opal_spec_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def run
2121
runner_asset = sprockets.load "file://#{runner.to_s}?type=application/javascript"
2222
# runner_asset = sprockets.find_asset(logical_path) or raise("can't find asset #{logical_path}")
2323
runner_asset or raise("can't find asset #{logical_path}")
24-
render locals: { runner: runner_asset}
24+
render locals: { runner: runner_asset, runner_code: sprockets.load(runner_asset.included.last).to_s }
2525
end
2626

2727

Diff for: ‎app/views/opal_spec/run.html.erb

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
</ul>
1414

1515
<%#= javascript_include_tag runner_name, debug: true %>
16-
17-
<% runner.to_a.each do |a| %>
16+
<% sprockets = Rails.application.assets %>
17+
<% runner.included[0...-1].map { |uri| sprockets.load(uri) }.each do |a| %>
1818
<script src="<%= path_to_javascript(a.logical_path, debug: true) %>"></script>
1919
<% end %>
20-
<%= javascript_tag Opal::Processor.load_asset_code(Rails.application.assets, runner.logical_path) %>
20+
<%= javascript_tag runner_code %>
21+
<%= javascript_tag Opal::Processor.load_asset_code(sprockets, runner.logical_path) %>
2122

0 commit comments

Comments
 (0)
Please sign in to comment.