smart_proxy_dynflow 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.
Potentially problematic release.
This version of smart_proxy_dynflow might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGJjM2Q5NTZhNzA3YTViZDVlYzA1NjJmOGY4ZTJiYmU3Y2Q2MzE3Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzI0Mzk3OWE4NTY1YmFhNzg2OGUxMjNkZDM5ZDQ5Yjk5ZWZjOWVjYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTQ3M2YyNDc1YWMwNmMyNWQ3YzJjMWRhY2Y4ZGVjZTNjZTE3NDAxOWJjMTE4
|
10
|
+
MjMxNjUyYjllYjE5ZGRiNTQzODVlMjFkNTZkMmU0ODA0ZmY2ZTE1MDZmMzQ0
|
11
|
+
ZTdjOTkwMGU0YjNmNmRlZGJkYjJmODgwZmY0YTE3N2Q0MjMzYmQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzhhZTZhZjBkZTUwNDAzYWJmNzg4OTQxMzJlNmEwZWU5NGQzYzVmZDgyOTQz
|
14
|
+
MDY5NTAyNzE1ZWM4NTFhYTA2NGE3ODhmNTAwOWVmODdjNTI4MWM0YTUyZDQ1
|
15
|
+
YWI3MzViZDdmNWRhNThkZTU4YzFkOTQ4MmIwM2IxYTRmZDUxZGY=
|
data/lib/smart_proxy_dynflow.rb
CHANGED
@@ -38,26 +38,42 @@ class Proxy::Dynflow
|
|
38
38
|
::Dynflow::LoggerAdapters::Simple.new $stderr, 0
|
39
39
|
end
|
40
40
|
|
41
|
-
def web_console
|
42
|
-
require 'dynflow/web'
|
43
|
-
world = @world
|
44
|
-
dynflow_console = ::Dynflow::Web.setup do
|
45
|
-
set :world, world
|
46
|
-
end
|
47
|
-
dynflow_console
|
48
|
-
end
|
49
|
-
|
50
41
|
class << self
|
51
42
|
attr_reader :instance
|
52
43
|
|
53
|
-
def
|
44
|
+
def ensure_initialized
|
45
|
+
return @instance if @instance
|
54
46
|
@instance = Proxy::Dynflow.new
|
47
|
+
after_initialize_blocks.each(&:call)
|
48
|
+
@instance
|
49
|
+
end
|
50
|
+
|
51
|
+
def web_console
|
52
|
+
require 'dynflow/web'
|
53
|
+
dynflow_console = ::Dynflow::Web.setup do
|
54
|
+
# we can't use the proxy's after_actionvation hook, as
|
55
|
+
# it happens before the Daemon forks the process (including
|
56
|
+
# closing opened file descriptors)
|
57
|
+
# TODO: extend smart proxy to enable hooks that happen after
|
58
|
+
# the forking
|
59
|
+
Proxy::Dynflow.ensure_initialized
|
60
|
+
set :world, Proxy::Dynflow.world
|
61
|
+
end
|
62
|
+
dynflow_console
|
55
63
|
end
|
56
64
|
|
57
65
|
def world
|
58
66
|
instance.world
|
59
67
|
end
|
68
|
+
|
69
|
+
def after_initialize(&block)
|
70
|
+
after_initialize_blocks << block
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
def after_initialize_blocks
|
76
|
+
@after_initialize_blocks ||= []
|
77
|
+
end
|
60
78
|
end
|
61
79
|
end
|
62
|
-
|
63
|
-
Proxy::Dynflow.initialize
|