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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c95e49346ba535f1064e28cfd13d362b4d90e93
4
- data.tar.gz: 59a2da6b6f7bdc0f5ceea902d5b9a4ca5f299a5f
3
+ metadata.gz: 411515ace8057ec8c729af78695f68f9725b1e85
4
+ data.tar.gz: 950037cd612263f215aba321571a16aa748a182d
5
5
  SHA512:
6
- metadata.gz: ace23b4375d62413a49c0f57f48bafb2fa69915a08cbac6ed0e021d5a5892c890c4111028e25d4deade4425aee9424ea47695045d1c4253b94cc3ba73a094fdd
7
- data.tar.gz: d4dfb59841bca2985644dc3f34f550321c48bcb669ac7ad3ac55bb843e483bacce48371529e1223e2d09e89f08f811e4d90d1976c6a45d3a50f3613881e8346a
6
+ metadata.gz: 45f9c7492bf76cb010f74e915f1f0537709c033200198d59c9ac04329e6285e8c098cd1f738ff2c03d676ef60602d285db2420868d1630711053f3135bdebae4
7
+ data.tar.gz: d0fa4e5806640803d6fd46c6ee1954c1910b557985ea17b61edab3c27d95a343ae7b754aa2e982cd58b164b13f77bbc632e60c20acc55bfecf00e6a7c4c8614f
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ *.gem
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.8.0
2
+
3
+ * Add `Fear::Done` to represent successful completion without a value. ([@bolshakov][])
4
+
1
5
  ## 0.7.0
2
6
 
3
7
  * Better errors for types assertions ([@bolshakov][])
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
@@ -1,3 +1,3 @@
1
1
  module Fear
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
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.7.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-02-05 00:00:00.000000000 Z
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