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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f4e96e3e62ddc057b324fa79c7d248ce423dc396
4
- data.tar.gz: 3f5ac0d49fa5e6c5449a67a14c3f2e13b2b4cae7
2
+ SHA256:
3
+ metadata.gz: 533d870170fa4f7f37d2ae23d4523d152314f24c85de94daa9aefacb2799253f
4
+ data.tar.gz: 23ead7b63f1e02ad24eeacc47baee3a36f5792f00dc00847d83194b48ccf93b0
5
5
  SHA512:
6
- metadata.gz: 49a504176009211d654fa88e8a8239d3f515ded7e557b73f56b83e69b92ef535d315245d0dfe4276e6914ccc5668c53d857cb8ae59f2510eead17fb5bcda7964
7
- data.tar.gz: 4e4863368f8f21be2711b08a3f1682e954759940e22207fd843bb8c158884728e5eb1269643c33b4bd5790dce9a9de72be8a16080832d18001eb4a41c79ac0b2
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
@@ -2,7 +2,7 @@ module Bmg
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 23
5
- TINY = 1
5
+ TINY = 2
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
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.1
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-06-27 00:00:00.000000000 Z
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
- rubyforge_project:
332
- rubygems_version: 2.6.14.4
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: []