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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f4e96e3e62ddc057b324fa79c7d248ce423dc396
4
- data.tar.gz: 3f5ac0d49fa5e6c5449a67a14c3f2e13b2b4cae7
2
+ SHA256:
3
+ metadata.gz: 3b89960dcbdf37657c8c0dea35e8f735c71175e61363a122b5a249e4a3bd232e
4
+ data.tar.gz: 93f21f3f85bf21466a280b67e6cf339ae1498ed165cf40fcbd38ac88bd1f2970
5
5
  SHA512:
6
- metadata.gz: 49a504176009211d654fa88e8a8239d3f515ded7e557b73f56b83e69b92ef535d315245d0dfe4276e6914ccc5668c53d857cb8ae59f2510eead17fb5bcda7964
7
- data.tar.gz: 4e4863368f8f21be2711b08a3f1682e954759940e22207fd843bb8c158884728e5eb1269643c33b4bd5790dce9a9de72be8a16080832d18001eb4a41c79ac0b2
6
+ metadata.gz: 043731637cf8c164225db38e9f47c2d9bf68a35598ea37947dede59c031c99e550f0dcfe5ac20503942d0a43b5036749b9d158140f59d1e463594a2fe20a1236
7
+ data.tar.gz: ad41145f3411f1e4cf28e293ef53faee512c9808cbc0e7a091a2da3366b665dadea628eacbf684e5c24d1ea4c3c97df8c5e783f59597d6a385119a14f8acab8c
@@ -45,10 +45,8 @@ module Bmg
45
45
  def initialize(attrs)
46
46
  @attrs = if attrs.empty?
47
47
  []
48
- elsif attrs.first.is_a?(Symbol)
49
- attrs.map{|a| [a, :asc] }
50
48
  else
51
- attrs
49
+ attrs.map{|a| a.is_a?(Symbol) ? [a, :asc] : a }
52
50
  end
53
51
  end
54
52
  attr_reader :attrs
@@ -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 = 3
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.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-06-27 00:00:00.000000000 Z
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
- rubyforge_project:
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.