capistrano_multiconfig_parallel 0.31.1 → 0.32.0

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: 64b93504a5622842d235bd3e44e42dbe975e83ec
4
- data.tar.gz: d8489a215a2cbad5b636ef1843d724e78c98e375
3
+ metadata.gz: 5f2058afba53f3625fe0253f9ea80bcfcd83928f
4
+ data.tar.gz: 6d568cea8e8d7e5501166d5e0fe3f2a8c5fd4baa
5
5
  SHA512:
6
- metadata.gz: 4909493b8341c11ba695ea555255329e704dd5685f3aa9958aa68febd6a8ad50bdc2a73a185fd2cc183f90c9868908b75d56fe11ca7d49f4a7ffa91bff8f488b
7
- data.tar.gz: 13f6939093552b461d94e01a90528c546ad91f8a4b6245f3cf99fb608951ab183a816dd41fa8215002d4b8e62143e4e75dce35404f4a351b22a3da8de2bff95e
6
+ metadata.gz: e18832aa02656f2de014326cc40c3cc7b9107c2c9e32b0c9c8edc9a542054f55d8fe9cf86f2a545006f733adcc4656af66ee76285b70d6f433ddf10748eb7861
7
+ data.tar.gz: c3b95a15ab8d3a962d1013918d082b6bd76ddb074d9bdf3d51d9c4dd6c8216223ecfafc937412ca0bfe575d79207d416c1843e2a5640023ce2c902b641b6914f
data/README.md CHANGED
@@ -20,27 +20,25 @@ CAUTION!! PLEASE READ CAREFULLY!! Capistrano is not thread-safe. However in orde
20
20
  Requirements
21
21
  ------------
22
22
 
23
- 1. [Ruby 1.9.x or Ruby 2.x.x](http://www.ruby-lang.org)
24
- 2. [ActiveSuport >= 4.2.0](https://rubygems.org/gems/activesupport)
25
- 3. [celluloid-pmap >= 0.2.2](https://github.com/jwo/celluloid-pmap)
26
- 4. [celluloid_pubsub >= 0.1.0](https://github.com/bogdanRada/celluloid_pubsub)
27
- 5. [celluloid-websocket-client >= 0.0.1](https://github.com/jeremyd/celluloid-websocket-client)
28
- 6. [composable_state_machine >= 1.0.2](https://github.com/swoop-inc/composable_state_machine)
29
- 7. [terminal-table >= 1.5.2](https://github.com/tj/terminal-table)
30
- 8. [colorize >= 0.7](https://github.com/fazibear/colorize)
31
- 9. [eventmachine >= 1.0.3](https://github.com/eventmachine/eventmachine)
32
- 10. [right_popen >= 1.1.3](https://github.com/rightscale/right_popen)
33
- 11. [capistrano >= 3.0](https://github.com/capistrano/capistrano/)
34
- 12. [capistrano-multiconfig >= 3.0.8](https://github.com/railsware/capistrano-multiconfig)
35
- 13. [configliere >= 0.4](https://github.com/infochimps-platform/configliere)
36
- 14. [inquirer >= 0.2](https://github.com/arlimus/inquirer.rb)
37
- 15. [devnull >= 0.1](https://github.com/arlimus/inquirer.rb)
38
- 16. [rack >= 1.6](http://rack.github.io/)
23
+ 1. [ActiveSuport >= 4.2.0](https://rubygems.org/gems/activesupport)
24
+ 2. [celluloid-pmap >= 0.2.2](https://github.com/jwo/celluloid-pmap)
25
+ 3. [celluloid_pubsub >= 0.1.0](https://github.com/bogdanRada/celluloid_pubsub)
26
+ 4. [celluloid-websocket-client >= 0.0.1](https://github.com/jeremyd/celluloid-websocket-client)
27
+ 5. [composable_state_machine >= 1.0.2](https://github.com/swoop-inc/composable_state_machine)
28
+ 6. [terminal-table >= 1.5.2](https://github.com/tj/terminal-table)
29
+ 7. [colorize >= 0.7](https://github.com/fazibear/colorize)
30
+ 8. [eventmachine >= 1.0.3](https://github.com/eventmachine/eventmachine)
31
+ 9. [right_popen >= 1.1.3](https://github.com/rightscale/right_popen)
32
+ 10. [capistrano >= 3.0](https://github.com/capistrano/capistrano/)
33
+ 11. [configliere >= 0.4](https://github.com/infochimps-platform/configliere)
34
+ 12. [inquirer >= 0.2](https://github.com/arlimus/inquirer.rb)
35
+ 13. [devnull >= 0.1](https://github.com/arlimus/inquirer.rb)
36
+ 14. [rack >= 1.6](http://rack.github.io/)
39
37
 
40
38
  Compatibility
41
39
  -------------
42
40
 
43
- Rails >3.0 only. MRI 1.9.x, 2.x
41
+ Rails >3.0 only. [MRI 1.9.x or 2.x](http://www.ruby-lang.org)
44
42
 
45
43
  Ruby 1.8 is not officially supported. We will accept further compatibilty pull-requests but no upcoming versions will be tested against it.
46
44
 
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
26
26
  s.add_runtime_dependency 'eventmachine', '~> 1.0', '>= 1.0.3'
27
27
  s.add_runtime_dependency 'right_popen', '~> 1.1', '>= 1.1.3'
28
28
  s.add_runtime_dependency 'capistrano','~> 3.0','>= 3.0'
29
- s.add_runtime_dependency 'capistrano-multiconfig','~> 3.0','>= 3.0.8'
30
29
  s.add_runtime_dependency 'activesupport', '~> 4.0','>= 4.0'
31
30
  s.add_runtime_dependency 'configliere', '~> 0.4', '>=0.4'
32
31
  s.add_runtime_dependency 'inquirer', '~> 0.2', '>= 0.2'
@@ -39,3 +39,4 @@ end
39
39
 
40
40
  require_relative './version'
41
41
  require_relative './base'
42
+ require_relative './application'
@@ -1,12 +1,9 @@
1
- require 'capistrano/multiconfig/dsl'
2
1
  module CapistranoMulticonfigParallel
3
2
  # finds app dependencies, shows menu and delegates jobs to celluloid manager
4
3
  class Application
5
4
  include Celluloid
6
5
  include Celluloid::Logger
7
6
  include CapistranoMulticonfigParallel::ApplicationHelper
8
- include Capistrano::DSL
9
- include Capistrano::Multiconfig::DSL
10
7
 
11
8
  attr_reader :stage_apps, :top_level_tasks, :jobs, :branch_backup, :condition, :manager, :dependency_tracker, :application, :stage, :name, :args, :argv, :default_stage
12
9
 
@@ -72,9 +72,9 @@ module CapistranoMulticonfigParallel
72
72
 
73
73
  def setup_table_jobs(table)
74
74
  jobs = @manager.alive? ? @manager.jobs.dup : []
75
- jobs.each do |_job_id, job|
75
+ jobs.each do |job_id, job|
76
76
  table.add_row(job.terminal_row)
77
- table.add_separator
77
+ table.add_separator if jobs.keys.last != job_id
78
78
  end
79
79
  jobs
80
80
  end
@@ -27,9 +27,9 @@ module CapistranoMulticonfigParallel
27
27
  def fetch_cursor_position(table_size, position, previously_erased_screen)
28
28
  final_position = position || fetch_position
29
29
  terminal_rows = fetch_terminal_size
30
- screen_erased = refetch_position?(table_size, terminal_rows, final_position)
31
- if screen_erased == true
32
- move_to_home! if previously_erased_screen != true
30
+ if previously_erased_screen == false && refetch_position?(table_size, terminal_rows, final_position)
31
+ screen_erased = true
32
+ move_to_home!
33
33
  final_position = fetch_position
34
34
  terminal_rows = fetch_terminal_size
35
35
  end
@@ -14,7 +14,6 @@ module CapistranoMulticonfigParallel
14
14
 
15
15
  def execute_start(arguments)
16
16
  if arguments[CapistranoMulticonfigParallel::ENV_KEY_JOB_ID].blank?
17
- require_relative './application'
18
17
  run_the_application
19
18
  else
20
19
  Capistrano::Application.new.run
@@ -1,10 +1,12 @@
1
1
  require_relative './core_helper'
2
2
  require_relative './internal_helper'
3
+ require_relative './stages_helper'
3
4
  module CapistranoMulticonfigParallel
4
5
  # class that holds the options that are configurable for this gem
5
6
  module ApplicationHelper
6
7
  include CapistranoMulticonfigParallel::InternalHelper
7
8
  include CapistranoMulticonfigParallel::CoreHelper
9
+ include CapistranoMulticonfigParallel::StagesHelper
8
10
 
9
11
  delegate :logger,
10
12
  :configuration,
@@ -0,0 +1,37 @@
1
+ module CapistranoMulticonfigParallel
2
+ # module used to fetch the stages (code taken from https://github.com/railsware/capistrano-multiconfig)
3
+ # TODO: find a way to remove this and still be compatible with capistrano 2.x
4
+ module StagesHelper
5
+ module_function
6
+
7
+ def stages
8
+ fetch_stages_paths do |paths|
9
+ checks_paths(paths)
10
+ end
11
+ end
12
+
13
+ def checks_paths(paths)
14
+ paths.reject! { |path| check_stage_path(paths, path) }
15
+ sorted_paths(paths)
16
+ end
17
+
18
+ def sorted_paths(paths)
19
+ paths.present? ? paths.uniq.sort : paths
20
+ end
21
+
22
+ def check_stage_path(paths, path)
23
+ paths.any? { |another| another != path && another.start_with?(path + ':') }
24
+ end
25
+
26
+ def stages_paths
27
+ stages_root = File.expand_path(File.join(detect_root, 'config/deploy'))
28
+ Dir["#{stages_root}/**/*.rb"].map do |file|
29
+ file.slice(stages_root.size + 1..-4).tr('/', ':')
30
+ end
31
+ end
32
+
33
+ def fetch_stages_paths
34
+ stages_paths.tap { |paths| yield paths if block_given? }
35
+ end
36
+ end
37
+ end
@@ -7,8 +7,8 @@ module CapistranoMulticonfigParallel
7
7
  # module used for generating the version
8
8
  module VERSION
9
9
  MAJOR = 0
10
- MINOR = 31
11
- TINY = 1
10
+ MINOR = 32
11
+ TINY = 0
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.31.1
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-05 00:00:00.000000000 Z
11
+ date: 2016-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid-pmap
@@ -190,26 +190,6 @@ dependencies:
190
190
  - - ">="
191
191
  - !ruby/object:Gem::Version
192
192
  version: '3.0'
193
- - !ruby/object:Gem::Dependency
194
- name: capistrano-multiconfig
195
- requirement: !ruby/object:Gem::Requirement
196
- requirements:
197
- - - "~>"
198
- - !ruby/object:Gem::Version
199
- version: '3.0'
200
- - - ">="
201
- - !ruby/object:Gem::Version
202
- version: 3.0.8
203
- type: :runtime
204
- prerelease: false
205
- version_requirements: !ruby/object:Gem::Requirement
206
- requirements:
207
- - - "~>"
208
- - !ruby/object:Gem::Version
209
- version: '3.0'
210
- - - ">="
211
- - !ruby/object:Gem::Version
212
- version: 3.0.8
213
193
  - !ruby/object:Gem::Dependency
214
194
  name: activesupport
215
195
  requirement: !ruby/object:Gem::Requirement
@@ -682,6 +662,7 @@ files:
682
662
  - lib/capistrano_multiconfig_parallel/helpers/configuration.rb
683
663
  - lib/capistrano_multiconfig_parallel/helpers/core_helper.rb
684
664
  - lib/capistrano_multiconfig_parallel/helpers/internal_helper.rb
665
+ - lib/capistrano_multiconfig_parallel/helpers/stages_helper.rb
685
666
  - lib/capistrano_multiconfig_parallel/initializers/rake.rb
686
667
  - lib/capistrano_multiconfig_parallel/initializers/websocket.rb
687
668
  - lib/capistrano_multiconfig_parallel/version.rb