mojodna-switchboard 0.0.13 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Rakefile +1 -1
- data/lib/switchboard/commands.rb +1 -0
- data/lib/switchboard/commands/grep.rb +23 -0
- data/lib/switchboard/core.rb +4 -1
- data/lib/switchboard/version.rb +1 -1
- data/switchboard.gemspec +3 -3
- metadata +6 -6
data/History.txt
ADDED
data/Rakefile
CHANGED
data/lib/switchboard/commands.rb
CHANGED
@@ -2,6 +2,7 @@ require 'switchboard/commands/command'
|
|
2
2
|
require 'switchboard/commands/config'
|
3
3
|
require 'switchboard/commands/default'
|
4
4
|
require 'switchboard/commands/disco'
|
5
|
+
require 'switchboard/commands/grep'
|
5
6
|
require 'switchboard/commands/help'
|
6
7
|
require 'switchboard/commands/last'
|
7
8
|
require 'switchboard/commands/pep'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Switchboard
|
2
|
+
module Commands
|
3
|
+
class Grep < Switchboard::Command
|
4
|
+
description "Search for an XPath expression"
|
5
|
+
|
6
|
+
def self.run!
|
7
|
+
expr = ARGV.pop
|
8
|
+
|
9
|
+
switchboard = Switchboard::Client.new
|
10
|
+
switchboard.plug!(AutoAcceptJack, NotifyJack)
|
11
|
+
|
12
|
+
switchboard.on_stanza do |stanza|
|
13
|
+
# TODO doesn't handle default namespaces properly
|
14
|
+
REXML::XPath.each(stanza, expr) do |el|
|
15
|
+
puts el.to_s
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
switchboard.run!
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/switchboard/core.rb
CHANGED
@@ -133,7 +133,7 @@ module Switchboard
|
|
133
133
|
@ready
|
134
134
|
end
|
135
135
|
|
136
|
-
hook(:exception, :iq, :message, :presence, :startup, :stream_connected, :shutdown)
|
136
|
+
hook(:exception, :iq, :message, :presence, :stanza, :startup, :stream_connected, :shutdown)
|
137
137
|
|
138
138
|
protected
|
139
139
|
|
@@ -232,14 +232,17 @@ module Switchboard
|
|
232
232
|
|
233
233
|
stream.add_presence_callback do |presence|
|
234
234
|
on(:presence, presence)
|
235
|
+
on(:stanza, presence)
|
235
236
|
end
|
236
237
|
|
237
238
|
stream.add_message_callback do |message|
|
238
239
|
on(:message, message)
|
240
|
+
on(:stanza, message)
|
239
241
|
end
|
240
242
|
|
241
243
|
stream.add_iq_callback do |iq|
|
242
244
|
on(:iq, iq)
|
245
|
+
on(:stanza, iq)
|
243
246
|
end
|
244
247
|
end
|
245
248
|
|
data/lib/switchboard/version.rb
CHANGED
data/switchboard.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# this file is automatically generated
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "switchboard"
|
4
|
-
s.version = "0.0
|
4
|
+
s.version = "0.1.0"
|
5
5
|
s.summary = "XMPP toolkit."
|
6
6
|
s.description = "A toolkit for assembling XMPP clients and interacting with XMPP servers."
|
7
7
|
s.authors = ["Seth Fitzsimmons"]
|
8
8
|
s.email = ["seth@mojodna.net"]
|
9
9
|
|
10
|
-
s.files = ["bin/switchboard", "examples/echo_bot.rb", "lib/switchboard/client.rb", "lib/switchboard/colors.rb", "lib/switchboard/commands/command.rb", "lib/switchboard/commands/config/config.rb", "lib/switchboard/commands/config.rb", "lib/switchboard/commands/default.rb", "lib/switchboard/commands/disco/disco.rb", "lib/switchboard/commands/disco/info.rb", "lib/switchboard/commands/disco/items.rb", "lib/switchboard/commands/disco.rb", "lib/switchboard/commands/help/help.rb", "lib/switchboard/commands/help.rb", "lib/switchboard/commands/last/last.rb", "lib/switchboard/commands/last.rb", "lib/switchboard/commands/pep/location.rb", "lib/switchboard/commands/pep/pep.rb", "lib/switchboard/commands/pep/tune.rb", "lib/switchboard/commands/pep.rb", "lib/switchboard/commands/pubsub/affiliations.rb", "lib/switchboard/commands/pubsub/config.rb", "lib/switchboard/commands/pubsub/create.rb", "lib/switchboard/commands/pubsub/delete.rb", "lib/switchboard/commands/pubsub/info.rb", "lib/switchboard/commands/pubsub/items.rb", "lib/switchboard/commands/pubsub/listen.rb", "lib/switchboard/commands/pubsub/nodes.rb", "lib/switchboard/commands/pubsub/options.rb", "lib/switchboard/commands/pubsub/publish.rb", "lib/switchboard/commands/pubsub/pubsub.rb", "lib/switchboard/commands/pubsub/purge.rb", "lib/switchboard/commands/pubsub/retract.rb", "lib/switchboard/commands/pubsub/subscribe.rb", "lib/switchboard/commands/pubsub/subscriptions.rb", "lib/switchboard/commands/pubsub/unsubscribe.rb", "lib/switchboard/commands/pubsub.rb", "lib/switchboard/commands/register.rb", "lib/switchboard/commands/roster/add.rb", "lib/switchboard/commands/roster/list.rb", "lib/switchboard/commands/roster/online.rb", "lib/switchboard/commands/roster/remove.rb", "lib/switchboard/commands/roster/roster.rb", "lib/switchboard/commands/roster.rb", "lib/switchboard/commands/unregister.rb", "lib/switchboard/commands.rb", "lib/switchboard/component.rb", "lib/switchboard/core.rb", "lib/switchboard/ext/delegate.rb", "lib/switchboard/ext/instance_exec.rb", "lib/switchboard/helpers/oauth_pubsub.rb", "lib/switchboard/helpers/pubsub.rb", "lib/switchboard/jacks/auto_accept.rb", "lib/switchboard/jacks/debug.rb", "lib/switchboard/jacks/echo.rb", "lib/switchboard/jacks/notify.rb", "lib/switchboard/jacks/oauth_pubsub.rb", "lib/switchboard/jacks/pubsub.rb", "lib/switchboard/jacks/roster_debug.rb", "lib/switchboard/jacks.rb", "lib/switchboard/settings.rb", "lib/switchboard/switchboard.rb", "lib/switchboard/version.rb", "lib/switchboard.rb", "
|
10
|
+
s.files = ["bin/switchboard", "examples/echo_bot.rb", "History.txt", "lib/switchboard/client.rb", "lib/switchboard/colors.rb", "lib/switchboard/commands/command.rb", "lib/switchboard/commands/config/config.rb", "lib/switchboard/commands/config.rb", "lib/switchboard/commands/default.rb", "lib/switchboard/commands/disco/disco.rb", "lib/switchboard/commands/disco/info.rb", "lib/switchboard/commands/disco/items.rb", "lib/switchboard/commands/disco.rb", "lib/switchboard/commands/grep.rb", "lib/switchboard/commands/help/help.rb", "lib/switchboard/commands/help.rb", "lib/switchboard/commands/last/last.rb", "lib/switchboard/commands/last.rb", "lib/switchboard/commands/pep/location.rb", "lib/switchboard/commands/pep/pep.rb", "lib/switchboard/commands/pep/tune.rb", "lib/switchboard/commands/pep.rb", "lib/switchboard/commands/pubsub/affiliations.rb", "lib/switchboard/commands/pubsub/config.rb", "lib/switchboard/commands/pubsub/create.rb", "lib/switchboard/commands/pubsub/delete.rb", "lib/switchboard/commands/pubsub/info.rb", "lib/switchboard/commands/pubsub/items.rb", "lib/switchboard/commands/pubsub/listen.rb", "lib/switchboard/commands/pubsub/nodes.rb", "lib/switchboard/commands/pubsub/options.rb", "lib/switchboard/commands/pubsub/publish.rb", "lib/switchboard/commands/pubsub/pubsub.rb", "lib/switchboard/commands/pubsub/purge.rb", "lib/switchboard/commands/pubsub/retract.rb", "lib/switchboard/commands/pubsub/subscribe.rb", "lib/switchboard/commands/pubsub/subscriptions.rb", "lib/switchboard/commands/pubsub/unsubscribe.rb", "lib/switchboard/commands/pubsub.rb", "lib/switchboard/commands/register.rb", "lib/switchboard/commands/roster/add.rb", "lib/switchboard/commands/roster/list.rb", "lib/switchboard/commands/roster/online.rb", "lib/switchboard/commands/roster/remove.rb", "lib/switchboard/commands/roster/roster.rb", "lib/switchboard/commands/roster.rb", "lib/switchboard/commands/unregister.rb", "lib/switchboard/commands.rb", "lib/switchboard/component.rb", "lib/switchboard/core.rb", "lib/switchboard/ext/delegate.rb", "lib/switchboard/ext/instance_exec.rb", "lib/switchboard/helpers/oauth_pubsub.rb", "lib/switchboard/helpers/pubsub.rb", "lib/switchboard/jacks/auto_accept.rb", "lib/switchboard/jacks/debug.rb", "lib/switchboard/jacks/echo.rb", "lib/switchboard/jacks/notify.rb", "lib/switchboard/jacks/oauth_pubsub.rb", "lib/switchboard/jacks/pubsub.rb", "lib/switchboard/jacks/roster_debug.rb", "lib/switchboard/jacks.rb", "lib/switchboard/settings.rb", "lib/switchboard/switchboard.rb", "lib/switchboard/version.rb", "lib/switchboard.rb", "Rakefile", "README.markdown", "switchboard.gemspec"]
|
11
11
|
s.executables = ["switchboard"]
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
|
14
|
-
s.add_dependency("
|
14
|
+
s.add_dependency("xmpp4r", ">=", "0.5")
|
15
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mojodna-switchboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Fitzsimmons
|
@@ -9,11 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-16 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: xmpp4r
|
17
17
|
type: :runtime
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
version: "0"
|
24
24
|
- - "="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: "0.5"
|
27
27
|
version:
|
28
28
|
description: A toolkit for assembling XMPP clients and interacting with XMPP servers.
|
29
29
|
email:
|
@@ -37,6 +37,7 @@ extra_rdoc_files: []
|
|
37
37
|
files:
|
38
38
|
- bin/switchboard
|
39
39
|
- examples/echo_bot.rb
|
40
|
+
- History.txt
|
40
41
|
- lib/switchboard/client.rb
|
41
42
|
- lib/switchboard/colors.rb
|
42
43
|
- lib/switchboard/commands/command.rb
|
@@ -47,6 +48,7 @@ files:
|
|
47
48
|
- lib/switchboard/commands/disco/info.rb
|
48
49
|
- lib/switchboard/commands/disco/items.rb
|
49
50
|
- lib/switchboard/commands/disco.rb
|
51
|
+
- lib/switchboard/commands/grep.rb
|
50
52
|
- lib/switchboard/commands/help/help.rb
|
51
53
|
- lib/switchboard/commands/help.rb
|
52
54
|
- lib/switchboard/commands/last/last.rb
|
@@ -99,10 +101,8 @@ files:
|
|
99
101
|
- lib/switchboard/switchboard.rb
|
100
102
|
- lib/switchboard/version.rb
|
101
103
|
- lib/switchboard.rb
|
102
|
-
- msg
|
103
104
|
- Rakefile
|
104
105
|
- README.markdown
|
105
|
-
- switchboard-0.0.11.gem
|
106
106
|
- switchboard.gemspec
|
107
107
|
has_rdoc: false
|
108
108
|
homepage:
|