ucengine 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -2
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/ucengine.rb +15 -12
- data/spec/ucengine_mock.rb +1 -1
- data/ucengine.gemspec +1 -31
- metadata +7 -37
- data/doc/UCEngine/Debug.html +0 -179
- data/doc/UCEngine.html +0 -769
- data/doc/created.rid +0 -2
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +0 -71
- data/doc/js/darkfish.js +0 -116
- data/doc/js/jquery.js +0 -32
- data/doc/js/quicksearch.js +0 -114
- data/doc/js/thickbox-compressed.js +0 -10
- data/doc/lib/ucengine_rb.html +0 -58
- data/doc/rdoc.css +0 -706
data/README.rdoc
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
= ucengine.rb
|
2
2
|
|
3
|
-
ucengine.rb can connect, subscribe, and publish events to
|
3
|
+
ucengine.rb can connect, subscribe, and publish events to U.C.Engine.
|
4
|
+
|
5
|
+
http://docs.ucengine.org/
|
4
6
|
|
5
7
|
== Copyright
|
6
8
|
|
7
|
-
Copyright (c) 2010 AF83. See LICENSE for details.
|
9
|
+
Copyright (c) 2010-2011 AF83. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -6,8 +6,8 @@ begin
|
|
6
6
|
require 'jeweler'
|
7
7
|
Jeweler::Tasks.new do |gem|
|
8
8
|
gem.name = "ucengine"
|
9
|
-
gem.summary = %Q{Ruby library for
|
10
|
-
gem.description = %Q{ucengine.rb is a Ruby library to consume the
|
9
|
+
gem.summary = %Q{Ruby library for U.C.Engine}
|
10
|
+
gem.description = %Q{ucengine.rb is a Ruby library to consume the U.C.Engine API}
|
11
11
|
gem.email = "victor.goya@af83.com"
|
12
12
|
gem.homepage = "http://github.com/AF83/ucengine.rb"
|
13
13
|
gem.authors = ["AF83"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/lib/ucengine.rb
CHANGED
@@ -6,7 +6,7 @@ require 'rest-client'
|
|
6
6
|
require 'daemons'
|
7
7
|
require 'uri'
|
8
8
|
|
9
|
-
# ucengine.rb implements the
|
9
|
+
# ucengine.rb implements the U.C.Engine API, it can currently handle
|
10
10
|
# publish/subscribe to any event stream.
|
11
11
|
#
|
12
12
|
# Author:: Victor Goya (victor.goya@af83.com)
|
@@ -15,12 +15,12 @@ require 'uri'
|
|
15
15
|
# Website:: http://ucengine.org/
|
16
16
|
|
17
17
|
# This class is the main and only class in ucengine.rb, it handles
|
18
|
-
# connections and request to the
|
18
|
+
# connections and request to the U.C.Engine server.
|
19
19
|
#
|
20
20
|
# uce = UCEngine.new("localhost", 4567)
|
21
|
-
# uce.connect("uce@example.com", :
|
22
|
-
# uce.subscribe(
|
23
|
-
# uce.publish(:location => event['location']
|
21
|
+
# uce.connect("uce@example.com", :credential => 'pwd') do |uce|
|
22
|
+
# uce.subscribe("", :type => 'chat.message.new', :search => 'HTML5') do |event|
|
23
|
+
# uce.publish(:location => event['location'],
|
24
24
|
# :from => 'bot',
|
25
25
|
# :type => 'chat.message.new',
|
26
26
|
# :metadata => {"text" => "Hey, you were talking about HTML5"})
|
@@ -41,7 +41,7 @@ class UCEngine
|
|
41
41
|
|
42
42
|
API_ROOT = "/api"
|
43
43
|
|
44
|
-
API_VERSION = "0.
|
44
|
+
API_VERSION = "0.4"
|
45
45
|
|
46
46
|
attr_reader :sid, :uid, :connected
|
47
47
|
|
@@ -52,7 +52,7 @@ class UCEngine
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Run the ucengine server with all the options from the 'daemons' gem. This
|
55
|
-
# function is not mandatory and it is possible to run a
|
55
|
+
# function is not mandatory and it is possible to run a U.C.Engine client without
|
56
56
|
# having to run it in background.
|
57
57
|
# The 'name' parameter is the name you want to give to your brick.
|
58
58
|
#
|
@@ -66,7 +66,7 @@ class UCEngine
|
|
66
66
|
Daemons.run_proc(name, &proc)
|
67
67
|
end
|
68
68
|
|
69
|
-
# Create a new
|
69
|
+
# Create a new U.C.Engine object. 'host' is the hostname of the U.C.Engine server
|
70
70
|
# and 'port' is to TCP port to connect to. Note that this method doesn't create
|
71
71
|
# a new connection, see the #connect method.
|
72
72
|
# An additional 'debug' parameter set the debug level of the library, all the
|
@@ -80,13 +80,14 @@ class UCEngine
|
|
80
80
|
debug(UCEngine::DEBUG, "Initialisation complete for #{host}:#{port}.")
|
81
81
|
end
|
82
82
|
|
83
|
+
# Return true if a connection to U.C.Engine has been established, return false otherwise.
|
83
84
|
def connected?
|
84
85
|
@connected
|
85
86
|
end
|
86
87
|
|
87
|
-
# Connect to the
|
88
|
+
# Connect to the U.C.Engine server with the User ID 'uid' and the its credential.
|
89
|
+
#
|
88
90
|
#
|
89
|
-
#
|
90
91
|
# uce = UCEngine.new("localhost", 4567)
|
91
92
|
# uce.connect("bibi", :credential => 'abcd') do |uce|
|
92
93
|
# ... your code goes here
|
@@ -124,6 +125,7 @@ class UCEngine
|
|
124
125
|
# :from => the origin of the message, the value is an uid.
|
125
126
|
# :parent => the id of the the parent event.
|
126
127
|
# :search => list of keywords that match the metadata of the returned events
|
128
|
+
# :order => "asc" or "desc" datetimes
|
127
129
|
#
|
128
130
|
#
|
129
131
|
# # Returns 30 events, starting from the 31th events, containing the keyword "HTML5"
|
@@ -187,6 +189,7 @@ class UCEngine
|
|
187
189
|
# Publish an event. Publishing an event require a few mandatories parameters:
|
188
190
|
# [:location] As described in the subscribe method: "meeting" publish the event in a specific meeting or "": publish the event in the server root.
|
189
191
|
# [:type] The type of event to send, the format of this type is usually 'namespace.object.action', for example: 'chat.message.new', 'twitter.tweet.new', 'internal.user.update'
|
192
|
+
# Optional parameters:
|
190
193
|
# [:parent] The id of the parent, this parameter is useful to build event hierarchy.
|
191
194
|
# [:metadata] A hash of freely defined values to append to the event.
|
192
195
|
#
|
@@ -212,7 +215,7 @@ class UCEngine
|
|
212
215
|
# This function can be useful if you need to search for events from _now_.
|
213
216
|
#
|
214
217
|
# uce.time -> 1240394032
|
215
|
-
#
|
218
|
+
#
|
216
219
|
def time
|
217
220
|
time = get("/time", Hash.new)['result'].to_i
|
218
221
|
debug(UCEngine::DEBUG, "Fecth timestamp from UCEngine: #{time}")
|
@@ -240,7 +243,7 @@ class UCEngine
|
|
240
243
|
|
241
244
|
# Upload a file to UCEngine. The location is where
|
242
245
|
# you want the file to be uploaded. The 'file' parameter is a File object.
|
243
|
-
# This function returns a JSON structure {'result': file_id} where 'file_id' is the identification
|
246
|
+
# This function returns a JSON structure {'result': file_id} where 'file_id' is the identification
|
244
247
|
# number of the file.
|
245
248
|
#
|
246
249
|
# uce.upload(["demo_meeting"], File.new("/path/file_to_upload.pdf"))
|
data/spec/ucengine_mock.rb
CHANGED
data/ucengine.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ucengine}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["AF83"]
|
@@ -22,36 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
"README.rdoc",
|
23
23
|
"Rakefile",
|
24
24
|
"VERSION",
|
25
|
-
"doc/UCEngine.html",
|
26
|
-
"doc/UCEngine/Debug.html",
|
27
|
-
"doc/created.rid",
|
28
|
-
"doc/images/brick.png",
|
29
|
-
"doc/images/brick_link.png",
|
30
|
-
"doc/images/bug.png",
|
31
|
-
"doc/images/bullet_black.png",
|
32
|
-
"doc/images/bullet_toggle_minus.png",
|
33
|
-
"doc/images/bullet_toggle_plus.png",
|
34
|
-
"doc/images/date.png",
|
35
|
-
"doc/images/find.png",
|
36
|
-
"doc/images/loadingAnimation.gif",
|
37
|
-
"doc/images/macFFBgHack.png",
|
38
|
-
"doc/images/package.png",
|
39
|
-
"doc/images/page_green.png",
|
40
|
-
"doc/images/page_white_text.png",
|
41
|
-
"doc/images/page_white_width.png",
|
42
|
-
"doc/images/plugin.png",
|
43
|
-
"doc/images/ruby.png",
|
44
|
-
"doc/images/tag_green.png",
|
45
|
-
"doc/images/wrench.png",
|
46
|
-
"doc/images/wrench_orange.png",
|
47
|
-
"doc/images/zoom.png",
|
48
|
-
"doc/index.html",
|
49
|
-
"doc/js/darkfish.js",
|
50
|
-
"doc/js/jquery.js",
|
51
|
-
"doc/js/quicksearch.js",
|
52
|
-
"doc/js/thickbox-compressed.js",
|
53
|
-
"doc/lib/ucengine_rb.html",
|
54
|
-
"doc/rdoc.css",
|
55
25
|
"lib/ucengine.rb",
|
56
26
|
"spec/spec_helper.rb",
|
57
27
|
"spec/ucengine_mock.rb",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ucengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- AF83
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-15 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
version: 2.4.0
|
96
96
|
type: :development
|
97
97
|
version_requirements: *id005
|
98
|
-
description: ucengine.rb is a Ruby library to consume the
|
98
|
+
description: ucengine.rb is a Ruby library to consume the U.C.Engine API
|
99
99
|
email: victor.goya@af83.com
|
100
100
|
executables: []
|
101
101
|
|
@@ -110,36 +110,6 @@ files:
|
|
110
110
|
- README.rdoc
|
111
111
|
- Rakefile
|
112
112
|
- VERSION
|
113
|
-
- doc/UCEngine.html
|
114
|
-
- doc/UCEngine/Debug.html
|
115
|
-
- doc/created.rid
|
116
|
-
- doc/images/brick.png
|
117
|
-
- doc/images/brick_link.png
|
118
|
-
- doc/images/bug.png
|
119
|
-
- doc/images/bullet_black.png
|
120
|
-
- doc/images/bullet_toggle_minus.png
|
121
|
-
- doc/images/bullet_toggle_plus.png
|
122
|
-
- doc/images/date.png
|
123
|
-
- doc/images/find.png
|
124
|
-
- doc/images/loadingAnimation.gif
|
125
|
-
- doc/images/macFFBgHack.png
|
126
|
-
- doc/images/package.png
|
127
|
-
- doc/images/page_green.png
|
128
|
-
- doc/images/page_white_text.png
|
129
|
-
- doc/images/page_white_width.png
|
130
|
-
- doc/images/plugin.png
|
131
|
-
- doc/images/ruby.png
|
132
|
-
- doc/images/tag_green.png
|
133
|
-
- doc/images/wrench.png
|
134
|
-
- doc/images/wrench_orange.png
|
135
|
-
- doc/images/zoom.png
|
136
|
-
- doc/index.html
|
137
|
-
- doc/js/darkfish.js
|
138
|
-
- doc/js/jquery.js
|
139
|
-
- doc/js/quicksearch.js
|
140
|
-
- doc/js/thickbox-compressed.js
|
141
|
-
- doc/lib/ucengine_rb.html
|
142
|
-
- doc/rdoc.css
|
143
113
|
- lib/ucengine.rb
|
144
114
|
- spec/spec_helper.rb
|
145
115
|
- spec/ucengine_mock.rb
|
@@ -178,7 +148,7 @@ rubyforge_project:
|
|
178
148
|
rubygems_version: 1.3.7
|
179
149
|
signing_key:
|
180
150
|
specification_version: 3
|
181
|
-
summary: Ruby library for
|
151
|
+
summary: Ruby library for U.C.Engine
|
182
152
|
test_files:
|
183
153
|
- spec/spec_helper.rb
|
184
154
|
- spec/ucengine_mock.rb
|
data/doc/UCEngine/Debug.html
DELETED
@@ -1,179 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
-
<head>
|
6
|
-
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
-
|
8
|
-
<title>Class: UCEngine::Debug</title>
|
9
|
-
|
10
|
-
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
-
|
12
|
-
<script src="../js/jquery.js" type="text/javascript"
|
13
|
-
charset="utf-8"></script>
|
14
|
-
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
15
|
-
charset="utf-8"></script>
|
16
|
-
<script src="../js/quicksearch.js" type="text/javascript"
|
17
|
-
charset="utf-8"></script>
|
18
|
-
<script src="../js/darkfish.js" type="text/javascript"
|
19
|
-
charset="utf-8"></script>
|
20
|
-
|
21
|
-
</head>
|
22
|
-
<body class="class">
|
23
|
-
|
24
|
-
<div id="metadata">
|
25
|
-
<div id="home-metadata">
|
26
|
-
<div id="home-section" class="section">
|
27
|
-
<h3 class="section-header">
|
28
|
-
<a href="../index.html">Home</a>
|
29
|
-
<a href="../index.html#classes">Classes</a>
|
30
|
-
<a href="../index.html#methods">Methods</a>
|
31
|
-
</h3>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="file-metadata">
|
36
|
-
<div id="file-list-section" class="section">
|
37
|
-
<h3 class="section-header">In Files</h3>
|
38
|
-
<div class="section-body">
|
39
|
-
<ul>
|
40
|
-
|
41
|
-
<li><a href="../lib/ucengine_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
-
class="thickbox" title="lib/ucengine.rb">lib/ucengine.rb</a></li>
|
43
|
-
|
44
|
-
</ul>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<div id="class-metadata">
|
52
|
-
|
53
|
-
<!-- Parent Class -->
|
54
|
-
|
55
|
-
<div id="parent-class-section" class="section">
|
56
|
-
<h3 class="section-header">Parent</h3>
|
57
|
-
|
58
|
-
<p class="link">Object</p>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
|
62
|
-
|
63
|
-
<!-- Namespace Contents -->
|
64
|
-
|
65
|
-
|
66
|
-
<!-- Method Quickref -->
|
67
|
-
|
68
|
-
|
69
|
-
<!-- Included Modules -->
|
70
|
-
|
71
|
-
</div>
|
72
|
-
|
73
|
-
<div id="project-metadata">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
<div id="classindex-section" class="section project-section">
|
78
|
-
<h3 class="section-header">Class Index
|
79
|
-
<span class="search-toggle"><img src="../images/find.png"
|
80
|
-
height="16" width="16" alt="[+]"
|
81
|
-
title="show/hide quicksearch" /></span></h3>
|
82
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
83
|
-
<fieldset>
|
84
|
-
<legend>Quicksearch</legend>
|
85
|
-
<input type="text" name="quicksearch" value=""
|
86
|
-
class="quicksearch-field" />
|
87
|
-
</fieldset>
|
88
|
-
</form>
|
89
|
-
|
90
|
-
<ul class="link-list">
|
91
|
-
|
92
|
-
<li><a href="../UCEngine.html">UCEngine</a></li>
|
93
|
-
|
94
|
-
<li><a href="../UCEngine/Debug.html">UCEngine::Debug</a></li>
|
95
|
-
|
96
|
-
</ul>
|
97
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
98
|
-
</div>
|
99
|
-
|
100
|
-
|
101
|
-
</div>
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<div id="documentation">
|
105
|
-
<h1 class="class">UCEngine::Debug</h1>
|
106
|
-
|
107
|
-
<div id="description">
|
108
|
-
|
109
|
-
</div>
|
110
|
-
|
111
|
-
<!-- Constants -->
|
112
|
-
|
113
|
-
<div id="constants-list" class="section">
|
114
|
-
<h3 class="section-header">Constants</h3>
|
115
|
-
<dl>
|
116
|
-
|
117
|
-
<dt><a name="DEBUG">DEBUG</a></dt>
|
118
|
-
|
119
|
-
<dd class="description"><p>
|
120
|
-
Print every request and everything above.
|
121
|
-
</p></dd>
|
122
|
-
|
123
|
-
|
124
|
-
<dt><a name="WARNING">WARNING</a></dt>
|
125
|
-
|
126
|
-
<dd class="description"><p>
|
127
|
-
Print everything that seems fishy.
|
128
|
-
</p></dd>
|
129
|
-
|
130
|
-
|
131
|
-
<dt><a name="ERROR">ERROR</a></dt>
|
132
|
-
|
133
|
-
<dd class="description"><p>
|
134
|
-
Print regular errors, usually HTTP errors.
|
135
|
-
</p></dd>
|
136
|
-
|
137
|
-
|
138
|
-
<dt><a name="CRITICAL">CRITICAL</a></dt>
|
139
|
-
|
140
|
-
<dd class="description"><p>
|
141
|
-
Only print critical errors (bad hostname or port, etc).
|
142
|
-
</p></dd>
|
143
|
-
|
144
|
-
|
145
|
-
<dt><a name="QUIET">QUIET</a></dt>
|
146
|
-
|
147
|
-
<dd class="description"><p>
|
148
|
-
Don’t print anything (default).
|
149
|
-
</p></dd>
|
150
|
-
|
151
|
-
|
152
|
-
</dl>
|
153
|
-
</div>
|
154
|
-
|
155
|
-
|
156
|
-
<!-- Attributes -->
|
157
|
-
|
158
|
-
|
159
|
-
<!-- Methods -->
|
160
|
-
|
161
|
-
|
162
|
-
</div>
|
163
|
-
|
164
|
-
|
165
|
-
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
166
|
-
|
167
|
-
<p>Disabled; run with --debug to generate this.</p>
|
168
|
-
|
169
|
-
</div>
|
170
|
-
|
171
|
-
<div id="validator-badges">
|
172
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
173
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
174
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
175
|
-
</div>
|
176
|
-
|
177
|
-
</body>
|
178
|
-
</html>
|
179
|
-
|