Class: BoPeep::Runner
- Inherits:
-
Object
- Object
- BoPeep::Runner
- Defined in:
- lib/bopeep.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.
1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 |
# File 'lib/bopeep.rb', line 1649 def initialize(argv) @argv = argv.dup @path = nil find_bopeep_directory! load_config! @context = Context.new(@argv) @context.copy(BoPeep.config) load_scripts! load_commands! @command = Command.find(@argv) end |
Instance Method Details
#run ⇒ Object
1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 |
# File 'lib/bopeep.rb', line 1665 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 BoPeep.console.redirecting_stdout_and_stderr do @context.playlist.play end end |