Class: DashcodeConverter::Scripts

Inherits:
Object
  • Object
show all
Defined in:
lib/dashcode-converter/scripts.rb

Instance Method Summary collapse

Constructor Details

#initialize(folder) ⇒ Scripts

Returns a new instance of Scripts.



5
6
7
8
9
10
11
# File 'lib/dashcode-converter/scripts.rb', line 5

def initialize(folder)
  @context= V8::Context.new
  @context.load(File.join(File.dirname(__FILE__), "env.js"))
  Dir.glob(File.join(folder, "**", "*.js")) { |file|
    @context.load(file)
  }
end

Instance Method Details

#[](name) ⇒ Object



13
14
15
# File 'lib/dashcode-converter/scripts.rb', line 13

def [](name)
  @context[name]
end