myrrha 3.0.0.rc1 → 3.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/examples/sbyc_domain.rb +1 -1
- data/lib/myrrha/ext/domain.rb +6 -0
- data/lib/myrrha/version.rb +1 -1
- data/myrrha.gemspec +1 -1
- data/myrrha.noespec +7 -7
- data/spec/ext/domain/test_coerce.rb +22 -2
- metadata +6 -6
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@ GEM
|
|
3
3
|
specs:
|
4
4
|
bluecloth (2.2.0)
|
5
5
|
diff-lcs (1.1.3)
|
6
|
-
domain (1.0.0.
|
6
|
+
domain (1.0.0.rc2)
|
7
7
|
rake (0.9.2.2)
|
8
8
|
rspec (2.8.0)
|
9
9
|
rspec-core (~> 2.8.0)
|
@@ -22,7 +22,7 @@ PLATFORMS
|
|
22
22
|
|
23
23
|
DEPENDENCIES
|
24
24
|
bluecloth (~> 2.2.0)
|
25
|
-
domain (
|
25
|
+
domain (~> 1.0.0.rc2)
|
26
26
|
rake (~> 0.9.2)
|
27
27
|
rspec (~> 2.8.0)
|
28
28
|
wlang (~> 0.10.2)
|
data/examples/sbyc_domain.rb
CHANGED
data/lib/myrrha/ext/domain.rb
CHANGED
data/lib/myrrha/version.rb
CHANGED
data/myrrha.gemspec
CHANGED
@@ -128,7 +128,7 @@ Gem::Specification.new do |s|
|
|
128
128
|
s.add_development_dependency("yard", "~> 0.7.4")
|
129
129
|
s.add_development_dependency("bluecloth", "~> 2.2.0")
|
130
130
|
s.add_development_dependency("wlang", "~> 0.10.2")
|
131
|
-
s.add_dependency("domain", "
|
131
|
+
s.add_dependency("domain", "~> 1.0.0.rc2")
|
132
132
|
|
133
133
|
# The version of ruby required by this gem
|
134
134
|
#
|
data/myrrha.noespec
CHANGED
@@ -10,7 +10,7 @@ variables:
|
|
10
10
|
upper:
|
11
11
|
Myrrha
|
12
12
|
version:
|
13
|
-
3.0.0.
|
13
|
+
3.0.0.rc2
|
14
14
|
summary: |-
|
15
15
|
Myrrha provides the coercion framework which is missing to Ruby.
|
16
16
|
description: |-
|
@@ -26,12 +26,12 @@ variables:
|
|
26
26
|
- http://github.com/blambeau/myrrha
|
27
27
|
- http://rubygems.org/gems/myrrha
|
28
28
|
dependencies:
|
29
|
-
- {name: domain, version: "
|
30
|
-
- {name: rake, version: "~> 0.9.2",
|
31
|
-
- {name: rspec, version: "~> 2.8.0",
|
32
|
-
- {name: yard, version: "~> 0.7.4",
|
33
|
-
- {name: bluecloth, version: "~> 2.2.0",
|
34
|
-
- {name: wlang, version: "~> 0.10.2",
|
29
|
+
- {name: domain, version: "~> 1.0.0.rc2", groups: [runtime] }
|
30
|
+
- {name: rake, version: "~> 0.9.2", groups: [test, release]}
|
31
|
+
- {name: rspec, version: "~> 2.8.0", groups: [test, release]}
|
32
|
+
- {name: yard, version: "~> 0.7.4", groups: [doc ]}
|
33
|
+
- {name: bluecloth, version: "~> 2.2.0", groups: [doc ]}
|
34
|
+
- {name: wlang, version: "~> 0.10.2", groups: [release ]}
|
35
35
|
rake_tasks:
|
36
36
|
debug_mail:
|
37
37
|
rx_changelog_sections: /^# /
|
@@ -3,14 +3,34 @@ describe Domain, "coerce" do
|
|
3
3
|
|
4
4
|
let(:domain){ Domain.scalar(:x, :y) }
|
5
5
|
|
6
|
+
let(:expected){ domain.new(1, 2) }
|
7
|
+
|
6
8
|
before do
|
7
9
|
domain.coercions do |c|
|
8
|
-
c.coercion(String){|v,_|
|
10
|
+
c.coercion(String){|v,_| expected }
|
11
|
+
c.coercion(Array) {|v,_| domain.new(*v) }
|
9
12
|
end
|
10
13
|
end
|
11
14
|
|
12
15
|
it 'should delegate to coercions' do
|
13
|
-
domain.coerce("blah").should
|
16
|
+
domain.coerce("blah").should be(expected)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'raises a TypeError if something goes wrong' do
|
20
|
+
lambda{
|
21
|
+
domain.coerce(12)
|
22
|
+
}.should raise_error(TypeError, /Can't convert `12`/)
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "the [] alias" do
|
26
|
+
|
27
|
+
it 'delegates to coerce when one argument' do
|
28
|
+
domain["12"].should be(expected)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'supports Array literals' do
|
32
|
+
domain[1, 3].should eq(domain.new(1, 3))
|
33
|
+
end
|
14
34
|
end
|
15
35
|
|
16
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myrrha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.rc2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -96,17 +96,17 @@ dependencies:
|
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
99
|
-
- -
|
99
|
+
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 1.0.0.
|
101
|
+
version: 1.0.0.rc2
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.0.0.
|
109
|
+
version: 1.0.0.rc2
|
110
110
|
description: ! "Myrrha provides the coercion framework which is missing to Ruby. Coercions\nare
|
111
111
|
simply defined as a set of rules for converting values from source to target\ndomains
|
112
112
|
(in an abstract sense). As a typical and useful example, it comes with \na coerce()
|