jacs 0.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -0
- data/lib/actionjabber.rb +8 -8
- metadata +2 -1
data/README.rdoc
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
A super-simple way to establish a client-server system using Jabber/XMPP. The protocol is heavily inspired by HTTP. (It even uses HTTP path formatting and status codes!)
|
|
6
6
|
|
|
7
|
+
=== Installation
|
|
8
|
+
|
|
9
|
+
gem install jacs
|
|
10
|
+
|
|
7
11
|
=== Copyright
|
|
8
12
|
|
|
9
13
|
Copyright (c) 2010 Dirk Gadsden. See LICENSE for details.
|
data/lib/actionjabber.rb
CHANGED
|
@@ -40,18 +40,18 @@ module ActionJabber
|
|
|
40
40
|
hash = parts.first
|
|
41
41
|
path_parts = parts.last.split('?', 2)
|
|
42
42
|
request = Request.new(hash, from, path_parts.first, ((path_parts.length == 2) ? path_parts.last : ''))
|
|
43
|
-
begin
|
|
43
|
+
#begin
|
|
44
44
|
#process_message(message.from.to_s.strip, message.body.strip)
|
|
45
45
|
response = {:status => 200, :data => ''}.merge @controller.route!(request)
|
|
46
46
|
#response = @controller.route! request
|
|
47
47
|
respond_to request, :status => response[:status], :data => response[:data]
|
|
48
|
-
rescue
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
else
|
|
53
|
-
|
|
54
|
-
end
|
|
48
|
+
#rescue
|
|
49
|
+
# respond_to request, :status => 500
|
|
50
|
+
# puts "Error responding to #{message.from.to_s.strip}:"
|
|
51
|
+
# puts $!
|
|
52
|
+
#else
|
|
53
|
+
# puts "Responded to '#{from}' in #{(Time.now - start).to_s} seconds."
|
|
54
|
+
#end
|
|
55
55
|
puts "\n"
|
|
56
56
|
end
|
|
57
57
|
end
|