remap 2.1.19 → 2.1.23
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 +4 -4
- data/lib/remap/base.rb +3 -3
- data/lib/remap/contract.rb +2 -2
- data/lib/remap/extensions/hash.rb +1 -1
- data/lib/remap/extensions/object.rb +1 -1
- data/lib/remap/failure.rb +1 -1
- data/lib/remap/notice.rb +1 -1
- data/lib/remap/rule/map/required.rb +1 -1
- data/lib/remap/state/extension.rb +2 -2
- data/lib/remap/types.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7206513e530a5f04730ad821a9a45508a3af324cb8a5b55e3f3a08d8ef0baac3
|
4
|
+
data.tar.gz: 154620f3b394954ae9c92faa48819109bfcede9ccdc6a15cc1676b5f970ce6c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af07f9168dfdd08ea1a08b0c48123b505993e9e1fa75f17bd1253f0f6b8e74824941b54fec286633cc481d49e071cc2ab4209e9cbd617f4527ea463966926d5b
|
7
|
+
data.tar.gz: f2761c2d6426bab906663993d5de3eafc38740949be998301353d39dced383891ed2f49f6243926675cdffaeaca2eca907684d5300a1ed36185cdd6a3b18f805
|
data/lib/remap/base.rb
CHANGED
@@ -110,7 +110,7 @@ module Remap
|
|
110
110
|
extend Operation
|
111
111
|
|
112
112
|
with_options instance_accessor: true do |scope|
|
113
|
-
scope.config_accessor(:contract) { Dry::Schema.
|
113
|
+
scope.config_accessor(:contract) { Dry::Schema.define {} }
|
114
114
|
scope.config_accessor(:constructor) { IDENTITY }
|
115
115
|
scope.config_accessor(:options) { EMPTY_ARRAY }
|
116
116
|
scope.config_accessor(:option) { EMPTY_HASH }
|
@@ -175,7 +175,7 @@ module Remap
|
|
175
175
|
#
|
176
176
|
# @return [void]
|
177
177
|
def self.rule(...)
|
178
|
-
self.rules = rules + [->
|
178
|
+
self.rules = rules + [-> { rule(...) }]
|
179
179
|
end
|
180
180
|
|
181
181
|
# Defines a required option for the mapper
|
@@ -212,7 +212,7 @@ module Remap
|
|
212
212
|
# @option method (:new) [Symbol]
|
213
213
|
# @option strategy (:argument) [:argument, :keywords, :none]
|
214
214
|
#
|
215
|
-
# @example A mapper, which
|
215
|
+
# @example A mapper, which maps a value at [:a] to [:b]
|
216
216
|
# class Mapper < Remap::Base
|
217
217
|
# define do
|
218
218
|
# map :a, to: :b
|
data/lib/remap/contract.rb
CHANGED
@@ -13,11 +13,11 @@ module Remap
|
|
13
13
|
def self.call(rules:, options:, contract:, attributes:)
|
14
14
|
Class.new(self) do
|
15
15
|
rules.each do |rule|
|
16
|
-
|
16
|
+
instance_exec(&rule)
|
17
17
|
end
|
18
18
|
|
19
19
|
options.each do |option|
|
20
|
-
|
20
|
+
instance_exec(&option)
|
21
21
|
end
|
22
22
|
|
23
23
|
schema(contract)
|
data/lib/remap/failure.rb
CHANGED
data/lib/remap/notice.rb
CHANGED
@@ -88,7 +88,7 @@ module Remap
|
|
88
88
|
# @return [self]
|
89
89
|
def _(&block)
|
90
90
|
unless block
|
91
|
-
return _ { raise ArgumentError, "Input: #{self} output: #{_1.
|
91
|
+
return _ { raise ArgumentError, "Input: #{self} output: #{_1.formatted}" }
|
92
92
|
end
|
93
93
|
|
94
94
|
unless (result = Schema.call(self)).success?
|
@@ -117,7 +117,7 @@ module Remap
|
|
117
117
|
|
118
118
|
# @return [String]
|
119
119
|
def inspect
|
120
|
-
"#<State %s>" % compact_blank.
|
120
|
+
"#<State %s>" % compact_blank.formatted
|
121
121
|
end
|
122
122
|
|
123
123
|
# Merges {self} with {other} and returns a new state
|
data/lib/remap/types.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-12-08 00:00:00.000000000 Z
|
@@ -305,7 +305,7 @@ metadata:
|
|
305
305
|
homepage_uri: https://github.com/oleander/remap
|
306
306
|
documentation_uri: http://oleander.io/remap/
|
307
307
|
rubygems_mfa_required: 'true'
|
308
|
-
post_install_message:
|
308
|
+
post_install_message:
|
309
309
|
rdoc_options: []
|
310
310
|
require_paths:
|
311
311
|
- lib
|
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
321
|
version: '0'
|
322
322
|
requirements: []
|
323
323
|
rubygems_version: 3.2.32
|
324
|
-
signing_key:
|
324
|
+
signing_key:
|
325
325
|
specification_version: 4
|
326
326
|
summary: An expressive and feature-complete data mapper with intuitive syntax thanks
|
327
327
|
to its DSL
|