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: a417d4a92ea8a9f0d9b14b2f448e8471d66650a2
4
- data.tar.gz: f362a94f11454579846f9288b87757022fd3b2f6
3
+ metadata.gz: 9b5c23cf9c92a7106234e16b34d3ba5578f118cb
4
+ data.tar.gz: f29d25e7aeba87e5eb29380f531d924de2a17462
5
5
  SHA512:
6
- metadata.gz: b342062f582d1f037926279b0a5a8da8ec3e7086b2fa4f50c53ef1a8b667b9d006841241ea8958697bd02dcf289afd75760aa06c604574c6faab2a35f023b605
7
- data.tar.gz: 757fcdddf336eeac8da076bf7e2b94daf14088d35542304dc0d4c93fe453acdf8b68adec379b4bd609820d3d86c0cccfe50b228dd4ca270e37e1b01b81960f4d
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
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.6.6"
3
+ VERSION = "0.6.7"
4
4
  end
5
5
  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.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-07-27 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli