fear 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/lib/fear/done.rb +22 -0
- data/lib/fear/version.rb +1 -1
- data/lib/fear.rb +2 -1
- data/spec/fear/done_spec.rb +17 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 411515ace8057ec8c729af78695f68f9725b1e85
|
4
|
+
data.tar.gz: 950037cd612263f215aba321571a16aa748a182d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f9c7492bf76cb010f74e915f1f0537709c033200198d59c9ac04329e6285e8c098cd1f738ff2c03d676ef60602d285db2420868d1630711053f3135bdebae4
|
7
|
+
data.tar.gz: d0fa4e5806640803d6fd46c6ee1954c1910b557985ea17b61edab3c27d95a343ae7b754aa2e982cd58b164b13f77bbc632e60c20acc55bfecf00e6a7c4c8614f
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/fear/done.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fear
|
2
|
+
# Typically used to signal completion but there is no actual value completed.
|
3
|
+
#
|
4
|
+
# @example
|
5
|
+
# if user.valid?
|
6
|
+
# Right(Done)
|
7
|
+
# else
|
8
|
+
# Left(user.errors)
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
Done = Object.new.tap do |done|
|
12
|
+
# @return [String]
|
13
|
+
def done.to_s
|
14
|
+
'Done'
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [String]
|
18
|
+
def done.inspect
|
19
|
+
'Done'
|
20
|
+
end
|
21
|
+
end.freeze
|
22
|
+
end
|
data/lib/fear/version.rb
CHANGED
data/lib/fear.rb
CHANGED
@@ -6,9 +6,10 @@ module Fear
|
|
6
6
|
IllegalStateException = Class.new(Error)
|
7
7
|
NoSuchElementError = Class.new(Error)
|
8
8
|
|
9
|
+
autoload :Done, 'fear/done'
|
9
10
|
autoload :For, 'fear/for'
|
10
|
-
autoload :Utils, 'fear/utils'
|
11
11
|
autoload :RightBiased, 'fear/right_biased'
|
12
|
+
autoload :Utils, 'fear/utils'
|
12
13
|
|
13
14
|
autoload :Option, 'fear/option'
|
14
15
|
autoload :Some, 'fear/some'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
RSpec.describe Fear::Done do
|
2
|
+
describe '#to_s' do
|
3
|
+
subject { described_class.to_s }
|
4
|
+
|
5
|
+
it { is_expected.to eq('Done') }
|
6
|
+
end
|
7
|
+
|
8
|
+
describe '#inspect' do
|
9
|
+
subject { described_class.inspect }
|
10
|
+
|
11
|
+
it { is_expected.to eq('Done') }
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#==' do
|
15
|
+
it { is_expected.to eq(described_class) }
|
16
|
+
end
|
17
|
+
end
|
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.8.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-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-equalizer
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- Rakefile
|
142
142
|
- fear.gemspec
|
143
143
|
- lib/fear.rb
|
144
|
+
- lib/fear/done.rb
|
144
145
|
- lib/fear/either.rb
|
145
146
|
- lib/fear/failure.rb
|
146
147
|
- lib/fear/for.rb
|
@@ -155,6 +156,7 @@ files:
|
|
155
156
|
- lib/fear/try.rb
|
156
157
|
- lib/fear/utils.rb
|
157
158
|
- lib/fear/version.rb
|
159
|
+
- spec/fear/done_spec.rb
|
158
160
|
- spec/fear/failure_spec.rb
|
159
161
|
- spec/fear/for_spec.rb
|
160
162
|
- spec/fear/left_spec.rb
|
@@ -192,6 +194,7 @@ signing_key:
|
|
192
194
|
specification_version: 4
|
193
195
|
summary: "%q{Ruby port of some Scala's monads.}"
|
194
196
|
test_files:
|
197
|
+
- spec/fear/done_spec.rb
|
195
198
|
- spec/fear/failure_spec.rb
|
196
199
|
- spec/fear/for_spec.rb
|
197
200
|
- spec/fear/left_spec.rb
|