luban 0.9.10 → 0.9.11

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: 9d25dda1f3728164c6c4dbba1cbfffc26748f9ce
4
- data.tar.gz: 2967b210dc597d9293418e9005f90f705fe4e380
3
+ metadata.gz: 72355bc137cbef16a7cb79d5ff8cdf43aaf5b319
4
+ data.tar.gz: bf8dcc14391a985b0e94f6d6ee7860a3ae86da1c
5
5
  SHA512:
6
- metadata.gz: 812bbd83cc2575d2908fd1241274d069ecb60386fe1f46f07084c604fc3aede2a56d517e20e6497551358cbbc0f1ce2798bd2e0a897cac92b2a744a9f2f02e48
7
- data.tar.gz: 7bd9bb1d13b426ac1d997d5a2c9f1c3138a2114854ccf24539623bacfc346b988db89dd949d39a391e86b09aed604498fe7a3c32e4f71b9631a64e8910a8471e
6
+ metadata.gz: 475b0feae1238547ba9541ee95a379e9f41a6cde447a1e403d283c7845f79b05a698a93bf0fa067f9039402236c5cf163c9b5192322c6b6924752ab32af089f8
7
+ data.tar.gz: 0dc3c43f80118bd6d882c6ebff860818d1ad1a966130299f8e62cda710e90d59a2340d950ca5b35e98aac2160e87bb59d207c9bdc09ca165acd9a155ffb85cef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.9.11 (Oct 24, 2016)
4
+
5
+ Bug fixes:
6
+ * Eval the parameter default value block (if given) under the context of the instance instead of the class
7
+
3
8
  ## Version 0.9.10 (Oct 24, 2016)
4
9
 
5
10
  Minor enhancements:
@@ -274,6 +274,7 @@ module Luban
274
274
  def set_parameters
275
275
  super
276
276
  copy_parameters_from_parent(:stage, :project, :process_monitor)
277
+ set :application, self.class.name.split(':').last.snakecase
277
278
  @packages = {}
278
279
  @services = {}
279
280
  @source = {}
@@ -282,11 +283,6 @@ module Luban
282
283
  @profile_opts = {}
283
284
  end
284
285
 
285
- def set_default_parameters
286
- set :application, self.class.name.split(':').last.snakecase
287
- super
288
- end
289
-
290
286
  def set_default_for_source
291
287
  unless default_source_path.nil?
292
288
  source(default_source_path, scm: :rsync)
@@ -98,12 +98,16 @@ module Luban
98
98
 
99
99
  protected
100
100
 
101
- def set_default_parameters
101
+ def set_parameters
102
+ super
102
103
  set :stage, self.class.name.split('::').first.snakecase
103
104
  set :project, self.class.name.split('::').last.snakecase
105
+ end
106
+
107
+ def set_default_parameters
108
+ super
104
109
  @passwords = {}
105
110
  @passwords_mutex = Mutex.new
106
- super
107
111
  end
108
112
 
109
113
  def load_libraries
@@ -6,7 +6,13 @@ module Luban
6
6
  define_method(param) do |value = nil|
7
7
  value.nil? ? fetch(__method__) : set(__method__, value)
8
8
  end
9
- define_method("set_default_for_#{param}") { set_default param, default }
9
+ define_method("set_default_for_#{param}") do
10
+ if default.respond_to?(:call)
11
+ set_default param, instance_exec(&default)
12
+ else
13
+ set_default param, default
14
+ end
15
+ end
10
16
  protected "set_default_for_#{param}"
11
17
  end
12
18
  end
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.9.10"
3
+ VERSION = "0.9.11"
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.9.10
4
+ version: 0.9.11
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-10-23 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli