monolens 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/monolens/stdlib/coerce/array.rb +13 -0
- data/lib/monolens/stdlib/coerce.rb +6 -0
- data/lib/monolens/version.rb +1 -1
- data/spec/monolens/stdlib/coerce/test_array.rb +13 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 937b78e577006ce716022cb0ae10fe2dfd21f174be62e67c2f9eefe161f07151
|
4
|
+
data.tar.gz: 90493bf5855603ea1181a5c86a9ba313937954cadb659d95dbca6386b5ba085b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 362211783818b1906bfa90fb42979084e9f1d2bdf7e893313ad5b1d0ef7f2184e1441661221a8df78cfcd530231f7011e678091f26900e041d06414ec92ff116
|
7
|
+
data.tar.gz: ad30e2d1b2fddd5f72ec7c939f275ab098586400d70f4f8d6b4e0e4453c30bd63a32c10b6ebc68d815d8e6bde3aaddd041d50b4bb4b8342f84eb23419d31dda7
|
@@ -22,6 +22,11 @@ module Monolens
|
|
22
22
|
end
|
23
23
|
module_function :string
|
24
24
|
|
25
|
+
def array(options, registry)
|
26
|
+
Array.new(options, registry)
|
27
|
+
end
|
28
|
+
module_function :array
|
29
|
+
|
25
30
|
Monolens.define_namespace 'coerce', self
|
26
31
|
end
|
27
32
|
end
|
@@ -29,3 +34,4 @@ require_relative 'coerce/date'
|
|
29
34
|
require_relative 'coerce/date_time'
|
30
35
|
require_relative 'coerce/integer'
|
31
36
|
require_relative 'coerce/string'
|
37
|
+
require_relative 'coerce/array'
|
data/lib/monolens/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Monolens, 'coerce.array' do
|
4
|
+
subject do
|
5
|
+
Monolens.lens('coerce.array')
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'works' do
|
9
|
+
expect(subject.call(12)).to eql([12])
|
10
|
+
expect(subject.call(nil)).to eql([])
|
11
|
+
expect(subject.call([12, 13])).to eql([12, 13])
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monolens
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- lib/monolens/stdlib/check.rb
|
131
131
|
- lib/monolens/stdlib/check/not_empty.rb
|
132
132
|
- lib/monolens/stdlib/coerce.rb
|
133
|
+
- lib/monolens/stdlib/coerce/array.rb
|
133
134
|
- lib/monolens/stdlib/coerce/date.rb
|
134
135
|
- lib/monolens/stdlib/coerce/date_time.rb
|
135
136
|
- lib/monolens/stdlib/coerce/integer.rb
|
@@ -193,6 +194,7 @@ files:
|
|
193
194
|
- spec/monolens/stdlib/array/test_join.rb
|
194
195
|
- spec/monolens/stdlib/array/test_map.rb
|
195
196
|
- spec/monolens/stdlib/check/test_not_empty.rb
|
197
|
+
- spec/monolens/stdlib/coerce/test_array.rb
|
196
198
|
- spec/monolens/stdlib/coerce/test_date.rb
|
197
199
|
- spec/monolens/stdlib/coerce/test_datetime.rb
|
198
200
|
- spec/monolens/stdlib/coerce/test_integer.rb
|
@@ -242,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
244
|
- !ruby/object:Gem::Version
|
243
245
|
version: '0'
|
244
246
|
requirements: []
|
245
|
-
rubygems_version: 3.
|
247
|
+
rubygems_version: 3.3.27
|
246
248
|
signing_key:
|
247
249
|
specification_version: 4
|
248
250
|
summary: Data transformations inspired by Cambria lenses
|