moosex 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +13 -8
- data/Gemfile.lock +1 -1
- data/README.md +180 -17
- data/lib/moosex.rb +4 -1
- data/lib/moosex/attribute.rb +94 -72
- data/lib/moosex/attribute/modifiers.rb +31 -32
- data/lib/moosex/event.rb +1 -1
- data/lib/moosex/meta.rb +12 -3
- data/lib/moosex/traits.rb +115 -0
- data/lib/moosex/types.rb +3 -3
- data/lib/moosex/version.rb +1 -1
- data/samples/events.rb +1 -1
- data/samples/point.rb +1 -1
- data/spec/baz_spec.rb +1 -1
- data/spec/coerce_spec.rb +3 -36
- data/spec/lazy_spec.rb +2 -2
- data/spec/meta_spec.rb +14 -0
- data/spec/modifiers_spec.rb +6 -6
- data/spec/parametric_role_spec.rb +2 -2
- data/spec/plugin_spec.rb +74 -0
- data/spec/point_spec.rb +1 -1
- data/spec/proxy_spec.rb +9 -9
- data/spec/traits_spec.rb +324 -0
- data/spec/trigger_spec.rb +3 -3
- data/spec/types_spec.rb +1 -1
- data/spec/weak_spec.rb +1 -1
- metadata +7 -2
data/spec/trigger_spec.rb
CHANGED
@@ -19,8 +19,8 @@ class TriggerTest
|
|
19
19
|
|
20
20
|
has attr_with_default: {
|
21
21
|
is: :rw,
|
22
|
-
trigger:
|
23
|
-
|
22
|
+
trigger: ->(this, new_value) do
|
23
|
+
this.logger.log "will update attr_with_trigger with new value #{new_value}"
|
24
24
|
end,
|
25
25
|
default: 1,
|
26
26
|
}
|
@@ -28,7 +28,7 @@ class TriggerTest
|
|
28
28
|
has attr_lazy_trigger: {
|
29
29
|
is: :lazy,
|
30
30
|
trigger: :my_method,
|
31
|
-
builder:
|
31
|
+
builder: ->(this) { 1 },
|
32
32
|
}
|
33
33
|
|
34
34
|
def my_method(new_value)
|
data/spec/types_spec.rb
CHANGED
@@ -191,7 +191,7 @@ describe "MooseX::Types" do
|
|
191
191
|
"AnyOf Check violation: caused by [Type violation: value '[]' (Array) is not an instance of [Type Fixnum], Type violation: value '[]' (Array) is not an instance of [Type String], Type violation: value '[]' (Array) is not an instance of [Type Symbol]]")
|
192
192
|
|
193
193
|
expect {
|
194
|
-
Test.isAnyOf(
|
194
|
+
Test.isAnyOf(->(x) {raise "OPS"}).call(1)
|
195
195
|
}.to raise_error(MooseX::Types::TypeCheckError,
|
196
196
|
'unexpected exception OPS')
|
197
197
|
end
|
data/spec/weak_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moosex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Peczenyj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- lib/moosex/event.rb
|
108
108
|
- lib/moosex/exceptions.rb
|
109
109
|
- lib/moosex/meta.rb
|
110
|
+
- lib/moosex/traits.rb
|
110
111
|
- lib/moosex/types.rb
|
111
112
|
- lib/moosex/version.rb
|
112
113
|
- moosex.gemspec
|
@@ -131,10 +132,12 @@ files:
|
|
131
132
|
- spec/modifiers_spec.rb
|
132
133
|
- spec/moosex_spec.rb
|
133
134
|
- spec/parametric_role_spec.rb
|
135
|
+
- spec/plugin_spec.rb
|
134
136
|
- spec/point_spec.rb
|
135
137
|
- spec/proxy_spec.rb
|
136
138
|
- spec/role_spec.rb
|
137
139
|
- spec/spec_helper.rb
|
140
|
+
- spec/traits_spec.rb
|
138
141
|
- spec/trigger_spec.rb
|
139
142
|
- spec/types_spec.rb
|
140
143
|
- spec/weak_spec.rb
|
@@ -178,10 +181,12 @@ test_files:
|
|
178
181
|
- spec/modifiers_spec.rb
|
179
182
|
- spec/moosex_spec.rb
|
180
183
|
- spec/parametric_role_spec.rb
|
184
|
+
- spec/plugin_spec.rb
|
181
185
|
- spec/point_spec.rb
|
182
186
|
- spec/proxy_spec.rb
|
183
187
|
- spec/role_spec.rb
|
184
188
|
- spec/spec_helper.rb
|
189
|
+
- spec/traits_spec.rb
|
185
190
|
- spec/trigger_spec.rb
|
186
191
|
- spec/types_spec.rb
|
187
192
|
- spec/weak_spec.rb
|