totally_lazy 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGUyNzc3NTNjMDYzY2UyOWU4NjFjNzhmZDZlZTJlZDM0NDJkMmU0NA==
4
+ NzFhMzBlOTFkNmRhZGEyMmVkNzA0ZGI5ODVjMWMzNDk3YjM2M2MyMw==
5
5
  data.tar.gz: !binary |-
6
- YzI3YjVkZGU4YmNiMmM0Y2QxZjVlNTU2OTBkMGQyNjVhOGZmOTc1NA==
6
+ YTlkNWY5NTQ1N2I3YjZjMmUyMzQ5ZTQxZjhjNGIzNzdjNmUxYjIxMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTUxOGRjMDVlNDM2NThhOWJhNDBiZjJlNzI1YzkxZjA4NGI4NWQ3ZTM1YmM1
10
- YjgxYmUwNmU5ZTQ2ZTQ2NmEwYWY3ODJjYzVkNDExYmUyNzllODM1MjVkY2I4
11
- NThkN2EyMWEyMDIwODRhNDhlYjBhODI2MjY2MTU2MWY1Zjk3M2U=
9
+ YzJlODdlZjc0MDZjNmZkZDA4MWRkMGJkOTUwZjcwOTU1NzlmMWM3YmI1YjIx
10
+ NDY2OTIyOGYyNmQ1YjQ1Y2RlOTYxYTA3MTY1Nzg1YTI5OWVkOWQwZGIzMGRm
11
+ MmU1NDk5NWYxODdjMDJmOGUzNjAwYjkxMTMwNDNiMjQyMmE4YjQ=
12
12
  data.tar.gz: !binary |-
13
- NTMxYzE0YTQzNzhhM2M4ZGQ5OTk0MGEyZWNmOThlNjI0YThhZDRkMDQyMGZk
14
- NDU2NWY1YmFhYWIzMTQ0YTk0YjEzYTQ4OTZlYzBjYzBjNTczNmNhNWU1NmM2
15
- NTYyZWMyYzhlNDI0NTFkNzU2M2FkNDkwODU1ZDlkMTkyMGZmNGE=
13
+ NTg2YWE1NDYyMWM4MWQyYWUwZmVjYTVjYjVjMzgyYzdkZDM0ODIxZTU1MTc4
14
+ NjNkYWVhY2RhNTY0NGJkMTI4ZTA4MzllY2Y3ZGQ1MzEyOWNiMjBiOGEwNDYy
15
+ MDNjNjU2ZmY4NmM1NGQ0ZjZmODAxMmIxMGNkYzQwMjVkNWJiYTc=
data/lib/functions.rb CHANGED
@@ -2,7 +2,7 @@ require 'concurrent/executors'
2
2
  require 'concurrent/promise'
3
3
 
4
4
  class Proc
5
- def to_optional
5
+ def optional
6
6
  ->(value) {
7
7
  begin
8
8
  option(self.(value))
data/spec/option_spec.rb CHANGED
@@ -45,9 +45,9 @@ describe 'Option' do
45
45
  end
46
46
 
47
47
  it 'should support flat_map' do
48
- expect(some(4).flat_map(divide(2).to_optional)).to eq(some(2))
49
- expect(some(4).flat_map{ |v| divide(2).to_optional.(v) }).to eq(some(2))
50
- expect(some(4).flat_map(divide(0).to_optional)).to eq(none)
48
+ expect(some(4).flat_map(divide(2).optional)).to eq(some(2))
49
+ expect(some(4).flat_map{ |v| divide(2).optional.(v) }).to eq(some(2))
50
+ expect(some(4).flat_map(divide(0).optional)).to eq(none)
51
51
  expect(none.flat_map(constant(none))).to eq(none)
52
52
  expect(none.flat_map(some(4))).to eq(none)
53
53
  end
@@ -63,7 +63,7 @@ describe 'Option' do
63
63
  expect { none.fold_left(0, ->(a, b) { a+b }) { |a, b| a+b } }.to raise_error(RuntimeError)
64
64
  expect { some(1).map(->(v) { v.to_s }) { |v| v.to_s } }.to raise_error(RuntimeError)
65
65
  expect { none.map(->(v) { v.to_s }) { |v| v.to_s } }.to raise_error(RuntimeError)
66
- expect { some(4).flat_map(divide(2).to_optional){ |v| divide(2).to_optional.(v) } }.to raise_error(RuntimeError)
66
+ expect { some(4).flat_map(divide(2).optional){ |v| divide(2).optional.(v) } }.to raise_error(RuntimeError)
67
67
  end
68
68
 
69
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totally_lazy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raymond Barlow