totally_lazy 0.1.44 → 0.1.45

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
- NzA2YmNiZDA0NWZiM2ZjZDc0OWU2OTQ2OTE0MzIzM2NhMmIxNGIxOQ==
4
+ ZjhhYmY1NzQzYTQ3MGI3NDM5OGI3ODFkNGYzY2Y4YjFkMzQwYjZkNg==
5
5
  data.tar.gz: !binary |-
6
- ZTA2NmYxNGI4MGQzNjRkNjQwMzJiMDVjYzEzN2NkNzljYTI0YmM4ZQ==
6
+ MWVlYmZkOTA1YmE0ZmI0YWQzMDQ2MWJmOTM3ZGVhM2JmMTMyODhhMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTUzOGNhNmRkZjc4ZDdlNWYyNGQyNmY0NmNjMjlkZTFhMDM0OGJkZmU4YTI5
10
- MmRhMmIxNmMwYjIxYjg4NjJlMjkyZGQ4MGUyYzg3Njg4ZDQxZGM2MTUzNGRh
11
- NWU0Y2ZkZTk0ZTRjMDE4OWFkODM4ZDRlYzBlMTZmYzYwYjc3Njg=
9
+ ZWRmZmFhMjMyMDdlYTk1N2MxYzAxNDI3NTE0MTQzNTMwNzMyODcyZmM2OGVh
10
+ ZWFlMjFhMmYyYzJiYjU2M2Y0YTNlYzI5NjY3ZGQzNTFkNGY3OWVkYjVjOThm
11
+ YTIyZDBlN2EyZmZmNzdlNWY3MDAzZTZiMDllMzBhZGE5YjRiZmE=
12
12
  data.tar.gz: !binary |-
13
- ZGVhNzkwODUwN2RhMmE2NjJkMDE5Yzc5ZWNiNjhmOGVlMjY4YWRiMTEzOTll
14
- MWZlYzAyNzNjMzkxYzNkZTM1ZDI1NmIzY2YyZGU4MmM1NzA5ZTFmNDU3MzA5
15
- OGJmMTc2MzNiMGIzMmU2NjMzODFjZjU4NmM3MzdjY2IzZDA4MTA=
13
+ MjhiYzIxYzAxMDZhZTUyYWE5MWU4MWFkODBhNzI0MjkyYmNhZTE0MDIzZWQ0
14
+ OWJkOGVlOTA3Yzk0MzE2MjZjZGI3Y2RlYzNlZDg4NDlkNGE5MGJjZGVmYjll
15
+ ZTUxNTM5ZTc4MWE5YmVlMTIzZjg1MTMzM2RjODM5NzJjODA5NTY=
@@ -4,21 +4,20 @@ module Predicates
4
4
  -> (bool) { !pred.(bool) }
5
5
  end
6
6
 
7
- def is_left?
7
+ def is_left
8
8
  -> (either) { either.is_left? }
9
9
  end
10
10
 
11
- def is_right?
11
+ def is_right
12
12
  -> (either) { either.is_right? }
13
13
  end
14
14
 
15
- def matches?(regex)
15
+ def matches(regex)
16
16
  ->(value) { !regex.match(value).nil? }
17
17
  end
18
18
 
19
19
  def equal_to?(that)
20
20
  ->(this) { this == that }
21
21
  end
22
- alias is? equal_to?
23
-
22
+ alias is equal_to?
24
23
  end
@@ -18,8 +18,8 @@ describe 'Either' do
18
18
 
19
19
  it 'can be used in filter and map' do
20
20
  eithers = sequence(left('error'), right(3))
21
- expect(eithers.filter(is_left?).map(get_left)).to eq(sequence('error'))
22
- expect(eithers.filter(is_right?).map(get_right)).to eq(sequence(3))
21
+ expect(eithers.filter(is_left).map(get_left)).to eq(sequence('error'))
22
+ expect(eithers.filter(is_right).map(get_right)).to eq(sequence(3))
23
23
  end
24
24
 
25
25
  it 'should support map' do
@@ -2,13 +2,13 @@ require_relative '../spec_helper'
2
2
 
3
3
  describe 'Predicates' do
4
4
  it 'should allow regex matching' do
5
- expect(sequence('Stacy').find(matches?(/Stac/))).to eq(some('Stacy'))
6
- expect(sequence('Raymond').find(matches?(/NotAwesome/))).to eq(none)
5
+ expect(sequence('Stacy').find(matches(/Stac/))).to eq(some('Stacy'))
6
+ expect(sequence('Raymond').find(matches(/NotAwesome/))).to eq(none)
7
7
  end
8
8
 
9
9
  it 'should allow is' do
10
- expect(sequence('Stuff').find(is?('Stuff'))).to eq(some('Stuff'))
10
+ expect(sequence('Stuff').find(is('Stuff'))).to eq(some('Stuff'))
11
11
  expect(sequence('Stuff').find(equal_to?('Stuff'))).to eq(some('Stuff'))
12
- expect(sequence('Stuff').find(is?('Nothing'))).to eq(none)
12
+ expect(sequence('Stuff').find(is('Nothing'))).to eq(none)
13
13
  end
14
14
  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.44
4
+ version: 0.1.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raymond Barlow