Module: Eceval

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

Defined Under Namespace

Modules: CLI Classes: Chunk, EvaluationContext

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

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



17
18
19
20
21
22
23
24
# File 'lib/eceval.rb', line 17

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