ucengine 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ucengine.rb +9 -8
- metadata +5 -7
- data/.gitignore +0 -21
- data/ucengine.rb.gemspec +0 -57
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/ucengine.rb
CHANGED
@@ -54,14 +54,13 @@ class UCEngine
|
|
54
54
|
#
|
55
55
|
#
|
56
56
|
# uce = UCEngine.new("localhost", 4567)
|
57
|
-
# uce.connect("bibi", :
|
57
|
+
# uce.connect("bibi", :credential => 'abcd') do |uce|
|
58
58
|
# ... your code goes here
|
59
59
|
# end
|
60
60
|
#
|
61
|
-
|
62
|
-
def connect(uid, credential)
|
61
|
+
def connect(uid, params)
|
63
62
|
@uid = uid
|
64
|
-
response = put("/presence/#{@uid}", {:
|
63
|
+
response = put("/presence/#{@uid}", {:credential => params[:credential]})
|
65
64
|
@sid = response['result']
|
66
65
|
debug(UCEngine::DEBUG, "Authentification complete for #{@uid}/#{@sid}.")
|
67
66
|
yield self
|
@@ -163,8 +162,9 @@ class UCEngine
|
|
163
162
|
def get(path, params, http = @http)
|
164
163
|
params[:uid] = @uid if @uid
|
165
164
|
params[:sid] = @sid if @sid
|
166
|
-
|
167
|
-
|
165
|
+
debug(UCEngine::DEBUG, "Request: GET /api/0.1#{path}?#{UCEngine.encode(params)}")
|
166
|
+
result = JSON.parse(http.get("/api/0.1#{path}?#{UCEngine.encode(params)}").body)
|
167
|
+
debug(UCEngine::DEBUG, "Result: #{result}")
|
168
168
|
return result
|
169
169
|
end
|
170
170
|
|
@@ -172,8 +172,9 @@ class UCEngine
|
|
172
172
|
def post(path, params, http = @http)
|
173
173
|
params[:uid] = @uid if @uid
|
174
174
|
params[:sid] = @sid if @sid
|
175
|
-
|
176
|
-
|
175
|
+
debug(UCEngine::DEBUG, "Request: POST /api/0.1#{path}?#{UCEngine.encode(params)}")
|
176
|
+
result = JSON.parse(http.post("/api/0.1#{path}", UCEngine.encode(params)).body)
|
177
|
+
debug(UCEngine::DEBUG, "Result: #{result}")
|
177
178
|
return result
|
178
179
|
end
|
179
180
|
|
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
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- AF83
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-10 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -54,7 +54,6 @@ extra_rdoc_files:
|
|
54
54
|
- README.rdoc
|
55
55
|
files:
|
56
56
|
- .document
|
57
|
-
- .gitignore
|
58
57
|
- LICENSE
|
59
58
|
- README.rdoc
|
60
59
|
- Rakefile
|
@@ -92,14 +91,13 @@ files:
|
|
92
91
|
- lib/ucengine.rb
|
93
92
|
- test/helper.rb
|
94
93
|
- test/test_ucengine.rb
|
95
|
-
- ucengine.rb.gemspec
|
96
94
|
has_rdoc: true
|
97
95
|
homepage: http://github.com/AF83/ucengine.rb
|
98
96
|
licenses: []
|
99
97
|
|
100
98
|
post_install_message:
|
101
|
-
rdoc_options:
|
102
|
-
|
99
|
+
rdoc_options: []
|
100
|
+
|
103
101
|
require_paths:
|
104
102
|
- lib
|
105
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/.gitignore
DELETED
data/ucengine.rb.gemspec
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{ucengine.rb}
|
8
|
-
s.version = "0.1.0"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["AF83"]
|
12
|
-
s.date = %q{2010-11-23}
|
13
|
-
s.description = %q{ucengine.rb is a Ruby library to consume the UCEngine API}
|
14
|
-
s.email = %q{victor.goya@af83.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"lib/ucengine.rb",
|
27
|
-
"test/helper.rb",
|
28
|
-
"test/test_ucengine.rb.rb",
|
29
|
-
"ucengine.rb.gemspec"
|
30
|
-
]
|
31
|
-
s.homepage = %q{http://github.com/AF83/ucengine.rb}
|
32
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
-
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.7}
|
35
|
-
s.summary = %q{Ruby library for UCEngine}
|
36
|
-
s.test_files = [
|
37
|
-
"test/helper.rb",
|
38
|
-
"test/test_ucengine.rb.rb"
|
39
|
-
]
|
40
|
-
|
41
|
-
if s.respond_to? :specification_version then
|
42
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
-
s.specification_version = 3
|
44
|
-
|
45
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
|
-
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
47
|
-
s.add_runtime_dependency(%q<json>, [">= 0"])
|
48
|
-
else
|
49
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
50
|
-
s.add_dependency(%q<json>, [">= 0"])
|
51
|
-
end
|
52
|
-
else
|
53
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
54
|
-
s.add_dependency(%q<json>, [">= 0"])
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|