Skip to content

Commit

Permalink
Move Opal.compile() into compiler.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 13, 2013
1 parent 5fa9c98 commit 4967799
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
5 changes: 0 additions & 5 deletions lib/opal.rb
Expand Up @@ -6,11 +6,6 @@
# Opal is a ruby to javascript compiler, with a runtime for running
# in any javascript environment.
module Opal

def self.compile(source, options = {})
Compiler.new.compile(source, options)
end

def self.gem_dir
File.expand_path('..', __FILE__.untaint)
end
Expand Down
4 changes: 4 additions & 0 deletions lib/opal/compiler.rb
Expand Up @@ -4,6 +4,10 @@
require 'opal/nodes'

module Opal
def self.compile(source, options = {})
Compiler.new.compile(source, options)
end

class Compiler
# Generated code gets indented with two spaces on each scope
INDENT = ' '
Expand Down
6 changes: 0 additions & 6 deletions stdlib/opal-parser.rb
Expand Up @@ -3,12 +3,6 @@
require 'opal/erb'
require 'opal/version'

module Opal
def self.compile(source, options = {})
Compiler.new.compile(source, options)
end
end

module Kernel
def eval(str)
code = Opal.compile str
Expand Down

0 comments on commit 4967799

Please sign in to comment.