luban-monit 0.1.4 → 0.1.5

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: 165a9d12131d359b2353e195b3aac485e0859c78
4
- data.tar.gz: 005aaa6659ef4df89a21170ce92a0b11c46ce09f
3
+ metadata.gz: 45a1782fbbe1128e06199d5c622f6f697184d28a
4
+ data.tar.gz: c099c8d324fb02d94535036ddf08cd9bd92cd998
5
5
  SHA512:
6
- metadata.gz: e0f245fce78458ae4b3b515cd62d5af395356ba9b7c8386fe1976222a6926154d9511a1be56aa9ee7aa2a43f46fe5cd2f002421a836e6bf1c6e1d3b9ba47f500
7
- data.tar.gz: 15976741e6214481642ee755eeeaf960a5aad791b8fb8547e4cba0c6a8b1ef616db1865434c5c21e41f1cdc97efa3086466bd91428da31b9f27712f1eeaaeb7a
6
+ metadata.gz: 5b0cca1f506891b1c7bb7ea995cbb7b281d8e67c8eecc83356f04136c20031d59d5a9c80afde21bd06a98f9c9556c3381acbb71980b53e05fccee94d396242e5
7
+ data.tar.gz: b17a604e240e04d8e2ecd9bf9c8c9b5260059306dade31d1e3176d081e1863386047765c6c02d32a18983fa5d4bfa2e972687dda0c1c02bb3c9fd68b4d7f5d19
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.1.5 (Jun 08, 2016)
4
+
5
+ Minor enhancements:
6
+ * Suport for Monit 5.18
7
+ * Added a new subcommand, #match, to do process matching based on given regular expression
8
+
3
9
  ## Version 0.1.4 (Jun 07, 2016)
4
10
 
5
11
  Minor enhancements:
@@ -12,8 +12,9 @@ module Luban
12
12
  @default_templates_path ||= Pathname.new(File.join(File.dirname(__FILE__), 'templates')).realpath
13
13
  end
14
14
 
15
- service_action :config_test, dispatch_to: :controller
16
- service_action :reload_process, dispatch_to: :controller
15
+ %i(config_test reload_process match_process).each do |action|
16
+ service_action action, dispatch_to: :controller
17
+ end
17
18
 
18
19
  protected
19
20
 
@@ -34,6 +35,12 @@ module Luban
34
35
  desc "Reload process"
35
36
  action! :reload_process
36
37
  end
38
+
39
+ task :match do
40
+ desc "Match process"
41
+ argument :pattern, "Regex for process match"
42
+ action! :match_process
43
+ end
37
44
  end
38
45
  end
39
46
  end
@@ -15,7 +15,7 @@ module Luban
15
15
  end
16
16
 
17
17
  def process_started?
18
- super and check_process! =~ /^The Monit daemon #{package_major_version} uptime:/
18
+ super and check_process! =~ /^The Monit daemon #{package_major_version} uptime:|^Monit uptime:/
19
19
  end
20
20
 
21
21
  def config_test
@@ -26,6 +26,10 @@ module Luban
26
26
  update_result reload_process!
27
27
  end
28
28
 
29
+ def match_process
30
+ update_result match_process!
31
+ end
32
+
29
33
  protected
30
34
 
31
35
  def config_test!
@@ -47,6 +51,10 @@ module Luban
47
51
  def reload_process!
48
52
  capture("#{monit_command} reload 2>&1")
49
53
  end
54
+
55
+ def match_process!
56
+ capture("#{monit_command} procmatch #{task.args.pattern} 2>&1")
57
+ end
50
58
  end
51
59
  end
52
60
  end
@@ -2,7 +2,7 @@ module Luban
2
2
  module Deployment
3
3
  module Packages
4
4
  class Monit
5
- VERSION = '0.1.4'
5
+ VERSION = '0.1.5'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban-monit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Chi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban