monolens 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/monolens/core/literal.rb +11 -0
- data/lib/monolens/core.rb +6 -0
- data/lib/monolens/version.rb +1 -1
- data/spec/monolens/core/test_literal.rb +13 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef48815edf1f5c767fd7e41ad3720046b4d6a7c
|
4
|
+
data.tar.gz: 366cfea423fca4d3a7aa7471a67fd19571016b50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e0ae29c6ab1c18b22d3a96c7455983116f5433ba537ddf8a4c6a8c5ef289eb562a3d2d955da6218eb7ccf27a34488405f3fb66798524b03943deb61498093b3
|
7
|
+
data.tar.gz: 8513b04a89c60ded94f11a7296b613bf23358515b4f5e035b933afa9259e1f4ad7c0cc282d1d0c96841feefcaf46743aad325ed877c7e4b476663cb079f281f3
|
data/README.md
CHANGED
@@ -79,6 +79,7 @@ result = lens.call(input)
|
|
79
79
|
core.dig - Extract from the input value (object or array) using a path.
|
80
80
|
core.chain - Applies a chain of lenses to an input value
|
81
81
|
core.mapping - Converts the input value via a key:value mapping
|
82
|
+
core.literal - Returns a constant value takens as lens definition
|
82
83
|
|
83
84
|
str.strip - Remove leading and trailing spaces of an input string
|
84
85
|
str.split - Splits the input string as an array
|
data/lib/monolens/core.rb
CHANGED
@@ -10,6 +10,11 @@ module Monolens
|
|
10
10
|
end
|
11
11
|
module_function :dig
|
12
12
|
|
13
|
+
def literal(options)
|
14
|
+
Literal.new(options)
|
15
|
+
end
|
16
|
+
module_function :literal
|
17
|
+
|
13
18
|
def mapping(options)
|
14
19
|
Mapping.new(options)
|
15
20
|
end
|
@@ -21,3 +26,4 @@ end
|
|
21
26
|
require_relative 'core/chain'
|
22
27
|
require_relative 'core/dig'
|
23
28
|
require_relative 'core/mapping'
|
29
|
+
require_relative 'core/literal'
|
data/lib/monolens/version.rb
CHANGED
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.5.
|
4
|
+
version: 0.5.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: 2022-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/monolens/core.rb
|
94
94
|
- lib/monolens/core/chain.rb
|
95
95
|
- lib/monolens/core/dig.rb
|
96
|
+
- lib/monolens/core/literal.rb
|
96
97
|
- lib/monolens/core/mapping.rb
|
97
98
|
- lib/monolens/error.rb
|
98
99
|
- lib/monolens/error_handler.rb
|
@@ -132,6 +133,7 @@ files:
|
|
132
133
|
- spec/monolens/command/names.json
|
133
134
|
- spec/monolens/command/robust-map-upcase.lens.yml
|
134
135
|
- spec/monolens/core/test_dig.rb
|
136
|
+
- spec/monolens/core/test_literal.rb
|
135
137
|
- spec/monolens/core/test_mapping.rb
|
136
138
|
- spec/monolens/lens/test_options.rb
|
137
139
|
- spec/monolens/object/test_extend.rb
|