danom 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/danom/just.rb +8 -0
- data/lib/danom/monad.rb +7 -1
- data/lib/danom/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a67447d17a7279880a2ed4a93c1f6f2945c692df
|
4
|
+
data.tar.gz: d351b1adccaeca8c8044c85bb19c45da25f69a5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23708ef26251403aaa01035c2243879a3527df79f5f48095b22b2da0b3c6ffa4915f91e631a436e36d8341503f5cafebea1829a59d287ca6faa5ce8f3797a61a
|
7
|
+
data.tar.gz: 059b9527dbdf98f5aaaade886065a7a3dbf96fa37d2c81df43beaa100f003d0e60eaac7170a2cff7bf6ae8e86ee050e470ad4dabb674bba3e0e51894bc84e70c
|
data/.gitignore
CHANGED
data/lib/danom/just.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'danom/monad'
|
2
|
+
require 'byebug'
|
2
3
|
|
3
4
|
module Danom
|
4
5
|
# Useful for immediately failing when a nil pops up.
|
@@ -19,6 +20,13 @@ module Danom
|
|
19
20
|
super
|
20
21
|
end
|
21
22
|
|
23
|
+
# @raise [Danom::Just::CannotBeNil]
|
24
|
+
def monad_value
|
25
|
+
val = super
|
26
|
+
raise CannotBeNil if val == nil
|
27
|
+
val
|
28
|
+
end
|
29
|
+
|
22
30
|
# Similar to Maybe#and_then but raises an error if the value ever becomes
|
23
31
|
# nil.
|
24
32
|
#
|
data/lib/danom/monad.rb
CHANGED
data/lib/danom/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uri Gorelik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|