pub-sub 0.0.2 → 0.0.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 +4 -4
- data/lib/pub_sub/configuration.rb +45 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb908098d16458af3705fe055544e14da2f80f4a43fbcb599404589cc1b91403
|
4
|
+
data.tar.gz: 786dcf8e474e64f25ee9dc4eea3bf25987e7f196aaa6722a4b6f7bc7a25e3b6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de32890b8dfb6f2ea8519e9550d03df483d35cc9f3f0ad9b4dd03f3bfe66076abf83f6fbb64462574f9c4b101d5fdae349966fe9bc6358de0d161e65d045b649
|
7
|
+
data.tar.gz: f8aaa20ca1421c2ee8482d4a8ed7a9af33252f718929b5cead527d88bf8bc48888d3d931ea766d301b4a4cf985e26d35efa04436b95b5b61b4c93e5cec78c0d9
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'singleton'
|
3
|
+
|
4
|
+
require 'pub_sub/container'
|
5
|
+
require 'pub_sub/hash'
|
6
|
+
require 'pub_sub/publisher'
|
7
|
+
require 'pub_sub/subscriber'
|
8
|
+
|
9
|
+
module PubSub
|
10
|
+
class Configuration
|
11
|
+
private_class_method :new
|
12
|
+
attr_reader :container
|
13
|
+
|
14
|
+
@@singleton__instance = nil
|
15
|
+
@@singleton__mutex = Mutex.new
|
16
|
+
|
17
|
+
class << self
|
18
|
+
def init(container = ::PubSub::Hash)
|
19
|
+
this(container)
|
20
|
+
end
|
21
|
+
|
22
|
+
def this(container = ::PubSub::Hash)
|
23
|
+
return @@singleton__instance if @@singleton__instance
|
24
|
+
|
25
|
+
@@singleton__mutex.synchronize do
|
26
|
+
return @@singleton__instance if @@singleton__instance
|
27
|
+
|
28
|
+
@@singleton__instance = new(container)
|
29
|
+
end
|
30
|
+
@@singleton__instance
|
31
|
+
end
|
32
|
+
|
33
|
+
def container
|
34
|
+
this.container
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def initialize(container)
|
41
|
+
@container = container.new
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pub-sub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Saltykov
|
@@ -15,7 +15,8 @@ email:
|
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
|
-
files:
|
18
|
+
files:
|
19
|
+
- lib/pub_sub/configuration.rb
|
19
20
|
homepage: https://github.com/nucleom42/pub-sub
|
20
21
|
licenses:
|
21
22
|
- MIT
|