Class: Switchboard::Commands::Roster::Add
- Inherits:
-
Switchboard::Command
- Object
- Switchboard::Command
- Switchboard::Commands::Roster::Add
- Defined in:
- lib/switchboard/commands/roster/add.rb
Constant Summary
Constants inherited from Switchboard::Command
Switchboard::Command::DEFAULT_OPTIONS, Switchboard::Command::OPTIONS
Class Method Summary collapse
Methods inherited from Switchboard::Command
description, help, hide!, inherited, options, to_command, to_command_name, unregister!
Class Method Details
.run! ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/switchboard/commands/roster/add.rb', line 7 def self.run! # TODO override settings with values from the command line switchboard = Switchboard::Core.new do # add the server as a contact if it wasn't already added ARGV.each do |jid| if roster.find(jid).empty? puts "Adding #{jid} to my roster..." roster.add(jid, nil, true) end end end switchboard.plug!(AutoAcceptJack) switchboard.run! end |