mushin 0.0.0.pre77 → 0.0.0.pre78

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mushin/base.rb +11 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c5067a9017fe3caca4aa75fcacfec24c170f9ee
4
- data.tar.gz: d646bd926a86bf82f62b0f68e4c1eef4c784e387
3
+ metadata.gz: 8b138fec49f15d54eab8d1d6858c2bd48142cf3f
4
+ data.tar.gz: 530356951bc9ee06117f730bc6270aadc5e1ae03
5
5
  SHA512:
6
- metadata.gz: 455693b793a898b78ea6e7b052e5e38bd6b86782d974f82a0587a92f7a9b4f863674afada4564cbe7bb688495e446b5d0940b703fed23d805fbd8675dc1a5df1
7
- data.tar.gz: 093ef13c855a3e6662b76220e62b977ad0e6e93b18270c0996b98aec2dc866fb22c7ea9d44b169bae4c8aef501d9b531eda9ac173cdbb8d79ace89dfe54c72ad
6
+ metadata.gz: 361fa6efe36264c18350b5e31fca37eb3266b8877f2ab6a86ad3038f848607ad29cdc3967827f7886c8479ae0565be3ce2f2d4929f0ff1115886a98ea1f20231
7
+ data.tar.gz: 51d2e08e75987360a6d33d026dd4045b8eff244f39c2197263054bc13d3ef5f7fb1f0f758bfe30a113ed6759b6f4847bd9623e0d8599dcbbf9275b126e7e14f7
data/lib/mushin/base.rb CHANGED
@@ -82,20 +82,24 @@ module Mushin # Domain Frameworks Generator
82
82
  def statment statment=[], &block
83
83
  @statment = Mushin::DSL::Statment.new statment
84
84
  def activation name, opts={}, params={}
85
- @activation = Mushin::DSL::Activation.new name, opts, params
86
- @statment.activations << @activation
87
- @statment.activations.uniq! #TODO fix the multi middleware calls bug
88
- @statment.activations #TODO fix the multi middleware calls bug
85
+ @statment.activations.each do |prev|
86
+ @exists = if prev.name, prev.opts, prev.params == name, opts, params
87
+ return true
88
+ else
89
+ return false
90
+ end
91
+ end
92
+ if @exists == false
93
+ @activation = Mushin::DSL::Activation.new name, opts, params
94
+ @statment.activations << @activation
95
+ end
89
96
  end
90
97
  yield
91
98
  @context.statments << @statment
92
99
  @context.statments.uniq!
93
- @context.statments
94
100
  end
95
101
  yield
96
102
  Mushin::DSL.contexts << @context
97
- Mushin::DSL.contexts.uniq!
98
- Mushin::DSL.contexts
99
103
  end
100
104
  end
101
105
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mushin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.pre77
4
+ version: 0.0.0.pre78
5
5
  platform: ruby
6
6
  authors:
7
7
  - theotherstupidguy