Class: Warg::Runner
- Inherits:
-
Object
- Object
- Warg::Runner
- Defined in:
- lib/warg.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ Runner
Returns a new instance of Runner.
1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 |
# File 'lib/warg.rb', line 1523 def initialize(argv) @argv = argv.dup @path = nil @playlist = Playlist.new find_warg_directory! load_config! @context = Context.new(@argv, @playlist) @context.copy(Warg.config) load_scripts! load_commands! @command = Command.find(@argv) end |
Instance Method Details
#run ⇒ Object
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 |
# File 'lib/warg.rb', line 1540 def run if @command.nil? @context. $stderr.puts "Could not find command from #{@argv.inspect}" exit 1 end @command.(@context) @context. Console.hostname_width = @context.hosts.map { |host| host.address.length }.max Warg.console.redirecting_stdout_and_stderr do @playlist.play end end |