capistrano_multiconfig_parallel 0.1.2 → 0.1.3

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: a746f33a265f4fc48ab56e721237bf0ee4a8b630
4
- data.tar.gz: 7b4e88796307b7e716e295c30ad92c95ea4bb956
3
+ metadata.gz: 5dc5369df42690fa5ef870983a214797511279f1
4
+ data.tar.gz: f88009806ea57b3592a5764fd11d9a462eed320f
5
5
  SHA512:
6
- metadata.gz: 7637c413863f49dfd94f1ab15d9ba226905c0f14a9f88de829d5c856bf6645174c19821c67b260ca0bf264c9797857f7fcc13286385157a06b9561b4826c189f
7
- data.tar.gz: 5c89b080cef04295fb4e65b5b964e6bdf055b7b8adc0fa72f7a4d47a8efeb0546223155a74374a11bc60a12eb68916129e30fde9516f11fb22bcfeb0187ce161
6
+ metadata.gz: 92e18862adee46ad87c6b367a4667d5b5042f4470d449aeed06e39f7064f363b803f47aff6eeeae50a5d700fa1288a846f8e2809910471a9dc4367fceebd2e90
7
+ data.tar.gz: e85230d220e7f440e38c3164113b70050432b09267120b0ae15e35c0caa759accd38806c1094b8f7ae821d7079c60e1bcde6863f1af515c9d076f580a0e8ceab
@@ -4,7 +4,7 @@ module CapistranoMulticonfigParallel
4
4
  include Celluloid
5
5
  include Celluloid::Logger
6
6
 
7
- attr_accessor :actor, :pid, :exit_status, :process, :filename
7
+ attr_accessor :actor, :pid, :exit_status, :process, :filename,:worker_log
8
8
 
9
9
  def finalize
10
10
  EM.stop
@@ -18,9 +18,9 @@ module CapistranoMulticonfigParallel
18
18
  def work(cmd, options = {})
19
19
  @options = options
20
20
  @actor = @options.fetch(:actor, nil)
21
+ set_worker_log
21
22
  EM.run do
22
23
  EM.next_tick do
23
- set_worker_log
24
24
  start_async_deploy(cmd, options)
25
25
  end
26
26
  @timer = EM::PeriodicTimer.new(0.1) do
@@ -38,6 +38,12 @@ module CapistranoMulticonfigParallel
38
38
  FileUtils.mkdir_p(CapistranoMulticonfigParallel.log_directory)
39
39
  @filename = File.join(CapistranoMulticonfigParallel.log_directory, "worker_#{@actor.job_id}.log")
40
40
  FileUtils.rm_rf(@filename) if @options[:dry_run] || @actor.executed_dry_run != true
41
+ @worker_log = ::Logger.new(@filename)
42
+ @worker_log.level = ::Logger::Severity::DEBUG
43
+ @worker_log.formatter = proc do |severity, datetime, progname, msg|
44
+ date_format = datetime.strftime("%Y-%m-%d %H:%M:%S")
45
+ "[#{date_format}] #{severity} (#{progname}): #{msg}\n"
46
+ end
41
47
  end
42
48
 
43
49
  def check_exit_status
@@ -97,8 +103,8 @@ module CapistranoMulticonfigParallel
97
103
  @process ||= process
98
104
  end
99
105
 
100
- def io_callback(_io, data)
101
- File.open(@filename, 'a') { |f| f << data }
106
+ def io_callback(io, data)
107
+ @worker_log.debug("#{io.upcase} ---- #{data}")
102
108
  end
103
109
  end
104
110
  end
@@ -8,7 +8,7 @@ module CapistranoMulticonfigParallel
8
8
  module VERSION
9
9
  MAJOR = 0
10
10
  MINOR = 1
11
- TINY = 2
11
+ TINY = 3
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_multiconfig_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-29 00:00:00.000000000 Z
11
+ date: 2015-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid-pmap