Module: Fargo::CLI
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/fargo/cli.rb,
lib/fargo/cli/help.rb,
lib/fargo/cli/info.rb,
lib/fargo/cli/stats.rb,
lib/fargo/cli/logging.rb,
lib/fargo/cli/searches.rb,
lib/fargo/cli/downloads.rb,
lib/fargo/cli/completion.rb,
lib/fargo/cli/nick_browser.rb
Defined Under Namespace
Modules: Completion, Downloads, Help, Info, Logging, NickBrowser, Searches, Stats Classes: Console, WrappingLogger
Class Method Summary collapse
Class Method Details
.start ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fargo/cli.rb', line 16 def self.start Fargo.logger = ActiveSupport::BufferedLogger.new WrappingLogger.new Fargo.logger.level = ActiveSupport::BufferedLogger::INFO console = Console.new EventMachine.error_handler { |e| if e. =~ /no acceptor/ puts "Couldn't open sockets for listening" puts " Ports in question:" [console.client.config.active_port, console.client.config.search_port, console.client.config.websocket_port].each do |p| puts "\t#{p}" end exit else Readline.above_prompt { puts "ERROR!!!", e., e.backtrace.join("\n") } end } begin console.client.connected? rescue DRb::DRbConnError current = Thread.current # Wait for the reactor to start Thread.start{ EventMachine.run{ console.client = Fargo::Client.new console.client.connect current.wakeup } } sleep end console. if !console.client.connected? puts "Client couldn't connect!" exit end IRB.start_session console.instance_eval{ binding } do console.setup_console end EventMachine.stop end |