luban-monit 0.1.5 → 0.1.6

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: 45a1782fbbe1128e06199d5c622f6f697184d28a
4
- data.tar.gz: c099c8d324fb02d94535036ddf08cd9bd92cd998
3
+ metadata.gz: 528e39a60a87cf41762668340bc94a5ffca4c0b2
4
+ data.tar.gz: a6d998bf1b4d944390087db2e05b36c3b755a24b
5
5
  SHA512:
6
- metadata.gz: 5b0cca1f506891b1c7bb7ea995cbb7b281d8e67c8eecc83356f04136c20031d59d5a9c80afde21bd06a98f9c9556c3381acbb71980b53e05fccee94d396242e5
7
- data.tar.gz: b17a604e240e04d8e2ecd9bf9c8c9b5260059306dade31d1e3176d081e1863386047765c6c02d32a18983fa5d4bfa2e972687dda0c1c02bb3c9fd68b4d7f5d19
6
+ metadata.gz: d5a5ef11d817a6a7f22b34ab57eb442827655fb1d2dbfd259868657328015d5fae095e8c8f28df90537a5ea40f8cf99aa1100aa65d18f436464cedeb4ee3ca23
7
+ data.tar.gz: d9934e991727e72c69be109c273e4f9832d815b14df2ff95cdffa18053d246811791244bfb4bb513ab94f4e4cf0c0322784a012b95a48faef1feb8ca73628b21
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.1.6 (Jun 16, 2016)
4
+
5
+ Minor enhancements:
6
+ * Refatored commands definitions for better reusability among service workers
7
+ * Simplified erb templates by removing header information like revision, environment, etc.
8
+ * Header info is generated by Luban (with a generic header template which could be customized if needed)
9
+
3
10
  ## Version 0.1.5 (Jun 08, 2016)
4
11
 
5
12
  Minor enhancements:
@@ -3,12 +3,24 @@ module Luban
3
3
  module Packages
4
4
  class Monit
5
5
  class Controller < Luban::Deployment::Service::Controller
6
- default_executable 'monit'
6
+ module Commands
7
+ def self.included(base)
8
+ base.define_executable 'monit'
9
+ end
7
10
 
8
- def monit_command
9
- @monit_command ||= "#{monit_executable}"
11
+ def monit_command
12
+ @monit_command ||= "#{monit_executable}"
13
+ end
14
+
15
+ alias_method :process_pattern, :monit_command
16
+ alias_method :start_command, :monit_command
17
+
18
+ def stop_command
19
+ @stop_command ||= "#{monit_command} quit"
20
+ end
10
21
  end
11
- alias_method :process_pattern, :monit_command
22
+
23
+ include Commands
12
24
 
13
25
  def process_stopped?
14
26
  super and check_process! =~ /the monit daemon is not running$/
@@ -36,14 +48,6 @@ module Luban
36
48
  capture("#{monit_command} -t 2>&1")
37
49
  end
38
50
 
39
- def start_process!
40
- capture("#{monit_command} 2>&1")
41
- end
42
-
43
- def stop_process!
44
- capture("#{monit_command} quit 2>&1")
45
- end
46
-
47
51
  def check_process!
48
52
  capture("#{monit_command} status 2>&1")
49
53
  end
@@ -59,4 +63,4 @@ module Luban
59
63
  end
60
64
  end
61
65
  end
62
- end
66
+ end
@@ -3,7 +3,7 @@ module Luban
3
3
  module Packages
4
4
  class Monit
5
5
  class Installer < Luban::Deployment::Service::Installer
6
- default_executable 'monit'
6
+ include Controller::Commands
7
7
 
8
8
  def source_repo
9
9
  @source_repo ||= "http://mmonit.com"
@@ -1,9 +1,5 @@
1
1
  # Monit logrotate configuration
2
2
 
3
- # Environment: <%= env_name %>
4
- # Revision: <%= revision %>
5
- # Created at <%= now %>
6
-
7
3
  <%= log_file_path %> {
8
4
  daily
9
5
  missingok
@@ -1,9 +1,5 @@
1
1
  # Monit control file
2
2
 
3
- # Environment: <%= env_name %>
4
- # Revision: <%= revision %>
5
- # Created at <%= now %>
6
-
7
3
  set daemon 15 # Poll cycle length in seconds
8
4
 
9
5
  set pidfile <%= pid_file_path %>
@@ -2,7 +2,7 @@ module Luban
2
2
  module Deployment
3
3
  module Packages
4
4
  class Monit
5
- VERSION = '0.1.5'
5
+ VERSION = '0.1.6'
6
6
  end
7
7
  end
8
8
  end
@@ -1,6 +1,6 @@
1
1
  require 'luban'
2
2
  require_relative 'monit/base'
3
- require_relative 'monit/configurator'
4
3
  require_relative 'monit/controller'
4
+ require_relative 'monit/configurator'
5
5
  require_relative 'monit/installer'
6
6
  require_relative 'monit/version'
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.5
4
+ version: 0.1.6
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-08 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban