totally_lazy 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12cfa589843367e7eae070dd8e510e72a884787b
4
- data.tar.gz: 8cdf998b9b35ac304e534de4add956e0bc089a4e
3
+ metadata.gz: ae3aa55718db2868762a74edaffc59f8268ac31e
4
+ data.tar.gz: edde4717962e268a0f56f0a3f104d2c4b4ac4049
5
5
  SHA512:
6
- metadata.gz: 0e589ce5af2900c4e7025f4e6fb59886cde3721af3c5d9fbe92a1bb753a999d72451aeda7483c5a6a0ce348c774bf49c80fd2355f655913395b035eea2d3523e
7
- data.tar.gz: f571640e74918a20e181c29b1ec7603b6a088773333196650cf022073bb831463652f2cec32b299ee26ab23e05e21212e464de6d81649e5082155b5838826f51
6
+ metadata.gz: c94080f5390b6f3b2ff954a31d861f9acf49461ce807805874f636f5d9f6d37a992fcc3dd518e7fbadc303ff23a621a402581822184858a5f6063ab1b8f8dffd
7
+ data.tar.gz: 762c6925b50f6a2d7bdddbc38e9522096ec4273c6f494bfcedfd9c7b09511fb77f7bc003d89297315d5694f9e2c54d34eb41830df7433f0d17227165b59fad23
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.19
1
+ 0.0.20
data/lib/option.rb CHANGED
@@ -125,8 +125,12 @@ module Option
125
125
  as_option(@content.take_while(&block))
126
126
  end
127
127
 
128
+ def flatten
129
+ @content
130
+ end
131
+
128
132
  def flat_map(&block)
129
- as_option(sequence(@content).flat_map(&block))
133
+ some(block.call(@content)).flatten
130
134
  end
131
135
 
132
136
  alias collect_concat flat_map
@@ -274,6 +278,10 @@ module Option
274
278
  none
275
279
  end
276
280
 
281
+ def flatten
282
+ none
283
+ end
284
+
277
285
  def flat_map(&block)
278
286
  none
279
287
  end
data/spec/option_spec.rb CHANGED
@@ -179,6 +179,8 @@ describe 'Option' do
179
179
 
180
180
  it 'should support flat_map' do
181
181
  expect(option(nil).flat_map{|v| v.first}).to eq(none)
182
+ expect(option(1).flat_map{|v| some(2)}).to eq(some(2))
183
+ expect(option(1).flat_map{|v| none}).to eq(none)
182
184
  end
183
185
 
184
186
  end
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.19 ruby lib
5
+ # stub: totally_lazy 0.0.20 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "totally_lazy"
9
- s.version = "0.0.19"
9
+ s.version = "0.0.20"
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-05"
14
+ s.date = "2015-11-09"
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.6"
62
+ s.rubygems_version = "2.4.5.1"
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.19
4
+ version: 0.0.20
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-05 00:00:00.000000000 Z
11
+ date: 2015-11-09 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.6
204
+ rubygems_version: 2.4.5.1
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: Port of java functional library totally lazy to ruby