monadic 0.7.2 → 0.7.3
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.
- data/CHANGELOG.md +4 -1
- data/lib/monadic/maybe.rb +4 -0
- data/lib/monadic/version.rb +1 -1
- data/spec/examples/builder_spec.rb +3 -3
- data/spec/maybe_spec.rb +4 -0
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.7.3
|
4
|
+
Nothing works with `===`
|
5
|
+
|
3
6
|
## v0.7.2
|
4
7
|
Add `#__fetch__` to `Maybe().proxy` to get the wrapped value.
|
5
8
|
|
@@ -82,7 +85,7 @@ Instead the new `Monad#flat_map` function operates on the underlying value as on
|
|
82
85
|
`Either#else` allows to exchange the inner value of `Nothing` to an alternative value.
|
83
86
|
|
84
87
|
Either(false == true).else('false was not true') == Failure(false was not true)
|
85
|
-
Success('truth needs no sugar coating').
|
88
|
+
Success('truth needs no sugar coating').or('all lies') == Success('truth needs no sugar coating')
|
86
89
|
|
87
90
|
## v0.1.1
|
88
91
|
|
data/lib/monadic/maybe.rb
CHANGED
data/lib/monadic/version.rb
CHANGED
@@ -31,9 +31,9 @@ module Transaction
|
|
31
31
|
def self.fetch(params)
|
32
32
|
return Failure('params must be a Hash') unless params.is_a? Hash
|
33
33
|
|
34
|
-
Either(Maybe(params)['id']).
|
35
|
-
>= {|v| Try { BSONTestConverter.from_string(v) }.
|
36
|
-
>= {|v| Try { DatabaseReader.find(v) }.
|
34
|
+
Either(Maybe(params)['id']).or('id is missing').
|
35
|
+
>= {|v| Try { BSONTestConverter.from_string(v) }.or("id '#{v}' is not a valid BSON id") }.
|
36
|
+
>= {|v| Try { DatabaseReader.find(v) }.or("'#{v}' not found") }
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.logs(request_id)
|
data/spec/maybe_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monadic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
prerelease:
|
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-
|
12
|
+
date: 2012-12-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|