garufa 1.0.1.rc.1 → 1.0.1.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/garufa.pid +1 -0
- data/lib/garufa/api.rb +12 -31
- data/lib/garufa/api/channels.rb +20 -0
- data/lib/garufa/api/events.rb +28 -0
- data/lib/garufa/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0b9da8c9009a15afb99fc42bc448da571fa4ec4
|
4
|
+
data.tar.gz: 8d08b1216c0008bee819180712786dd7a55bf979
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa873b9f7f2110349d7297c92d1ede043b6927472ce0774a19156727629e6656eb80a196d1e7b502300ea6061541b2ee7d4c9bd4864a146f797b31a55f4baef4
|
7
|
+
data.tar.gz: 1815114f0dfc281b5979596d09ad092b4488c31b4675fbf642a5dbd8ea8e20b6d5a7d9050afba8d92af6f4b5443eff5f2302a2f49b61ee1bb616f4a15055292c
|
data/bin/garufa.pid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
17790
|
data/lib/garufa/api.rb
CHANGED
@@ -1,44 +1,25 @@
|
|
1
1
|
require 'cuba'
|
2
|
-
|
3
2
|
require 'garufa/api/authentication'
|
4
|
-
require 'garufa/api/
|
3
|
+
require 'garufa/api/events'
|
4
|
+
require 'garufa/api/channels'
|
5
5
|
|
6
6
|
module Garufa
|
7
7
|
module API
|
8
|
-
class Server < Cuba
|
9
|
-
|
10
|
-
plugin Authentication
|
11
|
-
plugin EventHandler
|
12
|
-
|
13
|
-
define do
|
14
|
-
on "apps/:app_id" do |app_id|
|
8
|
+
class Server < Cuba; end
|
15
9
|
|
16
|
-
|
10
|
+
Server.plugin Authentication
|
17
11
|
|
18
|
-
|
19
|
-
|
20
|
-
handle_events(req.body.read)
|
21
|
-
res.status = 202
|
22
|
-
res.write "{}"
|
23
|
-
end
|
12
|
+
Server.define do
|
13
|
+
on "apps/:app_id" do |app_id|
|
24
14
|
|
25
|
-
|
26
|
-
on post, "channels/:channel_id/events" do |channel_id|
|
27
|
-
handle_events(req.body.read, req.GET.merge(channels: [channel_id]))
|
28
|
-
res.status = 202
|
29
|
-
res.write "{}"
|
30
|
-
end
|
15
|
+
authenticate
|
31
16
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
on get, "channels/:channel" do
|
37
|
-
end
|
17
|
+
on post do
|
18
|
+
run Events
|
19
|
+
end
|
38
20
|
|
39
|
-
|
40
|
-
|
41
|
-
end
|
21
|
+
on get do
|
22
|
+
run Channels
|
42
23
|
end
|
43
24
|
end
|
44
25
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Garufa
|
2
|
+
module API
|
3
|
+
class Channels < Cuba; end
|
4
|
+
|
5
|
+
# TODO: Implement channels requests
|
6
|
+
Channels.define do
|
7
|
+
|
8
|
+
# Channels
|
9
|
+
on get, "channels" do
|
10
|
+
end
|
11
|
+
|
12
|
+
on get, "channels/:channel" do
|
13
|
+
end
|
14
|
+
|
15
|
+
# Users
|
16
|
+
on get, "channels/:channel/users" do
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'garufa/api/event_handler'
|
2
|
+
|
3
|
+
module Garufa
|
4
|
+
module API
|
5
|
+
class Events < Cuba; end
|
6
|
+
|
7
|
+
Events.plugin EventHandler
|
8
|
+
|
9
|
+
Events.define do
|
10
|
+
|
11
|
+
res.status = 202
|
12
|
+
body = req.body.read
|
13
|
+
|
14
|
+
# Events
|
15
|
+
on "events" do
|
16
|
+
handle_events(body)
|
17
|
+
res.write "{}"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Legacy events
|
21
|
+
on "channels/:channel_id/events" do |channel_id|
|
22
|
+
params = req.GET.merge(channels: [channel_id])
|
23
|
+
handle_events(body, params)
|
24
|
+
res.write "{}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/garufa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: garufa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1.rc.
|
4
|
+
version: 1.0.1.rc.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Manuel Cuello
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: goliath
|
@@ -106,11 +106,14 @@ files:
|
|
106
106
|
- README.md
|
107
107
|
- Rakefile
|
108
108
|
- bin/garufa
|
109
|
+
- bin/garufa.pid
|
109
110
|
- garufa.gemspec
|
110
111
|
- lib/garufa.rb
|
111
112
|
- lib/garufa/api.rb
|
112
113
|
- lib/garufa/api/authentication.rb
|
114
|
+
- lib/garufa/api/channels.rb
|
113
115
|
- lib/garufa/api/event_handler.rb
|
116
|
+
- lib/garufa/api/events.rb
|
114
117
|
- lib/garufa/config.rb
|
115
118
|
- lib/garufa/connection.rb
|
116
119
|
- lib/garufa/garufa_app.rb
|