luban 0.7.0 → 0.7.1

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: 1e6d4f9cdf3011d2178e45db658af31c0c177bd3
4
- data.tar.gz: 601049ece4a58b0b23cb368cc343009723ac887d
3
+ metadata.gz: 54b42043d2a1f279f502aac4b9eac6df61084b28
4
+ data.tar.gz: 4f46862563c95782b23f0058869df124657d496a
5
5
  SHA512:
6
- metadata.gz: 13b3bdc0260bbb588b730136cd682a51df4c5a3a91efeca7ea9d9cf6084942e1975f7975b1a879a31f916909e39239977de6cd14efd7bc586ed44c5bdb1b909a
7
- data.tar.gz: ae4f6b0794889d7eafbb073b34ad2fa842681f64ac99c12aeed7e45102a335bdb1fbdd9a84b69433e7d5d0694a95a949c3390bbf30e53166340948e45290c76c
6
+ metadata.gz: ca6c519f7fb2c68e08d6b262e5740a46edb5fe2b80cf28e8ac91ed7517374b364575923357f54bf8f2e94ff77d07c9726c9eec1b246c8109de6142d1576021a0
7
+ data.tar.gz: 6c94d43d0a2fe976e5d1565e01fc81156424c61fce1d20d6910722fd67382ac2178b321697b87a65df5f178cd074f0b18a119f84d33d904a6961d3f534e33ff6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.7.1 (Aug 19, 2016)
4
+
5
+ Minor enhancements:
6
+ * Refactor shared symlink creation for linked_dirs and linked_files
7
+
8
+ Bug fixes:
9
+ * Properly handled backtrace switch from commandline options
10
+ * Removed target directory/file if it exists already during creating symlinks for linked_dirs
11
+
3
12
  ## Version 0.7.0 (Aug 18, 2016)
4
13
 
5
14
  New features:
@@ -116,7 +116,10 @@ module Luban
116
116
 
117
117
  def create_symlinks
118
118
  send("create_#{release_type}_symlinks")
119
- create_shared_symlinks_for(:directory, bundle_linked_dirs) if file?(gemfile)
119
+ if file?(gemfile)
120
+ create_shared_symlinks_for(bundle_linked_dirs, type: :directory,
121
+ from: linked_dirs_from, to: linked_dirs_to)
122
+ end
120
123
  end
121
124
 
122
125
  def create_profile_symlinks
@@ -126,23 +129,39 @@ module Luban
126
129
 
127
130
  def create_app_symlinks
128
131
  create_release_symlink(app_path)
129
- create_shared_symlinks_for(:directory, linked_dirs | %w(profile))
130
- create_shared_symlinks_for(:file, linked_files)
132
+ create_shared_symlinks_for_linked_dirs
133
+ create_shared_symlinks_for_linked_files
131
134
  end
132
135
 
133
136
  def create_release_symlink(target_dir)
134
137
  assure_symlink(release_path, target_dir.join(release_type))
135
138
  end
136
139
 
137
- def create_shared_symlinks_for(type, linked_paths)
140
+ def create_shared_symlinks_for_linked_dirs
141
+ create_shared_symlinks_for(linked_dirs, type: :directory,
142
+ from: linked_dirs_from, to: linked_dirs_to)
143
+ end
144
+
145
+ def create_shared_symlinks_for_linked_files
146
+ create_shared_symlinks_for(linked_files, type: :file,
147
+ from: linked_files_from, to: linked_files_to)
148
+ end
149
+
150
+ def create_shared_symlinks_for(linked_paths, type:, from:, to:)
138
151
  linked_paths.each do |path|
139
- target_path = release_path.join(path)
152
+ target_path = to.join(path)
140
153
  assure_dirs(target_path.dirname)
141
- source_path = shared_path.join(path)
142
- assure_symlink(source_path, target_path)
154
+ rm('-r', target_path) if send("#{type}?", target_path)
155
+ source_path = from.join(path)
156
+ assure_symlink(source_path, target_path) if send("#{type}?", source_path)
143
157
  end
144
158
  end
145
159
 
160
+ def linked_dirs_from; shared_path; end
161
+ def linked_dirs_to; release_path; end
162
+ def linked_files_from; profile_path; end
163
+ def linked_files_to; release_path.join('config'); end
164
+
146
165
  def create_etc_symlinks
147
166
  create_logrotate_symlinks
148
167
  end
@@ -190,7 +190,7 @@ module Luban
190
190
 
191
191
  def run_task(cmd: nil, args:, opts:, locally: false,
192
192
  worker_class: self.class.default_worker_class, &blk)
193
- backtrace = opts.delete(:backtrace)
193
+ backtrace = opts[:backtrace]
194
194
  task_args = compose_task_arguments(args)
195
195
  task_opts = compose_task_options(opts)
196
196
  run_opts = extract_run_options(task_opts)
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.7.0"
3
+ VERSION = "0.7.1"
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.7.0
4
+ version: 0.7.1
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-08-18 00:00:00.000000000 Z
11
+ date: 2016-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli