luban-monit 0.2.3 → 0.2.4

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: f4ff6bf96ef011c09c671981ce035af92ea35956
4
- data.tar.gz: 19f86daa270dbcb17215d7de1ee22f4a2eb8056f
3
+ metadata.gz: 68468611008e497bc3344da2a782a7f19f7b7ccd
4
+ data.tar.gz: 5a6f8e646155111209249abc12f025862f48d1fa
5
5
  SHA512:
6
- metadata.gz: 7cd947baf88fa2336f2774c156e1e6a82b43419bf4e15a8cb3bb8e6b4d954e05a21c81ffe88c1127adb3520380fdc27b4d5cefdb73f852637f79a680c676b4a9
7
- data.tar.gz: 2bbf8bbf23902668c865b8c11eb530ee98411900f2b36bc84a7edada5ceeab8c5ba7e43a30d59b348128ece4353fc252f93ddffd16220ba70c882dc40788ef25
6
+ metadata.gz: 8fd3eb1682b2d6af4d465568a01d2677214a8366f0075afe4c0889ef203681388667d06846d6741624e3ca03805a1fad5605e9610383eb74d2bcb79d28d4d4bb
7
+ data.tar.gz: 091e3e7171a422788b5746519a10c78a98efee3a5d66c31b5d0f2ff8804cd1fcfb9ca0d2c99a1cb8a55081cd03c239eb37db2e57c89cafba0a63a7c046da38d9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.2.4 (Sept 21, 2016)
4
+
5
+ Minor enhancements:
6
+ * Explicitly specified the Monit control file path instead of the default one
7
+ * Minor code cleanup
8
+
3
9
  ## Version 0.2.3 (Sept 19, 2016)
4
10
 
5
11
  New features:
@@ -3,10 +3,6 @@ module Luban
3
3
  module Packages
4
4
  class Monit
5
5
  class Configurator < Luban::Deployment::Service::Configurator
6
- def control_file_name
7
- @control_file_name ||= 'monitrc'
8
- end
9
-
10
6
  def state_file_path
11
7
  @state_file_path ||= pids_path.join(state_file_name)
12
8
  end
@@ -5,16 +5,24 @@ module Luban
5
5
  class Controller < Luban::Deployment::Service::Controller
6
6
  module Commands
7
7
  module Public
8
+ def monitor_control_file_name
9
+ @monitor_control_file_name ||= 'monitrc'
10
+ end
11
+
12
+ def monit_command
13
+ @monit_command ||= "#{monitor_executable} -c #{monitor_control_file_path}"
14
+ end
15
+
8
16
  def monitor_command(service_entry)
9
- @monitor_command ||= shell_command("#{monitor_executable} monitor #{service_entry}")
17
+ @monitor_command ||= shell_command("#{monit_command} monitor #{service_entry}")
10
18
  end
11
19
 
12
20
  def unmonitor_command(service_entry)
13
- @unmonitor_command ||= shell_command("#{monitor_executable} unmonitor #{service_entry}")
21
+ @unmonitor_command ||= shell_command("#{monit_command} unmonitor #{service_entry}")
14
22
  end
15
23
 
16
24
  def reload_monitor_command
17
- @reload_monitor_command ||= shell_command("#{monitor_executable} reload")
25
+ @reload_monitor_command ||= shell_command("#{monit_command} reload")
18
26
  end
19
27
  end
20
28
 
@@ -24,11 +32,6 @@ module Luban
24
32
  base.define_executable 'monit'
25
33
  end
26
34
 
27
- def monit_command
28
- @monit_command ||= "#{monit_executable}"
29
- end
30
- alias_method :monitor_executable, :monit_command
31
-
32
35
  def process_pattern
33
36
  @process_pattern ||= "^#{monit_command}"
34
37
  end
@@ -44,6 +47,10 @@ module Luban
44
47
 
45
48
  include Commands
46
49
 
50
+ alias_method :monitor_executable, :monit_executable
51
+ alias_method :monitor_control_file_path, :control_file_path
52
+ alias_method :control_file_name, :monitor_control_file_name
53
+
47
54
  def process_stopped?
48
55
  super and check_process! =~ /the monit daemon is not running$/
49
56
  end
@@ -2,7 +2,7 @@ module Luban
2
2
  module Deployment
3
3
  module Packages
4
4
  class Monit
5
- VERSION = '0.2.3'
5
+ VERSION = '0.2.4'
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.2.3
4
+ version: 0.2.4
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-09-20 00:00:00.000000000 Z
11
+ date: 2016-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban