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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e5475ece997b
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8b972a9a8c35
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Oct 27, 2013

  1. Copy the full SHA
    66b00c2 View commit details
  2. Copy the full SHA
    8b972a9 View commit details
Showing with 8 additions and 5 deletions.
  1. +7 −4 lib/opal/builder.rb
  2. +1 −1 stdlib/opal-gem.js.erb
11 changes: 7 additions & 4 deletions lib/opal/builder.rb
Original file line number Diff line number Diff line change
@@ -10,8 +10,9 @@ def self.build(name)
Builder.new.build name
end

def initialize(paths = nil)
@paths = paths || Opal.paths.clone
def initialize(options = {})
@paths = options.delete(:paths) || Opal.paths.clone
@options = options
@handled = {}
end

@@ -69,7 +70,9 @@ def build_asset(path)
@segments << __send__(builder, path)
end

def compile_ruby(str, options={})
def compile_ruby(str, options = nil)
options ||= @options.clone

compiler = Compiler.new
result = compiler.compile str, options

@@ -81,7 +84,7 @@ def compile_ruby(str, options={})
end

def build_ruby(path)
compile_ruby File.read(path)
compile_ruby File.read(path), @options.clone
end

def build_js(path)
2 changes: 1 addition & 1 deletion stdlib/opal-gem.js.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= Opal::Builder.new([Opal.gem_dir, Opal.std_dir]).build('opal') %>
<%= Opal::Builder.new(:paths => [Opal.gem_dir, Opal.std_dir]).build('opal') %>

Opal.compile = function(str) {
return Opal.Opal.$compile(str);