xlogin 0.7.2 → 0.7.3

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: e52a4f4381c261ea82398f6a6d149b4fd13dd5b7
4
- data.tar.gz: f917f99d366e5987dd64927864e4e19b62bbad54
3
+ metadata.gz: a5cfe6927727ca416ba5c1b527795c24d516c80e
4
+ data.tar.gz: 96294d431b6ec3ed04e1219bb43846be2c16d813
5
5
  SHA512:
6
- metadata.gz: ab506f21664b25a45e6af2495ae0086d1b6ec0f13e55470e1464af88abc8813708ed5d0dcb87f1c3876ba59fadd73990c4955ccff25a6e4c5348fe21a61d62a4
7
- data.tar.gz: bbb5fc16a1935524cf241994926878480fc97e166215cb25c403f96eb1fed3dc06908f9f100b74596d343b78f0510db7a27ebe23b9b01d0d609dde5f68ddf98a
6
+ metadata.gz: 19d258f8167de5aec319e4536b7fef47f3a0a2d07c581e6dbb6d3c93f1bb399bbc2eb770716504375c9b7d34fbd6d9afb063234dbe2f558541811251c5054d4d
7
+ data.tar.gz: 479ec3d06545d72d691b8b69d85f47d356fd77e6631a77959ef7cfd11343cdc79c919ba1f59ed87a6f703965b04cc1bc92c1b127bdc7a2a2adc96f99e33bac55
@@ -9,7 +9,6 @@ module Xlogin
9
9
  def initialize
10
10
  @database = Hash.new
11
11
  @templates = Hash.new
12
- @pools = Hash.new
13
12
  @group = nil
14
13
  end
15
14
 
@@ -59,23 +58,6 @@ module Xlogin
59
58
  @templates.keys
60
59
  end
61
60
 
62
- def set_pool(args, **opts)
63
- name = case args
64
- when String then args
65
- when Hash then URI(args[:uri]).host
66
- end
67
-
68
- @pools[name] = SessionPool.new(args, **opts)
69
- end
70
-
71
- def get_pool(name)
72
- @pools[name]
73
- end
74
-
75
- def list_pools
76
- @pools.keys
77
- end
78
-
79
61
  def group(group_name)
80
62
  current_group = @group
81
63
  @group = [current_group, group_name.to_s].compact.join(':')
@@ -168,14 +168,14 @@ module Xlogin
168
168
  end
169
169
 
170
170
  class SessionPool
171
+
171
172
  def initialize(args, **opts)
172
173
  temp = case args
173
- when Hash then args
174
- when String then opts
174
+ when String then opts.select { |k, v| %i(size timeout).member?(k) && !v.nil? }
175
+ when Hash then args.select { |k, v| %i(size timeout).member?(k) && !v.nil? }
175
176
  end
176
177
 
177
- @opts = temp.select { |k, v| %i(size timeout).member?(k) && !v.nil? }
178
- @pool = ConnectionPool.new(**@opts) { Wrapper.new(args, **opts) }
178
+ @pool = ConnectionPool.new(**temp) { Wrapper.new(args, **opts) }
179
179
  end
180
180
 
181
181
  def with(**opts)
@@ -209,5 +209,6 @@ module Xlogin
209
209
  @session.send(name, *args, &block)
210
210
  end
211
211
  end
212
+
212
213
  end
213
214
  end
@@ -1,3 +1,3 @@
1
1
  module Xlogin
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
data/lib/xlogin.rb CHANGED
@@ -30,7 +30,7 @@ module Xlogin
30
30
  end
31
31
 
32
32
  def get_pool(args, **opts, &block)
33
- pool = factory.set_template(args, **opts)
33
+ pool = ConnectionPool.new(args, **opts)
34
34
 
35
35
  return pool unless block
36
36
  block.call(pool)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlogin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - haccht