luban 0.7.10 → 0.7.11

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: 0ea293a8aab808284fa5ced1439db9c3d52cbb0a
4
- data.tar.gz: 3db8526f0bc44ecc32fe2ce750492d5cff2a5561
3
+ metadata.gz: 965accf9f688c3645de9f50c82c60c9cc892e586
4
+ data.tar.gz: 8d63a832e8afbeb809ddf81ddc7ed28a91d93ae3
5
5
  SHA512:
6
- metadata.gz: 0d0258e4ae2419f4e523a60ce27fbc8718ae83517b8a64388accea1d4c339dc2b4f2961a214b9add9828a147232d9d917ad27b520e4af8c62dd946868682ea55
7
- data.tar.gz: c9b4c780fc0ee5b5922149edca89b26146063854dc2b578a0fc81fd44db33e4fab60b6f62957a0b0e5b6506a040c4de21c87d8725741fc1e32ace9486a71fa59
6
+ metadata.gz: 02830ccd54bfed7f6eb99a1306ac86576473f08b1f38cb538e20fe28670bbd9c43a5fe029d9b0f7ae73ee4f41f5ac1834cb58e5de5249e5d4aec49c397de3362
7
+ data.tar.gz: 866dd03727416032e174471cd431dbe055c620800d0b67caf70a4cb504b77ce3b7c4928ac37b603fadcae8028b85ce82a83fb0cddd9c69c0510c5d9369193c81
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.7.11 (Sept 01, 2016)
4
+
5
+ Minor enhancements:
6
+ * Supported shell command prefix
7
+ * Minor code refactoring
8
+
3
9
  ## Version 0.7.10 (Sept 01, 2016)
4
10
 
5
11
  Bug fixes:
@@ -29,14 +29,6 @@ module Luban
29
29
  @releases_log_path ||= app_path.join('releases.log')
30
30
  end
31
31
 
32
- def gemfile
33
- @gemfile ||= release_path.join('Gemfile')
34
- end
35
-
36
- def bundle_cmd
37
- @bundle_cmd ||= app_bin_path.join('bundle')
38
- end
39
-
40
32
  def bundle_config_path
41
33
  @bundle_config_path ||= shared_path.join('.bundle')
42
34
  end
@@ -119,7 +111,7 @@ module Luban
119
111
 
120
112
  def create_symlinks
121
113
  send("create_#{release_type}_symlinks")
122
- if file?(gemfile)
114
+ if has_gemfile?
123
115
  create_linked_dirs(bundle_linked_dirs, from: shared_path, to: release_path)
124
116
  end
125
117
  end
@@ -204,12 +196,12 @@ module Luban
204
196
  options = []
205
197
  options << "--gemfile #{gemfile}"
206
198
  options << "--path #{bundle_path}"
207
- unless test(bundle_cmd, :check, *options)
199
+ unless test(bundle_executable, :check, *options)
208
200
  unless bundle_without.include?(stage.to_s)
209
201
  options << "--without #{bundle_without.join(' ')}"
210
202
  end
211
203
  options << bundle_flags.join(' ')
212
- execute(bundle_cmd, :install, *options)
204
+ execute(bundle_executable, :install, *options)
213
205
  end
214
206
  end
215
207
  end
@@ -5,8 +5,14 @@ module Luban
5
5
  include Luban::Deployment::Worker::Paths::Remote
6
6
  include Luban::Deployment::Service::Worker::Base
7
7
 
8
+ def gemfile
9
+ @gemfile ||= release_path.join('Gemfile')
10
+ end
11
+
12
+ def has_gemfile?; file?(gemfile); end
13
+
8
14
  def shell_setup_commands
9
- super << "cd #{release_path}"
15
+ @shell_setup_commands ||= super << "cd #{release_path}"
10
16
  end
11
17
 
12
18
  %i(name full_name version major_version patch_level).each do |method|
@@ -24,6 +30,14 @@ module Luban
24
30
  def release_path
25
31
  @release_path ||= releases_path.join(release_tag)
26
32
  end
33
+
34
+ def ruby_bin_path
35
+ @ruby_bin_path ||= package_bin_path('ruby')
36
+ end
37
+
38
+ def bundle_executable
39
+ @bundle_executable ||= ruby_bin_path.join('bundle')
40
+ end
27
41
  end
28
42
  end
29
43
  end
@@ -380,7 +380,6 @@ module Luban
380
380
  backend.ssh_options.merge(user: user).merge!(ssh_options)
381
381
  end
382
382
  end
383
- #bundle_bins.each { |cmd| sshkit.command_map.prefix[cmd.to_sym].push("bundle exec") }
384
383
  end
385
384
 
386
385
  configure_airbrussh if format == :airbrussh
@@ -7,7 +7,12 @@ module Luban
7
7
  @shell_setup_commands ||= ["source #{envrc_file}"]
8
8
  end
9
9
 
10
+ def shell_command_prefix
11
+ @shell_command_prefix ||= []
12
+ end
13
+
10
14
  def compose_command(cmd)
15
+ cmd = "#{shell_command_prefix.join(' ')} #{cmd}" unless shell_command_prefix.empty?
11
16
  "#{shell_setup_commands.join(' && ')} && #{cmd} 2>&1"
12
17
  end
13
18
 
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.7.10"
3
+ VERSION = "0.7.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.10
4
+ version: 0.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Lei