bmg 0.23.1 → 0.23.2
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/tuple_transformer.rb +5 -3
- data/lib/bmg/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 533d870170fa4f7f37d2ae23d4523d152314f24c85de94daa9aefacb2799253f
|
4
|
+
data.tar.gz: 23ead7b63f1e02ad24eeacc47baee3a36f5792f00dc00847d83194b48ccf93b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 505ced2b837d8848175f64b0c694b7cd967a835106e91b020285d57bb9eb5759879dc8f37680f2772ae1f80a3f81347e3bf17011ce79b5d1d55858ec0a1c699c
|
7
|
+
data.tar.gz: a7ac4c4a1673a69c1c31abf7ab21d36ec838084e2e39339571b63778fdcff2f28e25eb3795c522b546edc6e02d7b6dffc7d87b99f8cef8408b5eb7daccf410ec
|
@@ -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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: predicate
|
@@ -313,7 +313,7 @@ homepage: http://github.com/enspirit/bmg
|
|
313
313
|
licenses:
|
314
314
|
- MIT
|
315
315
|
metadata: {}
|
316
|
-
post_install_message:
|
316
|
+
post_install_message:
|
317
317
|
rdoc_options: []
|
318
318
|
require_paths:
|
319
319
|
- lib
|
@@ -328,9 +328,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
328
328
|
- !ruby/object:Gem::Version
|
329
329
|
version: '0'
|
330
330
|
requirements: []
|
331
|
-
|
332
|
-
|
333
|
-
signing_key:
|
331
|
+
rubygems_version: 3.4.10
|
332
|
+
signing_key:
|
334
333
|
specification_version: 4
|
335
334
|
summary: Bmg is Alf's successor.
|
336
335
|
test_files: []
|