fear 0.8.0 → 0.9.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/lib/fear/either.rb +2 -2
- data/lib/fear/utils.rb +1 -1
- data/lib/fear/version.rb +1 -1
- data/spec/fear/right_biased/left.rb +16 -0
- data/spec/fear/right_biased/right.rb +16 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f87d9ddc3fd6c7bdd259ed164ca27668c3421f1
|
4
|
+
data.tar.gz: f1cd2982080e8b8f302be524f55ef18f9406b3e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18926b68929c6b68b8e7e3fe1f5352a2998dade76e1860097b470a93e7d236142a84b1cf98a2413b6b093dd412461bc5fa764f10a3753cf932ab0558d8d59d9e
|
7
|
+
data.tar.gz: 95c5eecb1b37444c63fdf713bcee58306053ba5708b10b4c7f6d4fa4dd53804143bc321cb5b10927297f136951d83573d9924086b6faa0794a239513603b12c3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 0.9.0
|
2
|
+
|
3
|
+
* Test against last supported ruby versions: 2.3.7, 2.4.4, 2.5.1 ([@bolshakov][])
|
4
|
+
* Make possible to pass to `#get_or_else` nil and false values ([@bolshakov][])
|
5
|
+
|
1
6
|
## 0.8.0
|
2
7
|
|
3
8
|
* Add `Fear::Done` to represent successful completion without a value. ([@bolshakov][])
|
data/README.md
CHANGED
@@ -103,8 +103,8 @@ end
|
|
103
103
|
|
104
104
|
puts(
|
105
105
|
result.reduce(
|
106
|
-
-> (x) { "You passed me the
|
107
|
-
-> (x) { "You passed me the
|
106
|
+
-> (x) { "You passed me the String: #{x}" },
|
107
|
+
-> (x) { "You passed me the Int: #{x}, which I will increment. #{x} + 1 = #{x+1}" }
|
108
108
|
)
|
109
109
|
)
|
110
110
|
```
|
data/lib/fear/either.rb
CHANGED
@@ -21,8 +21,8 @@ module Fear
|
|
21
21
|
#
|
22
22
|
# puts(
|
23
23
|
# result.reduce(
|
24
|
-
# -> (x) { "You passed me the
|
25
|
-
# -> (x) { "You passed me the
|
24
|
+
# -> (x) { "You passed me the String: #{x}" },
|
25
|
+
# -> (x) { "You passed me the Int: #{x}, which I will increment. #{x} + 1 = #{x+1}" }
|
26
26
|
# )
|
27
27
|
# )
|
28
28
|
#
|
data/lib/fear/utils.rb
CHANGED
data/lib/fear/version.rb
CHANGED
@@ -20,6 +20,22 @@ RSpec.shared_examples Fear::RightBiased::Left do
|
|
20
20
|
is_expected.to eq('default')
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
context 'with false argument' do
|
25
|
+
subject { left.get_or_else(false) }
|
26
|
+
|
27
|
+
it 'returns default value' do
|
28
|
+
is_expected.to eq(false)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'with nil argument' do
|
33
|
+
subject { left.get_or_else(nil) }
|
34
|
+
|
35
|
+
it 'returns default value' do
|
36
|
+
is_expected.to eq(nil)
|
37
|
+
end
|
38
|
+
end
|
23
39
|
end
|
24
40
|
|
25
41
|
describe '#each' do
|
@@ -27,6 +27,22 @@ RSpec.shared_examples Fear::RightBiased::Right do
|
|
27
27
|
is_expected.to eq('value')
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
context 'with false argument' do
|
32
|
+
subject { right.get_or_else(false) }
|
33
|
+
|
34
|
+
it 'returns value' do
|
35
|
+
is_expected.to eq('value')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'with nil argument' do
|
40
|
+
subject { right.get_or_else(nil) }
|
41
|
+
|
42
|
+
it 'returns value' do
|
43
|
+
is_expected.to eq('value')
|
44
|
+
end
|
45
|
+
end
|
30
46
|
end
|
31
47
|
|
32
48
|
describe '#each' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fear
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tema Bolshakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-equalizer
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
192
|
+
rubygems_version: 2.6.11
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: "%q{Ruby port of some Scala's monads.}"
|