Sha256: c6a3e2970f7dbf2b7035261531766f0221ed24f99e9f05cc1c067e4edf000975

Contents?: true

Size: 827 Bytes

Versions: 11

Compression:

Stored size: 827 Bytes

Contents

module Switchboard
  module Commands
    class PubSub
      class Delete < Switchboard::Command
        description "Deletes a pubsub node"

        def self.run!
          switchboard = Switchboard::Client.new do
            defer :node_deleted do
              delete_node(OPTIONS["pubsub.node"])
            end

            def node_deleted(success)
              if success
                puts "Node '#{OPTIONS["pubsub.node"]}' was deleted."
              else
                puts "Node '#{OPTIONS["pubsub.node"]}' could not be deleted."
              end
            end
          end

          if defined?(OAuth) && OPTIONS["oauth"]
            switchboard.plug!(OAuthPubSubJack)
          else
            switchboard.plug!(PubSubJack)
          end
          switchboard.run!
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
mojodna-switchboard-0.0.10 lib/switchboard/commands/pubsub/delete.rb
mojodna-switchboard-0.0.11 lib/switchboard/commands/pubsub/delete.rb
mojodna-switchboard-0.0.12 lib/switchboard/commands/pubsub/delete.rb
mojodna-switchboard-0.0.13 lib/switchboard/commands/pubsub/delete.rb
mojodna-switchboard-0.0.7 lib/switchboard/commands/pubsub/delete.rb
mojodna-switchboard-0.0.8 lib/switchboard/commands/pubsub/delete.rb
mojodna-switchboard-0.0.9 lib/switchboard/commands/pubsub/delete.rb
mojodna-switchboard-0.1.0 lib/switchboard/commands/pubsub/delete.rb
pkoch-switchboard-0.1.1b lib/switchboard/commands/pubsub/delete.rb
pkoch-switchboard-0.1.1a lib/switchboard/commands/pubsub/delete.rb
switchboard-0.1.0 lib/switchboard/commands/pubsub/delete.rb