bmg 0.23.1 → 0.23.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/bmg/support/ordering.rb +1 -3
- data/lib/bmg/support/tuple_transformer.rb +5 -3
- data/lib/bmg/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3b89960dcbdf37657c8c0dea35e8f735c71175e61363a122b5a249e4a3bd232e
|
4
|
+
data.tar.gz: 93f21f3f85bf21466a280b67e6cf339ae1498ed165cf40fcbd38ac88bd1f2970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 043731637cf8c164225db38e9f47c2d9bf68a35598ea37947dede59c031c99e550f0dcfe5ac20503942d0a43b5036749b9d158140f59d1e463594a2fe20a1236
|
7
|
+
data.tar.gz: ad41145f3411f1e4cf28e293ef53faee512c9808cbc0e7a091a2da3366b665dadea628eacbf684e5c24d1ea4c3c97df8c5e783f59597d6a385119a14f8acab8c
|
data/lib/bmg/support/ordering.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Bmg
|
2
2
|
class TupleTransformer
|
3
3
|
|
4
|
+
Callable = ->(t) { t.respond_to?(:call) }
|
5
|
+
|
4
6
|
def initialize(transformation)
|
5
7
|
@transformation = transformation
|
6
8
|
end
|
@@ -26,7 +28,7 @@ module Bmg
|
|
26
28
|
|
27
29
|
def transform_tuple(tuple, with)
|
28
30
|
case with
|
29
|
-
when Symbol, Proc, Regexp
|
31
|
+
when Symbol, Proc, Regexp, Callable
|
30
32
|
tuple.each_with_object({}){|(k,v),dup|
|
31
33
|
dup[k] = transform_attr(v, with)
|
32
34
|
}
|
@@ -72,7 +74,7 @@ module Bmg
|
|
72
74
|
else
|
73
75
|
raise ArgumentError, "#{with} should respond to `parse`"
|
74
76
|
end
|
75
|
-
when Proc
|
77
|
+
when Proc, Callable
|
76
78
|
with.call(value)
|
77
79
|
when Hash
|
78
80
|
with[value]
|
@@ -82,4 +84,4 @@ module Bmg
|
|
82
84
|
end
|
83
85
|
|
84
86
|
end # module TupleTransformer
|
85
|
-
end # module Bmg
|
87
|
+
end # module Bmg
|
data/lib/bmg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bmg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.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: 2024-
|
11
|
+
date: 2024-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: predicate
|
@@ -328,8 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
328
328
|
- !ruby/object:Gem::Version
|
329
329
|
version: '0'
|
330
330
|
requirements: []
|
331
|
-
|
332
|
-
rubygems_version: 2.6.14.4
|
331
|
+
rubygems_version: 3.3.27
|
333
332
|
signing_key:
|
334
333
|
specification_version: 4
|
335
334
|
summary: Bmg is Alf's successor.
|