praxis-mapper 4.1.1 → 4.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d6680ca8a7a141d49b78517c33a45305cba5ac1
4
- data.tar.gz: c9fe79656d4ae8d65b00d91a8aa1f31f8c43c264
3
+ metadata.gz: 5a54434e8e0f9299b8ae645f800e93ebbc1b0fae
4
+ data.tar.gz: 78806cff2fdeda7b7375f8ccc1a68f26addddbfb
5
5
  SHA512:
6
- metadata.gz: b194a3a75bc1a36cb1d62b977ba63fef76c968c1c2927b6c2e2404925a89a82a49defd02d355b8e0578fc5f6126d3602cb9339d840d69ad3e31e19831f1e1031
7
- data.tar.gz: 0c7f61c1b671de5ed918c3e2591b2dbdd1bfd6867353a88fc66784e4e347d9b3fc94b3698b5f3a46a003f00c8e64283429a4bc3be9025ba0732c7ee79353319c
6
+ metadata.gz: 668be9af356c5099402fdcfb46533004c5a3cc629085235417e73bdd8688ca061c1c440686aabd515fbe05f82a7acb879770f43037fb6ee9955caf7620d8ed11
7
+ data.tar.gz: 96effa292125c2d3f3ce5d20eba3f338cf7ef0c4d8c7486c62054626e4840162080a9975942d8fef5989fd19065c4a060c97397b7bcaaf404c606a3f50f65601
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
+ sudo: false
2
3
  rvm:
3
4
  - 2.1.2
4
5
  - 2.2.2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## next
4
4
 
5
+ ## 4.1.2
6
+
7
+ * Remove finalizer from IdentityMap to fix memory leak that was preventing them from being GC'd properly.
8
+
9
+
5
10
  ## 4.1.1
6
11
 
7
12
  * Fixed critical bug in `IdentityMap#finalize!`=
@@ -39,7 +39,7 @@ module Praxis::Mapper
39
39
 
40
40
  def release(connection_manager, connection)
41
41
  # ensure we only release connections we own, in case
42
- # we've acquired a connection from Sequel that
42
+ # we've acquired a connection from Sequel that
43
43
  # is likely still in use.
44
44
  if (@owned_connections.delete(connection_manager.thread))
45
45
  @connection.pool.send(:sync) do
@@ -50,9 +50,9 @@ module Praxis::Mapper
50
50
 
51
51
  def acquire(thread)
52
52
  # check connection's pool to see if it already has a connection
53
- # if so, re-use it. otherwise, acquire a new one and mark that we
53
+ # if so, re-use it. otherwise, acquire a new one and mark that we
54
54
  # "own" it for future releasing.
55
- if (owned = @connection.pool.send(:owned_connection, thread))
55
+ if @connection.pool.send(:owned_connection, thread)
56
56
  return true
57
57
  else
58
58
  conn = @connection.pool.send(:acquire, thread)
@@ -17,7 +17,7 @@ module Praxis::Mapper
17
17
 
18
18
  query = data[:query] || Praxis::Mapper::Query::Sql
19
19
  factory_class = data[:factory] || ConnectionFactories::Simple
20
-
20
+
21
21
  opts = data[:opts] || {}
22
22
  if query.kind_of? String
23
23
  query = query.constantize
@@ -26,14 +26,14 @@ module Praxis::Mapper
26
26
  if factory_class.kind_of? String
27
27
  factory_class = factory_class.constantize
28
28
  end
29
-
29
+
30
30
  repositories[repository_name] = {
31
31
  query: query,
32
32
  factory: factory_class.new(**opts, &block)
33
33
  }
34
34
  end
35
35
 
36
-
36
+
37
37
  def repositories
38
38
  self.class.repositories
39
39
  end
@@ -73,7 +73,7 @@ module Praxis::Mapper
73
73
  release_one(name)
74
74
  else
75
75
  names = @connections.keys
76
- names.each { |name| release_one(name) }
76
+ names.each { |n| release_one(n) }
77
77
  end
78
78
  end
79
79
 
@@ -70,11 +70,6 @@ module Praxis::Mapper
70
70
  @connection_manager = ConnectionManager.new
71
71
  @scope = scope
72
72
  clear!
73
-
74
- # Ensure we clean up open connections
75
- ObjectSpace.define_finalizer(self) do
76
- @connection_manager.release
77
- end
78
73
  end
79
74
 
80
75
  def clear!
@@ -1,5 +1,5 @@
1
1
  module Praxis
2
2
  module Mapper
3
- VERSION = "4.1.1"
3
+ VERSION = "4.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: praxis-mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep M. Blanquer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-21 00:00:00.000000000 Z
12
+ date: 2015-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: randexp