gameon 0.0.0.pre91 → 0.0.0.pre92
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gameon/base.rb +49 -43
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea96c7f8d12a9e7527fe4b1bb2b35218c76cb965
|
4
|
+
data.tar.gz: fd0f14bd3bf83f98fb13cf51762bd12f198ebe39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 244025142cbc8cdd8c35fef26b0adc8328a6dd6bc9cfc27c24f4c680ca309bc3330c2aec85ea3e07026cc5aabb57d137dc5e4c93ba9e9e01d24e9bf5323c4cc7
|
7
|
+
data.tar.gz: 9262f67e68e592d5949a3a89f7330ae38eb815755da3dfe6d7133d904aeea6a6e6908a9334e6a64c089788872e60b0d1f5dfd5249dc2e270d539b2da0c5b7364
|
data/lib/gameon/base.rb
CHANGED
@@ -13,68 +13,74 @@ module GameOn
|
|
13
13
|
current_context.statments.each do |statment|
|
14
14
|
if activity_statment == statment.title
|
15
15
|
statment.activations.uniq.each do |middleware|
|
16
|
-
|
16
|
+
|
17
|
+
#middleware.name, middleware.opts, middleware.params
|
18
|
+
Mushin::DSL.middlewares.each do |prev|
|
19
|
+
if prev[0] == name && prev[1] == opts && prev[2] == params
|
20
|
+
p "adding new activation"
|
21
|
+
Mushin::DSL.middlewares << middleware
|
22
|
+
end
|
23
|
+
end
|
17
24
|
end
|
18
25
|
end
|
19
26
|
end
|
20
27
|
end
|
28
|
+
p "$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
29
|
+
p Mushin::DSL.middlewares
|
30
|
+
Mushin::DSL.middlewares
|
21
31
|
end
|
22
|
-
p "$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
23
|
-
p Mushin::DSL.middlewares
|
24
|
-
Mushin::DSL.middlewares
|
25
32
|
end
|
26
|
-
end
|
27
33
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
module Engine
|
35
|
+
extend Mushin::Engine
|
36
|
+
class << self
|
37
|
+
#attr_accessor :middlewares, :stack
|
38
|
+
def run domain_context, activity
|
39
|
+
#@middlewares = GameOn::DSL.find domain_context, activity
|
40
|
+
stack = Mushin::Middleware::Builder.new do
|
41
|
+
(GameOn::DSL.find domain_context, activity).uniq.each do |middleware|
|
42
|
+
p "GameOn Logging: use #{middleware.name}, #{middleware.opts}, #{middleware.params}"
|
43
|
+
use middleware.name, middleware.opts, middleware.params
|
44
|
+
end
|
38
45
|
end
|
46
|
+
@setup_middlewares.each do |setup_middleware|
|
47
|
+
stack.insert_before 0, setup_middleware
|
48
|
+
end
|
49
|
+
stack.call
|
39
50
|
end
|
40
|
-
@setup_middlewares.each do |setup_middleware|
|
41
|
-
stack.insert_before 0, setup_middleware
|
42
|
-
end
|
43
|
-
stack.call
|
44
51
|
end
|
45
52
|
end
|
46
|
-
end
|
47
53
|
|
48
|
-
|
49
|
-
|
54
|
+
class Env
|
55
|
+
extend Mushin::Env
|
50
56
|
|
51
|
-
|
52
|
-
|
57
|
+
class << self
|
58
|
+
attr_accessor :id
|
53
59
|
|
54
|
-
|
55
|
-
|
56
|
-
|
60
|
+
def get id
|
61
|
+
GameOn::Persistence::DS.load id.to_s + 'gameon' #TODO some app key based encryption method
|
62
|
+
end
|
57
63
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
64
|
+
def set id, &block
|
65
|
+
@id = id.to_s + 'gameon'
|
66
|
+
def on domain_context, &block
|
67
|
+
@domain_context = domain_context
|
68
|
+
@activities = []
|
69
|
+
def activity statment
|
70
|
+
@activities << statment
|
71
|
+
end
|
72
|
+
instance_eval(&block)
|
65
73
|
end
|
66
74
|
instance_eval(&block)
|
67
|
-
end
|
68
|
-
instance_eval(&block)
|
69
75
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
76
|
+
Dir["./gameon/*"].each {|file| load file }
|
77
|
+
GameOn::Engine.setup [Object.const_get('GameOn::Persistence::DS')]
|
78
|
+
@activities.uniq.each do |activity|
|
79
|
+
GameOn::Engine.run @domain_context, activity
|
80
|
+
end
|
81
|
+
#@activities = [] # reset the activities
|
82
|
+
return GameOn::Persistence::DS.load @id
|
74
83
|
end
|
75
|
-
#@activities = [] # reset the activities
|
76
|
-
return GameOn::Persistence::DS.load @id
|
77
84
|
end
|
78
85
|
end
|
79
86
|
end
|
80
|
-
end
|