kleisli 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/lib/kleisli/maybe.rb +7 -3
- data/lib/kleisli/version.rb +1 -1
- metadata +61 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f961cee935ddef3376c9626dc6ee671b3d71dd28
|
4
|
+
data.tar.gz: e26f1050450bb9bb5179b14d39bbda49c180d87d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f3a54414eb473fe1e854011e2dafb796561bfa251404e49340a53ef4cf7ff65e3ce1c0d4aa7aa4b34790811deea87e7999fe97f54d61599e7fc4f8267332a933
|
7
|
+
data.tar.gz: 031eecf67163e1e6748b865fda13fec8588548ebe284c3f5177a061f32c620f8c5ff33359c09e97a4024bd5a13e65e4b5fb8deed25b30abade234367e1611a90
|
data/lib/kleisli/maybe.rb
CHANGED
@@ -33,8 +33,12 @@ module Kleisli
|
|
33
33
|
self
|
34
34
|
end
|
35
35
|
|
36
|
-
def or(other)
|
37
|
-
|
36
|
+
def or(other, &other_blk)
|
37
|
+
if other_blk
|
38
|
+
other_blk.call
|
39
|
+
else
|
40
|
+
other
|
41
|
+
end
|
38
42
|
end
|
39
43
|
|
40
44
|
def to_s
|
@@ -56,7 +60,7 @@ module Kleisli
|
|
56
60
|
block.call(@value)
|
57
61
|
end
|
58
62
|
|
59
|
-
def or(other)
|
63
|
+
def or(other, &other_blk)
|
60
64
|
self
|
61
65
|
end
|
62
66
|
|
data/lib/kleisli/version.rb
CHANGED
metadata
CHANGED
@@ -1,60 +1,68 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: kleisli
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Josep M. Bach
|
8
8
|
- Ryan Levick
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2015-01-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: bundler
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
version: "1.6"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.6'
|
23
21
|
type: :development
|
24
|
-
version_requirements: *id001
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: rake
|
27
22
|
prerelease: false
|
28
|
-
|
29
|
-
requirements:
|
30
|
-
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version:
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.6'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '10.0'
|
33
35
|
type: :development
|
34
|
-
version_requirements: *id002
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: minitest
|
37
36
|
prerelease: false
|
38
|
-
|
39
|
-
requirements:
|
40
|
-
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '10.0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: minitest
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '5.5'
|
43
49
|
type: :development
|
44
|
-
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '5.5'
|
45
56
|
description: Usable, idiomatic common monads in Ruby
|
46
|
-
email:
|
57
|
+
email:
|
47
58
|
- josep.m.bach@gmail.com
|
48
59
|
- ryan.levick@gmail.com
|
49
60
|
executables: []
|
50
|
-
|
51
61
|
extensions: []
|
52
|
-
|
53
62
|
extra_rdoc_files: []
|
54
|
-
|
55
|
-
|
56
|
-
- .
|
57
|
-
- .travis.yml
|
63
|
+
files:
|
64
|
+
- ".gitignore"
|
65
|
+
- ".travis.yml"
|
58
66
|
- Gemfile
|
59
67
|
- LICENSE.txt
|
60
68
|
- README.md
|
@@ -77,35 +85,34 @@ files:
|
|
77
85
|
- test/kleisli/try_test.rb
|
78
86
|
- test/test_helper.rb
|
79
87
|
homepage: https://github.com/txus/kleisli
|
80
|
-
licenses:
|
88
|
+
licenses:
|
81
89
|
- MIT
|
82
90
|
metadata: {}
|
83
|
-
|
84
91
|
post_install_message:
|
85
92
|
rdoc_options: []
|
86
|
-
|
87
|
-
require_paths:
|
93
|
+
require_paths:
|
88
94
|
- lib
|
89
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
-
requirements:
|
91
|
-
-
|
92
|
-
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
98
105
|
requirements: []
|
99
|
-
|
100
106
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.2.2
|
102
108
|
signing_key:
|
103
109
|
specification_version: 4
|
104
110
|
summary: Usable, idiomatic common monads in Ruby
|
105
|
-
test_files:
|
111
|
+
test_files:
|
106
112
|
- test/kleisli/composition_test.rb
|
107
113
|
- test/kleisli/either_test.rb
|
108
114
|
- test/kleisli/future_test.rb
|
109
115
|
- test/kleisli/maybe_test.rb
|
110
116
|
- test/kleisli/try_test.rb
|
111
117
|
- test/test_helper.rb
|
118
|
+
has_rdoc:
|