luban 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b5c23cf9c92a7106234e16b34d3ba5578f118cb
|
4
|
+
data.tar.gz: f29d25e7aeba87e5eb29380f531d924de2a17462
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36fe14118bc72ce657456638ca97f3083e59b6ec7814769a87eb6f771cac1f9222ccdab882a6ade9cdedf71271f32840e815cbe5c45d408faaceebc418325ddf
|
7
|
+
data.tar.gz: b6a547c3ce745235956c4c400ff9e1457152d3c2829f14d2628a480f99df41308d953fe8ec6397122cd8ebcf8b008a43a95f73f05ab2908dbbedc990aa2d4c2a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## Version 0.6.7 (Aug 02, 2016)
|
4
|
+
|
5
|
+
Minor enhancements:
|
6
|
+
* Added convenient class method #applcation_action
|
7
|
+
* Removed support for Cluster in Service::Controller
|
8
|
+
* Support for Cluster has been moved to Rack::Controller (luban-rack)
|
9
|
+
* Added exclude filter, #exclude_template?, for #profile_templates in Service::Configurator
|
10
|
+
* Facilitate template filtering during profile rendering
|
11
|
+
|
3
12
|
## Version 0.6.6 (Jul 27, 2016)
|
4
13
|
|
5
14
|
Bug fixes:
|
@@ -27,6 +27,20 @@ module Luban
|
|
27
27
|
end
|
28
28
|
protected action
|
29
29
|
end
|
30
|
+
|
31
|
+
def self.application_action(action, dispatch_to: nil, as: action, locally: false, &blk)
|
32
|
+
define_method(action) do |args:, opts:|
|
33
|
+
if current_app
|
34
|
+
send("#{__method__}!", args: args, opts: opts.merge(version: current_app))
|
35
|
+
else
|
36
|
+
abort "Aborted! No current version of #{display_name} is specified."
|
37
|
+
end
|
38
|
+
end
|
39
|
+
unless dispatch_to.nil?
|
40
|
+
dispatch_task "#{action}!", to: dispatch_to, as: as, locally: locally, &blk
|
41
|
+
protected "#{action}!"
|
42
|
+
end
|
43
|
+
end
|
30
44
|
|
31
45
|
def find_project; parent; end
|
32
46
|
def find_application(name = nil)
|
@@ -177,15 +191,7 @@ module Luban
|
|
177
191
|
send("application_#{action}", args: args, opts: opts) if has_source?
|
178
192
|
end
|
179
193
|
action_on_services "service_#{action}!", as: action
|
180
|
-
|
181
|
-
define_method("application_#{action}") do |args:, opts:|
|
182
|
-
if current_app
|
183
|
-
send("application_#{action}!", args: args, opts: opts.merge(version: current_app))
|
184
|
-
else
|
185
|
-
abort "Aborted! No current version of #{display_name} is specified."
|
186
|
-
end
|
187
|
-
end
|
188
|
-
dispatch_task "application_#{action}!", to: :controller, as: action
|
194
|
+
application_action "application_#{action}", dispatch_to: :controller, as: action
|
189
195
|
end
|
190
196
|
|
191
197
|
def init_profiles(args:, opts:)
|
@@ -24,9 +24,13 @@ module Luban
|
|
24
24
|
[profile_templates_path, stage_profile_templates_path].each do |path|
|
25
25
|
Dir.chdir(path) { @profile_templates |= Dir["**/*.#{format}"] } if path.directory?
|
26
26
|
end
|
27
|
-
@profile_templates
|
27
|
+
@profile_templates.tap do |templates|
|
28
|
+
templates.reject! { |t| exclude_template?(t) }
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
32
|
+
def exclude_template?(template); false; end
|
33
|
+
|
30
34
|
def default_templates; task.opts.default_templates; end
|
31
35
|
|
32
36
|
def init_profile
|
@@ -240,46 +240,7 @@ module Luban
|
|
240
240
|
test("#{reload_monitor_command} 2>&1")
|
241
241
|
end
|
242
242
|
end
|
243
|
-
|
244
|
-
module Cluster
|
245
|
-
def pid_file_pattern
|
246
|
-
raise NotImplementedError, "#{self.class.name}#pid_file_pattern is an abstract method."
|
247
|
-
end
|
248
|
-
|
249
|
-
def pid_files_path
|
250
|
-
pids_path.join(pid_file_pattern)
|
251
|
-
end
|
252
|
-
|
253
|
-
def pid_files
|
254
|
-
capture(:ls, "-A #{pid_files_path} 2>/dev/null").split.map do |f|
|
255
|
-
Pathname.new(f)
|
256
|
-
end
|
257
|
-
end
|
258
|
-
|
259
|
-
def pids
|
260
|
-
pid_files.collect { |pid_file| capture(:cat, "#{pid_file} 2>/dev/null") }
|
261
|
-
end
|
262
|
-
|
263
|
-
def pid; pids; end
|
264
|
-
|
265
|
-
def pid_file_exists?
|
266
|
-
# Any pid file is NOT zero size
|
267
|
-
pid_files.any? { |pid_file| file?(pid_file, "-s") }
|
268
|
-
end
|
269
|
-
|
270
|
-
def remove_orphaned_pid_file
|
271
|
-
rm(pid_files_path) if pid_file_orphaned?
|
272
|
-
end
|
273
|
-
|
274
|
-
def monitor_command
|
275
|
-
@monitor_command ||= "#{monitor_executable} monitor -g #{service_entry}"
|
276
|
-
end
|
277
|
-
|
278
|
-
def unmonitor_command
|
279
|
-
@unmonitor_command ||= "#{monitor_executable} unmonitor -g #{service_entry}"
|
280
|
-
end
|
281
|
-
end
|
282
|
-
|
243
|
+
|
283
244
|
include Base
|
284
245
|
end
|
285
246
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luban
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rubyist Lei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: luban-cli
|