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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72e3182ef74e2ded6273ca00fd9cf2772ec8a5e1
4
- data.tar.gz: c20c2215bfecc7332df727610e2f90bed3c8c6ef
3
+ metadata.gz: a67447d17a7279880a2ed4a93c1f6f2945c692df
4
+ data.tar.gz: d351b1adccaeca8c8044c85bb19c45da25f69a5b
5
5
  SHA512:
6
- metadata.gz: 8fea274d49f0694b5b6b3124c10a7b13e8dcf154291de8daaa39e254fcae80a619070489960eb3d2df55dd5b5788bbe03d6b064f22ed6cbb5bfcc2e4dad944d4
7
- data.tar.gz: 68e8596ce864c5a56c20e6b05e413eab56c75535b505bf98106296c2c3220e617fa494fd06d4ff577f4f7a4eb01a2cd5526869a44e3cf3fc2bee15ac8dc360a4
6
+ metadata.gz: 23708ef26251403aaa01035c2243879a3527df79f5f48095b22b2da0b3c6ffa4915f91e631a436e36d8341503f5cafebea1829a59d287ca6faa5ce8f3797a61a
7
+ data.tar.gz: 059b9527dbdf98f5aaaade886065a7a3dbf96fa37d2c81df43beaa100f003d0e60eaac7170a2cff7bf6ae8e86ee050e470ad4dabb674bba3e0e51894bc84e70c
data/.gitignore CHANGED
@@ -13,3 +13,5 @@
13
13
 
14
14
  # rspec failure tracking
15
15
  .rspec_status
16
+
17
+ *.gem
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
@@ -42,7 +42,13 @@ module Danom
42
42
  @value
43
43
  end
44
44
  end
45
- alias_method :~@, :monad_value
45
+
46
+ # Alias for #monad_value
47
+ #
48
+ # @see #monad_value
49
+ def ~@
50
+ monad_value
51
+ end
46
52
 
47
53
 
48
54
  # Calls #to_s on the underlying value.
data/lib/danom/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Danom
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-01 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler