luban 0.9.11 → 0.9.12

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: 72355bc137cbef16a7cb79d5ff8cdf43aaf5b319
4
- data.tar.gz: bf8dcc14391a985b0e94f6d6ee7860a3ae86da1c
3
+ metadata.gz: 51db0c8680dd9ed4b6d19a0e8b99c28d9c90bacb
4
+ data.tar.gz: e097338152892da6526a9ed445c6154b2e127f1b
5
5
  SHA512:
6
- metadata.gz: 475b0feae1238547ba9541ee95a379e9f41a6cde447a1e403d283c7845f79b05a698a93bf0fa067f9039402236c5cf163c9b5192322c6b6924752ab32af089f8
7
- data.tar.gz: 0dc3c43f80118bd6d882c6ebff860818d1ad1a966130299f8e62cda710e90d59a2340d950ca5b35e98aac2160e87bb59d207c9bdc09ca165acd9a155ffb85cef
6
+ metadata.gz: 9579b032ed20af7cc705cd00c45b3156a92a60228d92309aa9e14120d0f55c805d837dbcefac3b119664bd608f2715292509da77e09819841d0bd0bb632d1228
7
+ data.tar.gz: 989fd8aff640d2f0c8f20f2e2e11ccb52307458c32208e7b47b41216e952c0927c7a73ed2db00d29a3c11efd0a4bbb6f6a103aebcf2e8c89f563f5c1f5df99ef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.9.12 (Oct 27, 2016)
4
+
5
+ Bug fixes:
6
+ * Fixed local source initialization issue
7
+ * As a side effect, refactored local source handling
8
+
3
9
  ## Version 0.9.11 (Oct 24, 2016)
4
10
 
5
11
  Bug fixes:
@@ -112,16 +112,19 @@ module Luban
112
112
  release_opts[version] = opts.merge(version: version)
113
113
  end
114
114
 
115
- def default_source_path
116
- @default_source_path ||=
117
- [config_finder[:application].stage_config_path.join('app'),
118
- config_finder[:application].base_path.join('app')].find do |source_path|
119
- File.directory?(source_path)
120
- end
115
+ def local_source_path
116
+ @local_source_path ||= [local_source_stage_path, local_source_base_path].find do |path|
117
+ File.directory?(path)
118
+ end
119
+ end
120
+
121
+ def local_source_stage_path
122
+ @local_source_stage_path ||= config_finder[:application].stage_config_path.join('app')
121
123
  end
124
+ alias_method :default_source_path, :local_source_stage_path
122
125
 
123
- def default_source?
124
- has_source? and source[:from] == default_source_path
126
+ def local_source_base_path
127
+ @local_source_base_path ||= config_finder[:application].base_path.join('app')
125
128
  end
126
129
 
127
130
  def has_version?(version)
@@ -237,8 +240,10 @@ module Luban
237
240
  end
238
241
 
239
242
  def init_source(args:, opts:)
240
- if default_source?
241
- init_source!(args: args, opts: opts.merge(source: source))
243
+ if respond_to?(:default_source_template_path, true)
244
+ init_source!(args: args,
245
+ opts: opts.merge(default_source_template_path: default_source_template_path,
246
+ default_source_path: default_source_path))
242
247
  end
243
248
  end
244
249
  dispatch_task :init_source!, to: :configurator, as: :init_source, locally: true
@@ -284,8 +289,8 @@ module Luban
284
289
  end
285
290
 
286
291
  def set_default_for_source
287
- unless default_source_path.nil?
288
- source(default_source_path, scm: :rsync)
292
+ unless local_source_path.nil?
293
+ source(local_source_path, scm: :rsync)
289
294
  release(stage, current: true)
290
295
  end
291
296
  end
@@ -5,11 +5,11 @@ module Luban
5
5
  include Luban::Deployment::Service::Configurator::Base
6
6
 
7
7
  def default_source_path
8
- task.opts.source[:from]
8
+ task.opts.default_source_path
9
9
  end
10
10
 
11
11
  def default_source_template_path
12
- raise NotImplementedError, "#{self.class.name}#default_source_template_path is an abstract method."
12
+ task.opts.default_source_template_path
13
13
  end
14
14
 
15
15
  def init_source
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.9.11"
3
+ VERSION = "0.9.12"
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.11
4
+ version: 0.9.12
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-24 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli