mushin 0.0.0.pre84 → 0.0.0.pre85
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/mushin/base.rb +14 -14
- 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: fe6306aa9ad29f40e04d0ad033659574ab87be17
|
4
|
+
data.tar.gz: be8a597ba33413b7e8d8c9eebf5692e163706bf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1ee4356b6fc5548b49d14783950acefa7dbab276abb0e5c65c6c85499855aa195cd74969bff525acfd16f2145f9e94b42d9eb29a986d542910a2be248c59ac5
|
7
|
+
data.tar.gz: 7b04b1d22f8f5b7a4db914c21d1ce9dbb03da9fc003e325a464be81ec69d4f8b64c0874d68aa0dfc6da940d23dd7d3ab996e171dd6653d766ec75d2c52367143
|
data/lib/mushin/base.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Mushin # Domain Frameworks Generator
|
2
2
|
module Errors
|
3
|
-
exceptions = %w[ UnkownDSLConstruct
|
3
|
+
exceptions = %w[ UnkownDSLConstruct UnkownUse UnknownOption ]
|
4
4
|
exceptions.each { |e| const_set(e, Class.new(StandardError)) }
|
5
5
|
end
|
6
6
|
|
@@ -48,20 +48,20 @@ module Mushin # Domain Frameworks Generator
|
|
48
48
|
|
49
49
|
module DSL
|
50
50
|
class Context
|
51
|
-
attr_accessor :title, :
|
51
|
+
attr_accessor :title, :activities
|
52
52
|
def initialize title
|
53
53
|
@title = title
|
54
|
-
@
|
54
|
+
@activities = []
|
55
55
|
end
|
56
56
|
end
|
57
|
-
class
|
58
|
-
attr_accessor :title, :
|
57
|
+
class Activity
|
58
|
+
attr_accessor :title, :uses
|
59
59
|
def initialize title
|
60
60
|
@title = title
|
61
|
-
@
|
61
|
+
@uses = []
|
62
62
|
end
|
63
63
|
end
|
64
|
-
class
|
64
|
+
class Use
|
65
65
|
attr_accessor :name, :opts, :params
|
66
66
|
def initialize name, opts={}, params={}
|
67
67
|
@name = name
|
@@ -76,16 +76,16 @@ module Mushin # Domain Frameworks Generator
|
|
76
76
|
Mushin::DSL.contexts = []
|
77
77
|
def context title, &block
|
78
78
|
@context = Mushin::DSL::Context.new title
|
79
|
-
def
|
80
|
-
@
|
81
|
-
def
|
82
|
-
if !@
|
83
|
-
@
|
84
|
-
@
|
79
|
+
def activity activity=[], &block
|
80
|
+
@activity = Mushin::DSL::Activity.new activity
|
81
|
+
def use name, opts={}, params={}
|
82
|
+
if !@activity.uses.bsearch {|x| x == [name,opts,params]}
|
83
|
+
@use = Mushin::DSL::Use.new name, opts, params
|
84
|
+
@activity.uses << @use
|
85
85
|
end
|
86
86
|
end
|
87
87
|
yield
|
88
|
-
@context.
|
88
|
+
@context.activities << @activity
|
89
89
|
end
|
90
90
|
yield
|
91
91
|
Mushin::DSL.contexts << @context
|