Skip to content

Commit 4967799

Browse files
committedNov 13, 2013
Move Opal.compile() into compiler.rb
1 parent 5fa9c98 commit 4967799

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed
 

‎lib/opal.rb

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
# Opal is a ruby to javascript compiler, with a runtime for running
77
# in any javascript environment.
88
module Opal
9-
10-
def self.compile(source, options = {})
11-
Compiler.new.compile(source, options)
12-
end
13-
149
def self.gem_dir
1510
File.expand_path('..', __FILE__.untaint)
1611
end

‎lib/opal/compiler.rb

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
require 'opal/nodes'
55

66
module Opal
7+
def self.compile(source, options = {})
8+
Compiler.new.compile(source, options)
9+
end
10+
711
class Compiler
812
# Generated code gets indented with two spaces on each scope
913
INDENT = ' '

‎stdlib/opal-parser.rb

-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
require 'opal/erb'
44
require 'opal/version'
55

6-
module Opal
7-
def self.compile(source, options = {})
8-
Compiler.new.compile(source, options)
9-
end
10-
end
11-
126
module Kernel
137
def eval(str)
148
code = Opal.compile str

0 commit comments

Comments
 (0)
Please sign in to comment.