gameon 0.0.0.pre121 → 0.0.0.pre122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gameon/base.rb +46 -0
- 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: 66cb8dce56b0e3a2bb4e7ca438b6e0b5509a6550
|
4
|
+
data.tar.gz: 14938201686c55821f1404aab2efaa32f1815157
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e13e2b37ed8bb1a18164dff06f5320a0c51e9c8479381b30fd6e72b5b4b3a3e10c14d0f739aaddb9da312892be19bfba878c641e87fa86fa7b8735fb0607e5e
|
7
|
+
data.tar.gz: f7adc643466a216a2b76b46939732004c621515505d0095d7077a3dce22212fb526aa6f52774e266dda7c37d1eba59f958aee62523c0814eef31f6c2926beeec
|
data/lib/gameon/base.rb
CHANGED
@@ -62,6 +62,7 @@ module GameOn
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
65
|
+
=begin
|
65
66
|
class Env
|
66
67
|
extend Mushin::Env
|
67
68
|
|
@@ -93,4 +94,49 @@ module GameOn
|
|
93
94
|
end
|
94
95
|
end
|
95
96
|
end
|
97
|
+
=end
|
98
|
+
|
99
|
+
class Env
|
100
|
+
extend Mushin::Env
|
101
|
+
|
102
|
+
attr_accessor :id
|
103
|
+
def set id, &block
|
104
|
+
@id = id.to_s + 'gameon'
|
105
|
+
def context current_context_title, &block
|
106
|
+
@current_context_title = current_context_title
|
107
|
+
@activities = []
|
108
|
+
def activity current_activity_title
|
109
|
+
@activities << current_activity_title
|
110
|
+
end
|
111
|
+
instance_eval(&block)
|
112
|
+
end
|
113
|
+
instance_eval(&block)
|
114
|
+
|
115
|
+
#GameOn::Env.id = @id
|
116
|
+
GameOn::Engine.setup [[Object.const_get('GameOn::Persistence::DS'), @id]]
|
117
|
+
@activities.uniq.each do |current_activity_title|
|
118
|
+
GameOn::Engine.run @current_context_title, current_activity_title
|
119
|
+
end
|
120
|
+
#@activities = [] # reset the activities
|
121
|
+
return GameOn::Persistence::DS.load @id
|
122
|
+
end
|
123
|
+
|
124
|
+
def get id
|
125
|
+
GameOn::Persistence::DS.load id.to_s + 'gameon' #TODO some app key based encryption method
|
126
|
+
end
|
127
|
+
|
128
|
+
class << self
|
129
|
+
def set id, &block
|
130
|
+
e = Env.new
|
131
|
+
e.set id, &block
|
132
|
+
end
|
133
|
+
|
134
|
+
def get id
|
135
|
+
e = Env.new
|
136
|
+
e.get id
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
#=end
|
141
|
+
|
96
142
|
end
|