HornsAndHooves-flat_map 0.6.0 → 0.7.0
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/flat_map/errors.rb +1 -1
- data/lib/flat_map/open_mapper.rb +2 -2
- data/lib/flat_map/version.rb +3 -1
- data/spec/flat_map/mapper/mapping_spec.rb +2 -2
- data/spec/flat_map/mapper/mounting_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd4f2b02c245613b8d3f3346d2355ae2108a4342ddb9f9cd1e268ef87310f1b8
|
4
|
+
data.tar.gz: fdf3bf9c4a4ffaa3c6647d907d0e02846eabbc60f5d9b593555d1904f371e72d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ded272e0095638c4173d099651186dedd3116e1ac4532c0473d7dd6f126227026b55c6346728630fffe2580f483b5c0521c982a8bb0231eecc0917d498fa56e5
|
7
|
+
data.tar.gz: 20037626c6382fd471dff4db1a41f7ec09f81e7a5bbbe0ff80ffa6b1990bda10a1992dbf989da33e77ad1c0da7e0a9767bfff69a8ade32dfaf0abb08b9bda2e5
|
data/lib/flat_map/errors.rb
CHANGED
data/lib/flat_map/open_mapper.rb
CHANGED
@@ -55,13 +55,13 @@ module FlatMap
|
|
55
55
|
# @param [Object] target Target of mapping
|
56
56
|
# @param [*Symbol] traits List of traits
|
57
57
|
# @raise [FlatMap::Mapper::NoTargetError]
|
58
|
-
def initialize(target, *traits)
|
58
|
+
def initialize(target, *traits, &block)
|
59
59
|
raise NoTargetError.new(self.class) unless target
|
60
60
|
|
61
61
|
@target, @traits = target, traits
|
62
62
|
|
63
63
|
if block_given?
|
64
|
-
singleton_class.trait :extension, &
|
64
|
+
singleton_class.trait :extension, &block
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
data/lib/flat_map/version.rb
CHANGED
@@ -35,10 +35,10 @@ module FlatMap
|
|
35
35
|
with({:attr_a => :attr_a, :mapped_attr_b => :attr_b}, {:writer => false}).
|
36
36
|
and_call_original
|
37
37
|
expect(Mapping::Factory).to receive(:new).
|
38
|
-
with(:attr_a, :attr_a, :writer => false).
|
38
|
+
with(:attr_a, :attr_a, { :writer => false }).
|
39
39
|
and_call_original
|
40
40
|
expect(Mapping::Factory).to receive(:new).
|
41
|
-
with(:mapped_attr_b, :attr_b, :writer => false).
|
41
|
+
with(:mapped_attr_b, :attr_b, { :writer => false }).
|
42
42
|
and_call_original
|
43
43
|
|
44
44
|
MappingSpec::EmptyMapper.class_eval do
|
@@ -76,7 +76,7 @@ module FlatMap
|
|
76
76
|
context 'defining mountings' do
|
77
77
|
it "should use Factory for defining mappings" do
|
78
78
|
expect(Mapper::Factory).to receive(:new).
|
79
|
-
with(:foo, :mapper_class_name => 'FooMapper').
|
79
|
+
with(:foo, { :mapper_class_name => 'FooMapper' }).
|
80
80
|
and_call_original
|
81
81
|
|
82
82
|
expect{ MountingSpec::EmptyMapper.mount(:foo, :mapper_class_name => 'FooMapper') }.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: HornsAndHooves-flat_map
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HornsAndHooves
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2024-01-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
210
|
+
rubygems_version: 3.1.6
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Deep object graph to a plain properties mapper
|