Module: Eceval

Defined in:
lib/eceval.rb,
lib/eceval/version.rb

Defined Under Namespace

Modules: CLI Classes: Chunk, EvaluationContext

Constant Summary collapse

EVAL_MARKER =
"#=>"
EVAL_EXCEPTION_MARKER =
"#=> !!!"
BEGIN_CODE_BLOCK =
'```ruby'
END_CODE_BLOCK =
'```'
NEW_SCOPE_DIRECTIVE =
'# eceval: new_scope'
NoExceptionRaised =
Class.new(RuntimeError)
VERSION =
'0.1'

Class Method Summary collapse

Class Method Details

.augment(io, out: $stdout, filename: "[String]", lineno: 1) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/eceval.rb', line 14

def self.augment(io, out: $stdout, filename: "[String]", lineno: 1)
  context = EvaluationContext.new(filename: filename, lineno: lineno)
  loop do
    break if io.eof?
    line = io.gets
    out.puts(context.process_line(line.chomp))
  end
end