Sha256: 123809686f2bef3cb5e165acbeda5888311ac4fdd2ea5774a594807e008ff48d

Contents?: true

Size: 553 Bytes

Versions: 7

Compression:

Stored size: 553 Bytes

Contents

require_relative 'engine/context'
module Stamina
  class Engine

    def initialize
      extend(Stamina::Dsl)
    end

    def execute_binding
      binding
    end

    def execute(code, file = nil)
      code = <<-EOF
        main = begin
          #{code}
        end
        Context.new(local_variables, binding)
      EOF
      if file
        eval(code, execute_binding, file)
      else
        eval(code, execute_binding)
      end
    end

    def self.execute(*args)
      new.execute(*args)
    end

  end # class Engine
end # module Stamina

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stamina-core-0.6.1 lib/stamina-core/stamina/engine.rb
stamina-core-0.6.0 lib/stamina-core/stamina/engine.rb
stamina-core-0.5.4 lib/stamina-core/stamina/engine.rb
stamina-core-0.5.3 lib/stamina-core/stamina/engine.rb
stamina-core-0.5.2 lib/stamina-core/stamina/engine.rb
stamina-core-0.5.1 lib/stamina-core/stamina/engine.rb
stamina-core-0.5.0 lib/stamina-core/stamina/engine.rb