Module: RS

Defined in:
lib/rs/ui.rb,
lib/rs/eval.rb

Overview

Copyright © 2005-2010 Eero Saynatkari, all rights reserved.

Licence

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and attribution to the original authors.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and attribution to the original authors in the documentation and/or other materials provided with the distribution.

  • The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission.

Disclaimer

This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose. Authors are not responsible for any damages, direct or indirect.

Defined Under Namespace

Classes: Evaluator, IncompleteExpression, UI

Class Method Summary collapse

Class Method Details

.start(&block) ⇒ Object

Creates and yields a new Evaluator.

The block given should implement whatever logic is desired. Will clean up as necessary.

TODO: This needs much improvement, probably. –rue



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rs/eval.rb', line 41

def self.start(&block)
  rs = Evaluator.new

  begin
    rs.send :run, &block

  rescue SystemExit => e
    # No need to print errors etc., but set return code.
    exit! e.status
  end
end