pkoch-switchboard 0.1.1a → 0.1.1b
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -1
- data/lib/switchboard/helpers/muc.rb +10 -0
- data/lib/switchboard/jacks.rb +8 -8
- data/lib/switchboard/jacks/muc.rb +51 -0
- data/lib/switchboard/version.rb +1 -1
- data/switchboard.gemspec +2 -2
- metadata +4 -2
data/Rakefile
CHANGED
@@ -5,12 +5,13 @@ task :gemspec do
|
|
5
5
|
gemspec =<<-EOF
|
6
6
|
# this file is automatically generated
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "switchboard"
|
8
|
+
s.name = "pkoch-switchboard"
|
9
9
|
s.version = "#{Switchboard::VERSION * "."}"
|
10
10
|
s.summary = "XMPP toolkit."
|
11
11
|
s.description = "A toolkit for assembling XMPP clients and interacting with XMPP servers."
|
12
12
|
s.authors = ["Seth Fitzsimmons", "Paulo Köch"]
|
13
13
|
s.email = ["seth@mojodna.net", "paulo.koch@gmail.com"]
|
14
|
+
s.homepage = 'https://github.com/pkoch/switchboard'
|
14
15
|
|
15
16
|
s.files = #{Dir.glob("**/*").select { |f| File.file?(f) }.inspect}
|
16
17
|
s.executables = ["switchboard"]
|
data/lib/switchboard/jacks.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require 'jacks/auto_accept'
|
2
|
-
require 'jacks/debug'
|
3
|
-
require 'jacks/echo'
|
4
|
-
require 'jacks/muc'
|
5
|
-
require 'jacks/notify'
|
6
|
-
require 'jacks/oauth_pubsub'
|
7
|
-
require 'jacks/pubsub'
|
8
|
-
require 'jacks/roster_debug'
|
1
|
+
require 'switchboard/jacks/auto_accept'
|
2
|
+
require 'switchboard/jacks/debug'
|
3
|
+
require 'switchboard/jacks/echo'
|
4
|
+
require 'switchboard/jacks/muc'
|
5
|
+
require 'switchboard/jacks/notify'
|
6
|
+
require 'switchboard/jacks/oauth_pubsub'
|
7
|
+
require 'switchboard/jacks/pubsub'
|
8
|
+
require 'switchboard/jacks/roster_debug'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'xmpp4r/muc/helper/simplemucclient'
|
2
|
+
require 'switchboard/helpers/muc'
|
3
|
+
|
4
|
+
class MUCJack
|
5
|
+
def self.connect(switchboard, settings)
|
6
|
+
unless settings["muc.jid"]
|
7
|
+
puts "A MUC must be specified."
|
8
|
+
return false
|
9
|
+
end
|
10
|
+
|
11
|
+
switchboard.extend(Switchboard::Helpers::MUCHelper)
|
12
|
+
|
13
|
+
def switchboard.muc_say(message)
|
14
|
+
@muc.say(message)
|
15
|
+
end
|
16
|
+
|
17
|
+
switchboard.on_startup do
|
18
|
+
@muc = Jabber::MUC::SimpleMUCClient.new(client)
|
19
|
+
|
20
|
+
@muc.on_join do |time, nickname|
|
21
|
+
on(:muc_join, time, nickname)
|
22
|
+
end
|
23
|
+
|
24
|
+
@muc.on_leave do |time, nickname|
|
25
|
+
on(:muc_leave, time, nickname)
|
26
|
+
end
|
27
|
+
|
28
|
+
@muc.on_message do |time, sender, text|
|
29
|
+
on(:muc_message, time, sender, text)
|
30
|
+
end
|
31
|
+
|
32
|
+
@muc.on_private_message do |time, sender, text|
|
33
|
+
on(:muc_private_message, time, sender, text)
|
34
|
+
end
|
35
|
+
|
36
|
+
@muc.on_room_message do |time, text|
|
37
|
+
on(:muc_room_message, time, text)
|
38
|
+
end
|
39
|
+
|
40
|
+
@muc.on_self_leave do |time|
|
41
|
+
on(:muc_self_leave, time)
|
42
|
+
end
|
43
|
+
|
44
|
+
@muc.on_subject do |time, nickname, subject|
|
45
|
+
on(:muc_subject_change, time, nickname, subject)
|
46
|
+
end
|
47
|
+
|
48
|
+
@muc.join(settings["muc.jid"])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/switchboard/version.rb
CHANGED
data/switchboard.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# this file is automatically generated
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "pkoch-switchboard"
|
4
|
-
s.version = "0.1.
|
4
|
+
s.version = "0.1.1b"
|
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", "Paulo Köch"]
|
8
8
|
s.email = ["seth@mojodna.net", "paulo.koch@gmail.com"]
|
9
9
|
s.homepage = 'https://github.com/pkoch/switchboard'
|
10
10
|
|
11
|
-
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
|
+
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/muc.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/muc.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"]
|
12
12
|
s.executables = ["switchboard"]
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1b
|
9
|
+
version: 0.1.1b
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Seth Fitzsimmons
|
@@ -94,11 +94,13 @@ files:
|
|
94
94
|
- lib/switchboard/core.rb
|
95
95
|
- lib/switchboard/ext/delegate.rb
|
96
96
|
- lib/switchboard/ext/instance_exec.rb
|
97
|
+
- lib/switchboard/helpers/muc.rb
|
97
98
|
- lib/switchboard/helpers/oauth_pubsub.rb
|
98
99
|
- lib/switchboard/helpers/pubsub.rb
|
99
100
|
- lib/switchboard/jacks/auto_accept.rb
|
100
101
|
- lib/switchboard/jacks/debug.rb
|
101
102
|
- lib/switchboard/jacks/echo.rb
|
103
|
+
- lib/switchboard/jacks/muc.rb
|
102
104
|
- lib/switchboard/jacks/notify.rb
|
103
105
|
- lib/switchboard/jacks/oauth_pubsub.rb
|
104
106
|
- lib/switchboard/jacks/pubsub.rb
|