liquid-ext 3.5.2 → 3.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -8
- data/lib/liquid/ext/shutdown.rb +37 -0
- data/lib/liquid/ext/signal.rb +3 -0
- data/liquid-ext.gemspec +7 -7
- metadata +31 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ac68bf0671d42bb26e445160230ebee64c9ea5c
|
4
|
+
data.tar.gz: aaea5630cdd8817b46b27ab1c1235a7b9e432f29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8307aa963d2fa29324480ea13aa73eb25bf4a7dc89b066f970acb7f1450b980732ac4c4611880915ce2bebb5f163fe75338fe91bfa85440a4eb065bbfaab4fa
|
7
|
+
data.tar.gz: 7eb3ac8ff45eb6596f228336ce21ef03559962845c5aec01b15764f212c2c5494399c1472338792e5cfbc4af90010468637ff81797dd9f2b03eafe0343f03e3e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
liquid-ext (3.5.
|
4
|
+
liquid-ext (3.5.3)
|
5
5
|
activesupport
|
6
6
|
erubis
|
7
7
|
jmx4r
|
@@ -12,14 +12,13 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: http://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (4.1.
|
15
|
+
activesupport (4.1.7)
|
16
16
|
i18n (~> 0.6, >= 0.6.9)
|
17
17
|
json (~> 1.7, >= 1.7.7)
|
18
18
|
minitest (~> 5.1)
|
19
19
|
thread_safe (~> 0.1)
|
20
20
|
tzinfo (~> 1.1)
|
21
21
|
awesome_print (1.2.0)
|
22
|
-
bond (0.5.1)
|
23
22
|
bond (0.5.1-java)
|
24
23
|
brice (0.2.9)
|
25
24
|
ruby-nuggets (>= 0.5.2)
|
@@ -56,15 +55,11 @@ GEM
|
|
56
55
|
yard
|
57
56
|
log_switch (0.4.0)
|
58
57
|
method_source (0.8.2)
|
59
|
-
minitest (5.4.
|
58
|
+
minitest (5.4.3)
|
60
59
|
mixlib-cli (1.5.0)
|
61
60
|
multi_json (1.10.1)
|
62
61
|
nokogiri (1.6.2.1-java)
|
63
62
|
parallel (1.0.0)
|
64
|
-
pry (0.9.12.6)
|
65
|
-
coderay (~> 1.0)
|
66
|
-
method_source (~> 0.8)
|
67
|
-
slop (~> 3.4)
|
68
63
|
pry (0.9.12.6-java)
|
69
64
|
coderay (~> 1.0)
|
70
65
|
method_source (~> 0.8)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Shutdown
|
2
|
+
|
3
|
+
# Receives a time span in seconds and a block which will be registered for execution when the program exits.
|
4
|
+
# If multiple hanlders are registered, they are executed in reverse order of registration.
|
5
|
+
#
|
6
|
+
# If a handler throws an exception or takes longer then the specified time span, execution skips to the next
|
7
|
+
# handler in line.
|
8
|
+
#
|
9
|
+
# If the first parameter is nil, the handler will not check the codes runtime. Be cautios when executing
|
10
|
+
# asynchronous code when the 'seconds' parameter set to nil value as blocking codes would prevent
|
11
|
+
# the process from terminating.
|
12
|
+
def self.register_handler_with_timeout(seconds, &block)
|
13
|
+
return unless block_given?
|
14
|
+
at_exit do
|
15
|
+
$log.info("shutdown", location: block.inspect) if $log
|
16
|
+
begin
|
17
|
+
Timeout::timeout(seconds, &block)
|
18
|
+
rescue => e
|
19
|
+
$log.exception e if $log
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
# Receives a block which will be registered for execution when the program exits.
|
26
|
+
# If multiple hanlders are registered, they are executed in reverse order of registration.
|
27
|
+
#
|
28
|
+
# with_handler will not check the execution duration of the given block so only
|
29
|
+
# use this for non_blocking code, use register_handler_with_timout if you make potentially
|
30
|
+
# blocking calls
|
31
|
+
def self.register_handler(&block)
|
32
|
+
return unless block_given?
|
33
|
+
self.register_handler_with_timeout(nil, &block)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
data/lib/liquid/ext/signal.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
module Signal
|
2
|
+
# be cautious with this shutdown handler as it does not
|
3
|
+
# guarantee execution of all handlers and swallows exceptions
|
4
|
+
# inside handlers. Use Shutdown.register_with_handler instead
|
2
5
|
def self.register_shutdown_handler(&block)
|
3
6
|
signals = %w(INT TERM)
|
4
7
|
|
data/liquid-ext.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'liquid-ext'
|
5
|
-
spec.version = '3.5.
|
5
|
+
spec.version = '3.5.3'
|
6
6
|
spec.authors = ['LiquidM, Inc.']
|
7
7
|
spec.email = ['opensource@liquidm.com']
|
8
8
|
spec.description = %q{LiquidM ruby core extensions and helper libraries}
|
@@ -15,10 +15,10 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
|
18
|
-
spec.add_dependency 'activesupport'
|
19
|
-
spec.add_dependency 'erubis'
|
20
|
-
spec.add_dependency 'jmx4r'
|
21
|
-
spec.add_dependency 'mixlib-cli'
|
22
|
-
spec.add_dependency 'multi_json'
|
23
|
-
spec.add_dependency 'terminal-table'
|
18
|
+
spec.add_dependency 'activesupport'
|
19
|
+
spec.add_dependency 'erubis'
|
20
|
+
spec.add_dependency 'jmx4r'
|
21
|
+
spec.add_dependency 'mixlib-cli'
|
22
|
+
spec.add_dependency 'multi_json'
|
23
|
+
spec.add_dependency 'terminal-table'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,99 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquid-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LiquidM, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
14
20
|
requirement: !ruby/object:Gem::Requirement
|
15
21
|
requirements:
|
16
|
-
- -
|
22
|
+
- - '>='
|
17
23
|
- !ruby/object:Gem::Version
|
18
24
|
version: '0'
|
19
|
-
name: activesupport
|
20
25
|
prerelease: false
|
21
26
|
type: :runtime
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: erubis
|
22
29
|
version_requirements: !ruby/object:Gem::Requirement
|
23
30
|
requirements:
|
24
|
-
- -
|
31
|
+
- - '>='
|
25
32
|
- !ruby/object:Gem::Version
|
26
33
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
29
35
|
requirements:
|
30
|
-
- -
|
36
|
+
- - '>='
|
31
37
|
- !ruby/object:Gem::Version
|
32
38
|
version: '0'
|
33
|
-
name: erubis
|
34
39
|
prerelease: false
|
35
40
|
type: :runtime
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: jmx4r
|
36
43
|
version_requirements: !ruby/object:Gem::Requirement
|
37
44
|
requirements:
|
38
|
-
- -
|
45
|
+
- - '>='
|
39
46
|
- !ruby/object:Gem::Version
|
40
47
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
48
|
requirement: !ruby/object:Gem::Requirement
|
43
49
|
requirements:
|
44
|
-
- -
|
50
|
+
- - '>='
|
45
51
|
- !ruby/object:Gem::Version
|
46
52
|
version: '0'
|
47
|
-
name: jmx4r
|
48
53
|
prerelease: false
|
49
54
|
type: :runtime
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mixlib-cli
|
50
57
|
version_requirements: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
62
|
requirement: !ruby/object:Gem::Requirement
|
57
63
|
requirements:
|
58
|
-
- -
|
64
|
+
- - '>='
|
59
65
|
- !ruby/object:Gem::Version
|
60
66
|
version: '0'
|
61
|
-
name: mixlib-cli
|
62
67
|
prerelease: false
|
63
68
|
type: :runtime
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: multi_json
|
64
71
|
version_requirements: !ruby/object:Gem::Requirement
|
65
72
|
requirements:
|
66
|
-
- -
|
73
|
+
- - '>='
|
67
74
|
- !ruby/object:Gem::Version
|
68
75
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
76
|
requirement: !ruby/object:Gem::Requirement
|
71
77
|
requirements:
|
72
|
-
- -
|
78
|
+
- - '>='
|
73
79
|
- !ruby/object:Gem::Version
|
74
80
|
version: '0'
|
75
|
-
name: multi_json
|
76
81
|
prerelease: false
|
77
82
|
type: :runtime
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: terminal-table
|
78
85
|
version_requirements: !ruby/object:Gem::Requirement
|
79
86
|
requirements:
|
80
|
-
- -
|
87
|
+
- - '>='
|
81
88
|
- !ruby/object:Gem::Version
|
82
89
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
90
|
requirement: !ruby/object:Gem::Requirement
|
85
91
|
requirements:
|
86
|
-
- -
|
92
|
+
- - '>='
|
87
93
|
- !ruby/object:Gem::Version
|
88
94
|
version: '0'
|
89
|
-
name: terminal-table
|
90
95
|
prerelease: false
|
91
96
|
type: :runtime
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ~>
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
97
|
description: LiquidM ruby core extensions and helper libraries
|
98
98
|
email:
|
99
99
|
- opensource@liquidm.com
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/liquid/ext/jmx4r.rb
|
134
134
|
- lib/liquid/ext/nil.rb
|
135
135
|
- lib/liquid/ext/ordered_set.rb
|
136
|
+
- lib/liquid/ext/shutdown.rb
|
136
137
|
- lib/liquid/ext/signal.rb
|
137
138
|
- lib/liquid/ext/socket.rb
|
138
139
|
- lib/liquid/ext/string.rb
|
@@ -212,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
213
|
version: '0'
|
213
214
|
requirements: []
|
214
215
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.
|
216
|
+
rubygems_version: 2.1.9
|
216
217
|
signing_key:
|
217
218
|
specification_version: 4
|
218
219
|
summary: A collection of common utilities used in various LiquidM projects
|