Class: Switchboard::Commands::PubSub::Purge
- Inherits:
-
Switchboard::Command
- Object
- Switchboard::Command
- Switchboard::Commands::PubSub::Purge
- Defined in:
- lib/switchboard/commands/pubsub/purge.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 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/switchboard/commands/pubsub/purge.rb', line 7 def self.run! switchboard = Switchboard::Core.new do defer :node_purged do begin purge_items_from(OPTIONS["pubsub.node"]) rescue Jabber::ServerError => e puts e end end def node_purged(success) if success puts "Node '#{OPTIONS["pubsub.node"]}' was successfully purged." else puts "Could not purge node '#{OPTIONS["pubsub.node"]}'." end end end if OPTIONS["oauth"] switchboard.plug!(OAuthPubSubJack) else switchboard.plug!(PubSubJack) end switchboard.run! end |