gameon 0.0.0.pre119 → 0.0.0.pre120

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gameon/base.rb +32 -29
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30c26138d7a0725066d3bac274e5e786c41f78c9
4
- data.tar.gz: 7fbe75d4ea5f81c1e5fe6f995ecd11e122dfad8c
3
+ metadata.gz: 740a23b51138c8c011218239cdd37233393a8ded
4
+ data.tar.gz: a02569c0c9964ce0aa1bbb9bb770745ea4d70cc0
5
5
  SHA512:
6
- metadata.gz: 885e3283f8c71042533b9ad7fb1c42a6fc99923fe9fb6ad37211d01e7bafad5a1c4c2e3171a1c0dce66191d07dfd4eaf66d769837cf92202d589ae136d8cf598
7
- data.tar.gz: ca874e4faa4e304512d5af2f387cf8625eb4d8aca37f762c933a2688f59db7873136f9f0d51362b9f95a39a3ad105e3d9b2af842e72e14a89cb88cb376c4f133
6
+ metadata.gz: bb7b602580161e431660e438fc964be954a9b89d9d36a89b5f7d36a0b8dac30647664adaeaba27d31143f0eb0eae09919713be1d619054ad50d432ee4423da41
7
+ data.tar.gz: 5a74a3c281cef10aaee306ebb07da72408b2faf10a746c53e63a20878d1ffb912d24944d32c445f63c4117186fa985f9fe16e2e62d96792340946b825a0f63f8
data/lib/gameon/base.rb CHANGED
@@ -18,16 +18,14 @@ module GameOn
18
18
 
19
19
  if @middlewares.empty?
20
20
  p "adding first middleware !!!"
21
- p "$$$$$$$$$$$$$$$$$$$$$$$$$$$"
22
21
  @middlewares << middleware
23
22
  p @middlewares
24
23
  else
25
24
  @middlewares.each do |prev|
26
25
  if prev.name == middleware.name && prev.opts == middleware.opts && prev.params == middleware.params
27
- p "this activation already exists, thus nothing to do!!!"
26
+ p "this activation already exists, nothing to do!!!"
28
27
  else
29
28
  p "adding new activation"
30
- p "$$$$$$$$$$$$$$$$$$$$$$$$$$$"
31
29
  @middlewares << middleware
32
30
  p @middlewares
33
31
  end
@@ -42,8 +40,6 @@ module GameOn
42
40
 
43
41
  end
44
42
  Dir["./gameon/*"].each {|file| load file }
45
- #return Mushin::DSL.middlewares
46
- #Mushin::DSL.middlewares = []
47
43
  end
48
44
  end
49
45
 
@@ -67,35 +63,42 @@ module GameOn
67
63
  end
68
64
  end
69
65
 
70
- class Env
66
+ class Env
71
67
  extend Mushin::Env
68
+ attr_accessor :id
69
+ def set id, &block
70
+ @id = id.to_s + 'gameon'
71
+ def context current_context_title, &block
72
+ @current_context_title = current_context_title
73
+ @activities = []
74
+ def activity current_activity_title
75
+ @activities << current_activity_title
76
+ end
77
+ instance_eval(&block)
78
+ end
79
+ instance_eval(&block)
72
80
 
73
- class << self
74
- attr_accessor :id
75
-
76
- def get id
77
- GameOn::Persistence::DS.load id.to_s + 'gameon' #TODO some app key based encryption method
81
+ GameOn::Engine.setup [Object.const_get('GameOn::Persistence::DS')]
82
+ @activities.uniq.each do |current_activity_title|
83
+ GameOn::Engine.run @current_context_title, current_activity_title
78
84
  end
85
+ #@activities = [] # reset the activities
86
+ return GameOn::Persistence::DS.load @id
87
+ end
79
88
 
80
- def set id, &block
81
- @id = id.to_s + 'gameon'
82
- def context current_context_title, &block
83
- @current_context_title = current_context_title
84
- @activities = []
85
- def activity current_activity_title
86
- @activities << current_activity_title
87
- end
88
- instance_eval(&block)
89
- end
90
- instance_eval(&block)
89
+ def get id
90
+ GameOn::Persistence::DS.load id.to_s + 'gameon' #TODO some app key based encryption method
91
+ end
91
92
 
92
- #Dir["./gameon/*"].each {|file| load file }
93
- GameOn::Engine.setup [Object.const_get('GameOn::Persistence::DS')]
94
- @activities.uniq.each do |current_activity_title|
95
- GameOn::Engine.run @current_context_title, current_activity_title
96
- end
97
- @activities = [] # reset the activities
98
- return GameOn::Persistence::DS.load @id
93
+ class << self
94
+ def set id, &block
95
+ e = Env.new
96
+ e.set id, &block
97
+ end
98
+
99
+ def get id
100
+ e = Env.new
101
+ e.get id
99
102
  end
100
103
  end
101
104
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gameon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.pre119
4
+ version: 0.0.0.pre120
5
5
  platform: ruby
6
6
  authors:
7
7
  - theotherstupidguy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-13 00:00:00.000000000 Z
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: a gamification framework based on mushin
14
14
  email: