Class: Raheui::CLI
- Inherits:
-
Object
- Object
- Raheui::CLI
- Defined in:
- lib/raheui/cli.rb
Overview
Handle command line interfaces logic.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
Initialize a CLI.
-
#run(args = ARGV) ⇒ Object
Entry point for the applicaiton logic.
Constructor Details
#initialize ⇒ CLI
Initialize a CLI.
7 8 9 |
# File 'lib/raheui/cli.rb', line 7 def initialize = {} end |
Instance Method Details
#run(args = ARGV) ⇒ Object
Entry point for the applicaiton logic. Process command line arguments and run the Aheui code.
args - An Array of Strings user passed.
Returns an Integer UNIX exit code.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/raheui/cli.rb', line 17 def run(args = ARGV) , paths = Option.new.parse(args) source = if paths.empty? $stdin.read else File.read(paths[0]) end runner = Runner.new(Code.new(source)) runner.run end |