gameon 0.0.0.pre92 → 0.0.0.pre93
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 +42 -41
- 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: e4f5fc15008c80652f4713632adaa23e501de174
|
4
|
+
data.tar.gz: 2b58f21e25c6984fb17bc1fd0549bab65bb1b484
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b06b85f0774b935df1134579928e7bc4bbf73d8137f4095abcf8eaa1528e940504212f04771efe6daa02e7f6759f34a892c9cdb1d87107afce396b1226d1519
|
7
|
+
data.tar.gz: dfc0b228fe393b77a28e56caf883488234945e24a631e35146a31eba64ad46d57d11fde7a59068865553c7e8f56ca302b847545d09b788380eab04361c49fa30
|
data/lib/gameon/base.rb
CHANGED
@@ -25,62 +25,63 @@ module GameOn
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
-
p "$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
29
|
-
p Mushin::DSL.middlewares
|
30
|
-
Mushin::DSL.middlewares
|
31
28
|
end
|
29
|
+
p "$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
30
|
+
p Mushin::DSL.middlewares
|
31
|
+
Mushin::DSL.middlewares
|
32
32
|
end
|
33
|
+
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
@setup_middlewares.each do |setup_middleware|
|
47
|
-
stack.insert_before 0, setup_middleware
|
35
|
+
module Engine
|
36
|
+
extend Mushin::Engine
|
37
|
+
class << self
|
38
|
+
#attr_accessor :middlewares, :stack
|
39
|
+
def run domain_context, activity
|
40
|
+
#@middlewares = GameOn::DSL.find domain_context, activity
|
41
|
+
stack = Mushin::Middleware::Builder.new do
|
42
|
+
(GameOn::DSL.find domain_context, activity).uniq.each do |middleware|
|
43
|
+
p "GameOn Logging: use #{middleware.name}, #{middleware.opts}, #{middleware.params}"
|
44
|
+
use middleware.name, middleware.opts, middleware.params
|
48
45
|
end
|
49
|
-
stack.call
|
50
46
|
end
|
47
|
+
@setup_middlewares.each do |setup_middleware|
|
48
|
+
stack.insert_before 0, setup_middleware
|
49
|
+
end
|
50
|
+
stack.call
|
51
51
|
end
|
52
52
|
end
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
55
|
+
class Env
|
56
|
+
extend Mushin::Env
|
56
57
|
|
57
|
-
|
58
|
-
|
58
|
+
class << self
|
59
|
+
attr_accessor :id
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
def get id
|
62
|
+
GameOn::Persistence::DS.load id.to_s + 'gameon' #TODO some app key based encryption method
|
63
|
+
end
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end
|
72
|
-
instance_eval(&block)
|
65
|
+
def set id, &block
|
66
|
+
@id = id.to_s + 'gameon'
|
67
|
+
def on domain_context, &block
|
68
|
+
@domain_context = domain_context
|
69
|
+
@activities = []
|
70
|
+
def activity statment
|
71
|
+
@activities << statment
|
73
72
|
end
|
74
73
|
instance_eval(&block)
|
74
|
+
end
|
75
|
+
instance_eval(&block)
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
81
|
-
#@activities = [] # reset the activities
|
82
|
-
return GameOn::Persistence::DS.load @id
|
77
|
+
Dir["./gameon/*"].each {|file| load file }
|
78
|
+
GameOn::Engine.setup [Object.const_get('GameOn::Persistence::DS')]
|
79
|
+
@activities.uniq.each do |activity|
|
80
|
+
GameOn::Engine.run @domain_context, activity
|
83
81
|
end
|
82
|
+
#@activities = [] # reset the activities
|
83
|
+
return GameOn::Persistence::DS.load @id
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
87
|
+
end
|