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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gameon/base.rb +49 -43
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b4e26dc922eb4f288628a879521738a4c8df3d9
4
- data.tar.gz: 8421db6e55319ef12c18b9ab69bcf5c1a5a45cbe
3
+ metadata.gz: ea96c7f8d12a9e7527fe4b1bb2b35218c76cb965
4
+ data.tar.gz: fd0f14bd3bf83f98fb13cf51762bd12f198ebe39
5
5
  SHA512:
6
- metadata.gz: 4eacb29fb03859aabc1cb83fd0e7b71d594f7f4c15328b8432737f578a50650c0dd5eebdd2917710d95c085c7b475696c3874d424f5b05dd3303571d7c3894f3
7
- data.tar.gz: 5258fecdeae624afdfa082b3426eae1ead16ba52a2b6a4253f3759ff2b03f6c19f3b01351b7a82ac0660ad73b406b093cdaf6e7fddf1b292c4cf8b23596c44af
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
- Mushin::DSL.middlewares << middleware
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
- module Engine
29
- extend Mushin::Engine
30
- class << self
31
- #attr_accessor :middlewares, :stack
32
- def run domain_context, activity
33
- #@middlewares = GameOn::DSL.find domain_context, activity
34
- stack = Mushin::Middleware::Builder.new do
35
- (GameOn::DSL.find domain_context, activity).uniq.each do |middleware|
36
- p "GameOn Logging: use #{middleware.name}, #{middleware.opts}, #{middleware.params}"
37
- use middleware.name, middleware.opts, middleware.params
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
- class Env
49
- extend Mushin::Env
54
+ class Env
55
+ extend Mushin::Env
50
56
 
51
- class << self
52
- attr_accessor :id
57
+ class << self
58
+ attr_accessor :id
53
59
 
54
- def get id
55
- GameOn::Persistence::DS.load id.to_s + 'gameon' #TODO some app key based encryption method
56
- end
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
- def set id, &block
59
- @id = id.to_s + 'gameon'
60
- def on domain_context, &block
61
- @domain_context = domain_context
62
- @activities = []
63
- def activity statment
64
- @activities << statment
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
- Dir["./gameon/*"].each {|file| load file }
71
- GameOn::Engine.setup [Object.const_get('GameOn::Persistence::DS')]
72
- @activities.uniq.each do |activity|
73
- GameOn::Engine.run @domain_context, activity
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gameon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.pre91
4
+ version: 0.0.0.pre92
5
5
  platform: ruby
6
6
  authors:
7
7
  - theotherstupidguy