ree_lib 1.0.99 → 1.0.101

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
2
  SHA256:
3
- metadata.gz: c38ef2b4a8178ef5e2f9121bc05c4758e73a441878ca88191b7c14da82f204ed
4
- data.tar.gz: 67f4d77cbe85db2de4cc2bd939444166d1a32d568fe9ec2ab164f976c35a079d
3
+ metadata.gz: d1d87d5cb2c9730ec270732d8a4fab58e5b2d2ebd0aca6f5b075c151301a91bf
4
+ data.tar.gz: 219ad2e3f9543a507985d813c218be53f332e740b376d429f20ce0d68806d75c
5
5
  SHA512:
6
- metadata.gz: b579b5d1208625e01e8dc5fcfc354e5a18399bb8121339f4ffda0d049371e0118c60185a6ca974b92cac5a0f4910666d3cec163e85f4d464f39ff300f03295ea
7
- data.tar.gz: 5667a2a347f98ac1dd903dd63d08a78f688c93419ac3661ab0edd0bdb355edf27e8d31d4c44a814f0be232ac4b60865b3bd1fb4cd73db99d91a3d924cf7a7a23
6
+ metadata.gz: 811e76e202564fe0f001c1798bdc6ba91a080581a5c6c16d010e979d227f27298c193d643c3c4ba2553936c39862373dff7153dd8c6639e744a07ca88fed52c3
7
+ data.tar.gz: 21048d71c59f71efc205d77ae89fcd85c8414ae3fa230a318cb8152fe4c85c28434f13072475d684e7550cf67a6f0b94fdfcdd2b2f614ff89e8c90d1a3efbda9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.0.99)
4
+ ree_lib (1.0.101)
5
5
  bigdecimal (~> 3.1.6)
6
6
  binding_of_caller (~> 1.0.0)
7
7
  i18n (~> 1.14.1)
@@ -4,7 +4,6 @@ class ReeMapper::BuildMapperFactory
4
4
  include Ree::FnDSL
5
5
 
6
6
  fn :build_mapper_factory do
7
- with_caller
8
7
  link 'ree_mapper/mapper', -> { Mapper }
9
8
  link 'ree_mapper/mapper_factory', -> { MapperFactory }
10
9
  link 'ree_mapper/mapper_strategy', -> { MapperStrategy }
@@ -12,11 +11,7 @@ class ReeMapper::BuildMapperFactory
12
11
 
13
12
  contract(ArrayOf[MapperStrategy] => SubclassOf[MapperFactory])
14
13
  def call(strategies:)
15
- module_name = get_caller.class.to_s.split("::").first
16
- mod = Object.const_get(module_name)
17
-
18
14
  klass = Class.new(ReeMapper::MapperFactory)
19
- mod.instance_variable_set(:@mapper_factory, klass)
20
15
 
21
16
  klass.instance_eval {
22
17
  @types = {}
@@ -67,7 +67,16 @@ module ReeMapper
67
67
  factory = mod.instance_variable_get(:@mapper_factory)
68
68
  return factory if factory
69
69
 
70
- self.build_mapper_factory(mod)
70
+ if !mod.instance_variable_get(:@mapper_semaphore)
71
+ mod.instance_variable_set(:@mapper_semaphore, Mutex.new)
72
+ end
73
+
74
+ mod.instance_variable_get(:@mapper_semaphore).synchronize do
75
+ factory = self.build_mapper_factory(mod)
76
+ mod.instance_variable_set(:@mapper_factory, factory)
77
+ end
78
+
79
+ factory
71
80
  end
72
81
 
73
82
  private
@@ -55,10 +55,10 @@ RSpec.describe ReeMapper::DSL do
55
55
  )
56
56
 
57
57
  expect(result).to eq({
58
- id: 1,
59
- title: 'Product',
60
- creator: {
61
- id: 1,
58
+ id: 1,
59
+ title: 'Product',
60
+ creator: {
61
+ id: 1,
62
62
  name: 'John',
63
63
  created_by: {
64
64
  id: 2,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.0.99"
4
+ VERSION = "1.0.101"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.99
4
+ version: 1.0.101
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov