luban-rack 0.2.6 → 0.2.7

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: e4dbb78382653dc3a7bd7810fd9a229f56c1ee88
4
- data.tar.gz: 8c13742326db0c9346587c867a1914f2d9ccafc7
3
+ metadata.gz: 932f2f5f02ca6ef79258c826163e2f3046b5e317
4
+ data.tar.gz: f2977360ca06c07a6aebeaea3dbb57ec9f5f15f8
5
5
  SHA512:
6
- metadata.gz: 6130e86d0ec042a4345e8f0d96f17e1430c1287dd6345e0b28538a4c58e73c8c8e9d38450ad67b4a3c8e9a3d1e34e935224c1e33279c0fa7bc97e143e471381b
7
- data.tar.gz: 26f6b502fa09122af638e19c47389e36b15168311a389474d7ca2104fd9dd280208785a3628a6d5c0a6a5c851c860eee215e3f896088d54788f5c7de94a7ab74
6
+ metadata.gz: e89dce255a7e42e197bd0e9ed40d199e3ba8a77288e8881500d9700ade058cfe779b01ef9265118675b8129afcff936783992a5dce380d96ef208a229d96d990
7
+ data.tar.gz: 8c95e6aa2392e690088e5fab41cbbf7446a51c2057d429db3d6d2b20b0ea0b233c5d839262b8ffefe16239dd450a30216e9243733e620e35b21acdf15b29d058
data/CHANGELOG.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.2.7 (Sept 19, 2016)
4
+
5
+ Minor enhancements:
6
+ * Refactored the way of composing shell commands
7
+ * As a result, bumped up the gem dependency on Luban to version 0.8.0
8
+
3
9
  ## Version 0.2.6 (Sept 04, 2016)
4
10
 
5
11
  Bug fixes:
6
12
  * Overloaded #shell_command_prefix method in all worker classes
7
- *
13
+ * Minor bug fixes
8
14
 
9
15
  ## Version 0.2.5 (Sept 01, 2016)
10
16
 
@@ -4,13 +4,6 @@ module Luban
4
4
  class Rack < Luban::Deployment::Application
5
5
  using Luban::CLI::CoreRefinements
6
6
 
7
- module Common
8
- def shell_command_prefix
9
- @shell_command_prefix ||=
10
- has_gemfile? ? (super << "#{bundle_executable} exec") : super
11
- end
12
- end
13
-
14
7
  module Parameters
15
8
  extend Luban::Deployment::Parameters::Base
16
9
 
@@ -3,7 +3,6 @@ module Luban
3
3
  module Applications
4
4
  class Rack
5
5
  class Configurator < Luban::Deployment::Application::Configurator
6
- include Common
7
6
  include Paths
8
7
  include Parameters
9
8
  include WebServer
@@ -3,7 +3,6 @@ module Luban
3
3
  module Applications
4
4
  class Rack
5
5
  class Controller < Luban::Deployment::Application::Controller
6
- include Common
7
6
  include Paths
8
7
  include Parameters
9
8
  include WebServer
@@ -38,13 +37,8 @@ module Luban
38
37
  set_web_server_options
39
38
  end
40
39
 
41
- def restart_process!
42
- capture(compose_command(restart_command))
43
- end
44
-
45
- def phased_restart_process!
46
- capture(compose_command(phased_restart_command))
47
- end
40
+ def restart_process!; capture(restart_command); end
41
+ def phased_restart_process!; capture(phased_restart_command); end
48
42
  end
49
43
  end
50
44
  end
@@ -3,8 +3,6 @@ module Luban
3
3
  module Applications
4
4
  class Rack
5
5
  class Publisher < Luban::Deployment::Application::Publisher
6
- include Common
7
-
8
6
  protected
9
7
 
10
8
  def init
@@ -4,8 +4,8 @@
4
4
  check process <%= service_entry %>
5
5
  with pidfile <%= pid_file_path %>
6
6
  onreboot laststate
7
- start program = "/bin/bash -c 'sleep 1; <%= compose_command(start_command) %>'"
8
- stop program = "/bin/bash -c '<%= compose_command(stop_command) %>'"
7
+ start program = "/bin/bash -c 'sleep 1; <%= start_command %>'"
8
+ stop program = "/bin/bash -c '<%= stop_command %>'"
9
9
  if totalmem is greater than 150.0 MB for 40 cycles then alert
10
10
  <%- if tcp_socket? -%>
11
11
  if failed port <%= opts[:port] %> for 4 times within 8 cycles then restart
@@ -6,8 +6,8 @@ check process <%= service_entry %>.<%= current_web_server %>.<%= n %>
6
6
  with pidfile <%= pid_file_path(n) %>
7
7
  group <%= service_entry %>
8
8
  onreboot laststate
9
- start program = "/bin/bash -c 'sleep 1; <%= compose_command(start_command) %> -o <%=n %>'"
10
- stop program = "/bin/bash -c '<%= compose_command(stop_command) %> -o <%=n %>'"
9
+ start program = "/bin/bash -c 'sleep 1; <%= start_command %> -o <%=n %>'"
10
+ stop program = "/bin/bash -c '<%= stop_command %> -o <%=n %>'"
11
11
  if totalmem is greater than 150.0 MB for 40 cycles then alert
12
12
  <%- if tcp_socket? -%>
13
13
  if failed port <%= opts[:port] + n %> for 4 times within 8 cycles then restart
@@ -2,7 +2,7 @@ module Luban
2
2
  module Deployment
3
3
  module Applications
4
4
  class Rack
5
- VERSION = '0.2.6'
5
+ VERSION = '0.2.7'
6
6
  end
7
7
  end
8
8
  end
@@ -5,7 +5,7 @@ module Luban
5
5
  module WebServers
6
6
  module Puma
7
7
  module Common
8
- def default_web_server_options
8
+ def default_web_server_options
9
9
  @default_web_server_options ||= {
10
10
  # Server options
11
11
  address: "0.0.0.0",
@@ -61,11 +61,11 @@ module Luban
61
61
  end
62
62
 
63
63
  def start_command
64
- @start_command ||= "#{puma_command} start"
64
+ @start_command ||= bundle_command("#{puma_command} start")
65
65
  end
66
66
 
67
67
  def stop_command
68
- @stop_command ||= "#{puma_command} stop"
68
+ @stop_command ||= bundle_command("#{puma_command} stop")
69
69
  end
70
70
 
71
71
  def process_pattern
@@ -143,11 +143,11 @@ module Luban
143
143
  include Common
144
144
 
145
145
  def restart_command
146
- @restart_command ||= "#{puma_command} restart"
146
+ @restart_command ||= bundle_command("#{puma_command} restart")
147
147
  end
148
148
 
149
149
  def phased_restart_command
150
- @phased_restart_command ||= "#{puma_command} phased-restart"
150
+ @phased_restart_command ||= bundle_command("#{puma_command} phased-restart")
151
151
  end
152
152
  end
153
153
  end
@@ -118,11 +118,11 @@ module Luban
118
118
  end
119
119
 
120
120
  def start_command
121
- @start_command ||= "#{thin_command} start"
121
+ @start_command ||= bundle_command("#{thin_command} start")
122
122
  end
123
123
 
124
124
  def stop_command
125
- @stop_command ||= "#{thin_command} stop"
125
+ @stop_command ||= bundle_command("#{thin_command} stop")
126
126
  end
127
127
 
128
128
  def process_pattern
@@ -148,11 +148,11 @@ module Luban
148
148
  include Common
149
149
 
150
150
  def restart_command
151
- @restart_command ||= "#{thin_command} restart"
151
+ @restart_command ||= bundle_command("#{thin_command} restart")
152
152
  end
153
153
 
154
154
  def phased_restart_command
155
- @phased_restart_command ||= "#{thin_command} restart --onebyone"
155
+ @phased_restart_command ||= bundle_command("#{thin_command} restart --onebyone")
156
156
  end
157
157
  end
158
158
  end
data/luban-rack.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.required_ruby_version = ">= 2.1.0"
23
- spec.add_dependency 'luban', ">= 0.7.11"
23
+ spec.add_dependency 'luban', ">= 0.8.0"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.12"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
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-04 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.11
19
+ version: 0.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.11
26
+ version: 0.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement