totally_lazy 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/option.rb +5 -2
- data/spec/option_spec.rb +6 -6
- data/spec/sequence_spec.rb +1 -0
- data/totally_lazy.gemspec +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cfa589843367e7eae070dd8e510e72a884787b
|
4
|
+
data.tar.gz: 8cdf998b9b35ac304e534de4add956e0bc089a4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e589ce5af2900c4e7025f4e6fb59886cde3721af3c5d9fbe92a1bb753a999d72451aeda7483c5a6a0ce348c774bf49c80fd2355f655913395b035eea2d3523e
|
7
|
+
data.tar.gz: f571640e74918a20e181c29b1ec7603b6a088773333196650cf022073bb831463652f2cec32b299ee26ab23e05e21212e464de6d81649e5082155b5838826f51
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.19
|
data/lib/option.rb
CHANGED
@@ -22,7 +22,6 @@ module Option
|
|
22
22
|
raise(Exception, 'some cannot be nil') if @content.nil?
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
25
|
def <=>(object)
|
27
26
|
self.state <=> object.state
|
28
27
|
end
|
@@ -84,7 +83,7 @@ module Option
|
|
84
83
|
end
|
85
84
|
|
86
85
|
def each(&block)
|
87
|
-
@content
|
86
|
+
block.call(@content)
|
88
87
|
end
|
89
88
|
|
90
89
|
def map(predicate=nil, &block)
|
@@ -165,6 +164,10 @@ module Option
|
|
165
164
|
@content = content
|
166
165
|
end
|
167
166
|
|
167
|
+
# def entries
|
168
|
+
# []
|
169
|
+
# end
|
170
|
+
#
|
168
171
|
def <=>(object)
|
169
172
|
self.state <=> object.state
|
170
173
|
end
|
data/spec/option_spec.rb
CHANGED
@@ -30,12 +30,12 @@ describe 'Option' do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'should support each' do
|
33
|
-
result =
|
34
|
-
option(
|
35
|
-
expect(result).to eq(
|
36
|
-
result
|
37
|
-
|
38
|
-
expect(result).to eq(
|
33
|
+
result = 0
|
34
|
+
option(1).each{|i| result=i+1}
|
35
|
+
expect(result).to eq(2)
|
36
|
+
result=0
|
37
|
+
none.each{|i| result=100}
|
38
|
+
expect(result).to eq(0)
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'should get or else' do
|
data/spec/sequence_spec.rb
CHANGED
@@ -99,6 +99,7 @@ describe 'Sequence' do
|
|
99
99
|
expect(sequence(sequence(1, 2), sequence(3, 4)).flat_map { |s| s+1 }).to eq(sequence(2, 3, 4, 5))
|
100
100
|
expect(sequence(sequence(1, 2), sequence(3, 4)).flat_map { |s| s }).to eq(sequence(1, 2, 3, 4))
|
101
101
|
expect(sequence(pair(1, 2), pair(3, 4)).flat_map { |s| s }).to eq(sequence(1, 2, 3, 4))
|
102
|
+
expect(sequence(some(1),none,some(2)).flat_map { |s| s }).to eq(sequence(1,2))
|
102
103
|
end
|
103
104
|
|
104
105
|
it 'should support zip' do
|
data/totally_lazy.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: totally_lazy 0.0.
|
5
|
+
# stub: totally_lazy 0.0.19 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "totally_lazy"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.19"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Kingsley Hendrickse"]
|
14
|
-
s.date = "2015-11-
|
14
|
+
s.date = "2015-11-05"
|
15
15
|
s.description = "Port of java functional library totally lazy to ruby"
|
16
16
|
s.email = "kingsleyhendrickse@me.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -59,7 +59,7 @@ Gem::Specification.new do |s|
|
|
59
59
|
]
|
60
60
|
s.homepage = "http://github.com/kingsleyh/totally_lazy"
|
61
61
|
s.licenses = ["MIT"]
|
62
|
-
s.rubygems_version = "2.4.
|
62
|
+
s.rubygems_version = "2.4.6"
|
63
63
|
s.summary = "Port of java functional library totally lazy to ruby"
|
64
64
|
|
65
65
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totally_lazy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kingsley Hendrickse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.4.
|
204
|
+
rubygems_version: 2.4.6
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Port of java functional library totally lazy to ruby
|