capistrano_multiconfig_parallel 1.2.9 → 1.3.0

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: 3947be009ccd058468859ed7de03256be1da9ce7
4
- data.tar.gz: 571ae64684a156ae392f03772dc37a917c26a84a
3
+ metadata.gz: ad818dec1e400fbf987547ee9f73b418e2717039
4
+ data.tar.gz: d89e2681e842160eef7ff03df18edbcc73593dcb
5
5
  SHA512:
6
- metadata.gz: 925c1a9fdc0d3119c8fb09d2c474597842628cd29ac5f6cbe3f5b6c3790395b8c3837188f89ab463087d16e2d87f18c68acdd47a9e18991d3f115f27e72a7790
7
- data.tar.gz: 803e0ea952fb18fcd4deb1e0f4f1c68c0b331bfb269afca0bc1febfca66fd89df3358c97f9514d6fd19c095c1124f3fb62410fb811a3a038543fefc19e800878
6
+ metadata.gz: fefdfa881e03d9278bb8789dc663edb312159760a709cd7bb07111fe7c99734ec3b0a7453df7c14ed9f4f06fd5e4a243a7ffa606fede326ef99423e7d4f5cb6a
7
+ data.tar.gz: 8d4e10d4d7295e9a91231201e59f94783a7ad0c4918b7da817cedfedb5ec7677a98e488f9f3f9dbae6f5d17d4a487ec5e88a0796e0c7fdc4ecea448dadb22b7b
data/Rakefile CHANGED
@@ -19,6 +19,11 @@ end
19
19
  YARD::Config.options[:load_plugins] = true
20
20
  YARD::Config.load_plugins
21
21
 
22
+ # dirty hack for YardocTask
23
+ ::Rake.application.class.class_eval do
24
+ alias_method :last_comment, :last_description
25
+ end
26
+
22
27
  YARD::Rake::YardocTask.new do |t|
23
28
  t.files = ['lib/**/*.rb', 'spec/**/*_spec.rb'] # optional
24
29
  t.options = ['--any', '--extra', '--opts', '--markup-provider=redcarpet', '--markup=markdown', '--debug'] # optional
@@ -50,10 +50,13 @@ module CapistranoMulticonfigParallel
50
50
  end
51
51
 
52
52
  def verify_valid_data
53
- if @top_level_tasks == ['default'] || (multi_apps? && !@top_level_tasks.first.to_s.include?(':') )
53
+ return if @top_level_tasks != ['default']
54
+ raise_invalid_job_config
55
+ end
56
+
57
+ def raise_invalid_job_config
54
58
  puts 'Invalid execution, please call something such as `multi_cap production deploy`, where production is a stage you have defined'.red
55
59
  exit(false)
56
- end
57
60
  end
58
61
 
59
62
  def initialize_data
@@ -201,6 +204,7 @@ module CapistranoMulticonfigParallel
201
204
 
202
205
  def prepare_job(options)
203
206
  options = options.stringify_keys
207
+ return raise_invalid_job_config if !job_stage_valid?(options)
204
208
  app = options.fetch('app', '')
205
209
  box = options['env_options'][boxes_key]
206
210
  message = box.present? ? "BOX #{box}:" : "stage #{options['stage']}:"
@@ -223,6 +227,19 @@ module CapistranoMulticonfigParallel
223
227
  can_tag_staging? && job.stage == 'production' && job.gitflow.present?
224
228
  end
225
229
 
230
+ def job_path(options)
231
+ options.fetch("path", detect_root)
232
+ end
233
+
234
+ def job_stage_valid?(options)
235
+ stages(job_path(options)).include?(job_stage(options))
236
+ end
237
+
238
+ def job_stage(options)
239
+ multi_apps?(job_path(options)) && options.fetch('app', nil).present? ? "#{options['app']}:#{options['stage']}" : "#{options['stage']}"
240
+ end
241
+
242
+
226
243
  def prepare_options(options)
227
244
  options = options.stringify_keys
228
245
  options['app'] = options.fetch('app', @application.to_s.clone)
@@ -24,9 +24,10 @@ module CapistranoMulticonfigParallel
24
24
  def fetch_application_dependencies(application, action)
25
25
  return [[], {}] if configuration.application_dependencies.blank? || application.blank?
26
26
  applications = get_applications_to_deploy(action, [application.camelcase])
27
- app_options = applications.find { |hash| hash['app'] == application }.dup
27
+ applications = applications.present? ? applications : []
28
+ app_options = applications.find { |hash| hash['app'] == application }.try(:dup)
28
29
  applications.delete_if { |hash| hash['app'] == application }
29
- [applications, app_options]
30
+ [applications, (app_options || {})]
30
31
  end
31
32
 
32
33
  def show_interactive_menu(action)
@@ -7,8 +7,8 @@ module CapistranoMulticonfigParallel
7
7
  # module used for generating the version
8
8
  module VERSION
9
9
  MAJOR = 1
10
- MINOR = 2
11
- TINY = 9
10
+ MINOR = 3
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: 1.2.9
4
+ version: 1.3.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-03-10 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid