capistrano_multiconfig_parallel 0.15.0 → 0.15.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: bd23b511de842a842e488d77a14f485c25ea0038
4
- data.tar.gz: 4ebc2e9f2a2f11d0546ba60930e70f2b641a8a85
3
+ metadata.gz: 61e15b86cf7100b8dc3c8095bc9774746af06c8d
4
+ data.tar.gz: a5dda64b54ddd59b5186c01aac8aa0c302b6d2c0
5
5
  SHA512:
6
- metadata.gz: 408a10f55c1fc2bb2232109abe5fb8ef345f58de0bcd3fda293e3c7c8979a9579a908aaff6bd946798badb61fd6762fece5e69e85dcc4df9fef18830718ebca0
7
- data.tar.gz: 854662dee0a090edd903638ae6dd8ab69273cd6fd3b724a61daf0431d3202adde3cfca49843e8a72640126ca352dd00c678fca275f010329de843ca9ec2ca014
6
+ metadata.gz: 790260475aa01f09fb80171fe0bb739c6c99ea326f19225cf9a188316336aac7bdc3cb68431252bc5471a5b5ec0c2d04344ba9d9a33e2a8bceac4762ad186055
7
+ data.tar.gz: fcd8e3536de4083093cd5f71bc0c3f6358d1c66a064e62e5e652585aa0e86bc7f9cac6ac8f984922f31ea34a2d5137c2484e459835c06c5f5d63a51e67c840af
@@ -17,19 +17,19 @@ Gem::Specification.new do |s|
17
17
  s.require_paths = ['lib']
18
18
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
 
20
- s.add_runtime_dependency 'celluloid-pmap', '~> 0.2', '>= 0.2.0'
20
+ s.add_runtime_dependency 'celluloid-pmap', '~> 0.2', '>= 0.2.2'
21
21
  s.add_runtime_dependency 'celluloid_pubsub', '~> 0.0', '>= 0.0.21'
22
22
  s.add_runtime_dependency 'composable_state_machine', '~> 1.0', '>= 1.0.2'
23
- s.add_runtime_dependency 'terminal-table', '~> 1.4', '>= 1.4.5'
24
- s.add_runtime_dependency 'colorize', '~> 0.7', '>= 0.7'
23
+ s.add_runtime_dependency 'terminal-table', '~> 1.5', '>= 1.5.2'
24
+ s.add_runtime_dependency 'colorize', '~> 0.7', '>= 0.7'
25
25
  s.add_runtime_dependency 'eventmachine', '~> 1.0', '>= 1.0.3'
26
26
  s.add_runtime_dependency 'right_popen', '~> 1.1', '>= 1.1.3'
27
- s.add_runtime_dependency 'capistrano-multiconfig','~> 3.0', '>= 3.0.8'
28
27
  s.add_runtime_dependency 'capistrano','~> 3.0','>= 3.0'
29
28
  s.add_runtime_dependency 'activesupport', '~> 4.0','>= 4.0'
30
29
  s.add_runtime_dependency 'configliere', '~> 0.4', '>=0.4'
31
30
  s.add_runtime_dependency 'inquirer', '~> 0.2', '>= 0.2'
32
31
  s.add_runtime_dependency 'devnull','~> 0.1', '>= 0.1'
32
+ s.add_runtime_dependency 'versionomy', '~> 0.4', '>= 0.4.4'
33
33
 
34
34
  s.add_development_dependency 'rspec-rails', '~> 3.3', '>= 3.3'
35
35
  s.add_development_dependency 'guard', '~> 2.13', '>= 2.13'
@@ -33,5 +33,6 @@ Gem.find_files('capistrano_multiconfig_parallel/celluloid/**/*.rb').each { |path
33
33
 
34
34
  require_relative './version'
35
35
  require_relative './configuration'
36
+ require_relative './helper'
36
37
  require_relative './base'
37
38
  require_relative './application'
@@ -1,6 +1,7 @@
1
1
  # base module that has the statis methods that this gem is using
2
2
  module CapistranoMulticonfigParallel
3
3
  include CapistranoMulticonfigParallel::Configuration
4
+ include Helper
4
5
 
5
6
  ENV_KEY_JOB_ID = 'multi_cap_job_id'
6
7
  MULTI_KEY = 'multi'
@@ -75,9 +76,9 @@ module CapistranoMulticonfigParallel
75
76
  err_backtrace = message.respond_to?(:backtrace) ? message.backtrace.join("\n\n") : ''
76
77
  if err_backtrace.present?
77
78
  logger.debug(
78
- class_name: message.class,
79
- message: error_message,
80
- backtrace: err_backtrace
79
+ class_name: message.class,
80
+ message: error_message,
81
+ backtrace: err_backtrace
81
82
  )
82
83
  else
83
84
  logger.debug(message)
@@ -94,6 +95,10 @@ module CapistranoMulticonfigParallel
94
95
  end
95
96
  end
96
97
 
98
+ def using_cap3?
99
+ verify_gem_version('capistrano', '3', operator: '>=')
100
+ end
101
+
97
102
  def try_detect_capfile
98
103
  root = Pathname.new(FileUtils.pwd)
99
104
  root = root.parent unless root.directory?
@@ -0,0 +1,31 @@
1
+ # module used for feching gem information
2
+ module Helper
3
+ # function that makes the methods incapsulated as utility functions
4
+
5
+ module_function
6
+
7
+ def find_loaded_gem_property(gem_name, property)
8
+ gem_spec = Gem.loaded_specs.values.find { |repo| repo.name == gem_name }
9
+ gem_spec.respond_to?(property) ? gem_spec.send(property) : nil
10
+ end
11
+
12
+ def fetch_gem_version(gem_name, options = {})
13
+ version = find_loaded_gem_property(gem_name, 'version')
14
+ version.blank? ? nil : get_parsed_version(version.to_s, options)
15
+ end
16
+
17
+ def get_parsed_version(version, options)
18
+ parsing_options = {optional_fields: [:tiny]}.merge(options.fetch("unparse", {}))
19
+ Versionomy.parse(version).unparse(parsing_options)
20
+ rescue Versionomy::Errors::ParseError
21
+ nil
22
+ end
23
+
24
+ def verify_gem_version(gem_name, version, options = {})
25
+ options.stringify_keys!
26
+ version = get_parsed_version(version, options)
27
+ gem_version = fetch_gem_version(gem_name, options)
28
+ gem_version.blank? ? false : gem_version.send(options.fetch('operator', '<='), version)
29
+ end
30
+
31
+ end
@@ -42,8 +42,8 @@ module CapistranoMulticonfigParallel
42
42
  custom_stages = fetch_multi_stages
43
43
  return if custom_stages.blank?
44
44
  custom_stages = check_multi_stages(custom_stages)
45
- custom_stages.each do |_stage|
46
- collect_jobs(options.merge('stage' => custom_stages))
45
+ custom_stages.each do |stage|
46
+ collect_jobs(options.merge('stage' => stage))
47
47
  end
48
48
  end
49
49
 
@@ -62,11 +62,15 @@ module CapistranoMulticonfigParallel
62
62
  end
63
63
 
64
64
  def can_start?
65
- @top_level_tasks.size > 1 && (@stages.include?(@top_level_tasks.first) || custom_command?) && ENV[CapistranoMulticonfigParallel::ENV_KEY_JOB_ID].blank?
65
+ @top_level_tasks.size >= 1 && (@stages.include?(@top_level_tasks.first) || custom_command?) && ENV[CapistranoMulticonfigParallel::ENV_KEY_JOB_ID].blank?
66
66
  end
67
67
 
68
68
  def custom_command?
69
- @top_level_tasks.first == 'ensure_stage' && !@stages.include?(@top_level_tasks.second) && !@stages.include?(@top_level_tasks.first) && custom_commands.values.include?(@top_level_tasks.second)
69
+ if multi_apps?
70
+ !@stages.include?(@top_level_tasks.first) && custom_commands.values.include?(@top_level_tasks.first)
71
+ else
72
+ !@stages.include?(@top_level_tasks.second) && @stages.include?(@top_level_tasks.first) && custom_commands.values.include?(@top_level_tasks.second)
73
+ end
70
74
  end
71
75
 
72
76
  def custom_commands
@@ -151,9 +155,9 @@ module CapistranoMulticonfigParallel
151
155
  apps = @dependency_tracker.fetch_apps_needed_for_deployment(options['app'], options['action'])
152
156
  backup_the_branch if multi_apps?
153
157
  deploy_multiple_apps(apps, options)
154
- deploy_app(options)
158
+ deploy_app(options) unless custom_command?
155
159
  rescue => e
156
- CapistranoMulticonfigParallel::Base.log_message(e)
160
+ CapistranoMulticonfigParallel.log_message(e)
157
161
  end
158
162
 
159
163
  def process_jobs
@@ -8,7 +8,7 @@ module CapistranoMulticonfigParallel
8
8
  module VERSION
9
9
  MAJOR = 0
10
10
  MINOR = 15
11
- TINY = 0
11
+ TINY = 1
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_multiconfig_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.2'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.2.0
22
+ version: 0.2.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.2'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.2.0
32
+ version: 0.2.2
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: celluloid_pubsub
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -76,20 +76,20 @@ dependencies:
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: '1.4'
79
+ version: '1.5'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 1.4.5
82
+ version: 1.5.2
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.4'
89
+ version: '1.5'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 1.4.5
92
+ version: 1.5.2
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: colorize
95
95
  requirement: !ruby/object:Gem::Requirement
@@ -150,26 +150,6 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: 1.1.3
153
- - !ruby/object:Gem::Dependency
154
- name: capistrano-multiconfig
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '3.0'
160
- - - ">="
161
- - !ruby/object:Gem::Version
162
- version: 3.0.8
163
- type: :runtime
164
- prerelease: false
165
- version_requirements: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - "~>"
168
- - !ruby/object:Gem::Version
169
- version: '3.0'
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: 3.0.8
173
153
  - !ruby/object:Gem::Dependency
174
154
  name: capistrano
175
155
  requirement: !ruby/object:Gem::Requirement
@@ -270,6 +250,26 @@ dependencies:
270
250
  - - ">="
271
251
  - !ruby/object:Gem::Version
272
252
  version: '0.1'
253
+ - !ruby/object:Gem::Dependency
254
+ name: versionomy
255
+ requirement: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - "~>"
258
+ - !ruby/object:Gem::Version
259
+ version: '0.4'
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: 0.4.4
263
+ type: :runtime
264
+ prerelease: false
265
+ version_requirements: !ruby/object:Gem::Requirement
266
+ requirements:
267
+ - - "~>"
268
+ - !ruby/object:Gem::Version
269
+ version: '0.4'
270
+ - - ">="
271
+ - !ruby/object:Gem::Version
272
+ version: 0.4.4
273
273
  - !ruby/object:Gem::Dependency
274
274
  name: rspec-rails
275
275
  requirement: !ruby/object:Gem::Requirement
@@ -631,6 +631,7 @@ files:
631
631
  - lib/capistrano_multiconfig_parallel/extensions/output_stream.rb
632
632
  - lib/capistrano_multiconfig_parallel/extensions/rake.rb
633
633
  - lib/capistrano_multiconfig_parallel/extensions/rake_hook_actor.rb
634
+ - lib/capistrano_multiconfig_parallel/helper.rb
634
635
  - lib/capistrano_multiconfig_parallel/initializers/conf.rb
635
636
  - lib/capistrano_multiconfig_parallel/initializers/default.yml
636
637
  - lib/capistrano_multiconfig_parallel/managers/base_manager.rb