capistrano_multiconfig_parallel 0.0.2 → 0.0.3

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: ac6703e8eef5dd5b504c3d55c6728ea4e2c7aba4
4
- data.tar.gz: dbc246d3381acbcbffc4e4a0ef38161709cc6bf8
3
+ metadata.gz: 0a78671478f02eea81290937d810f8d201a64035
4
+ data.tar.gz: 5c4a60eb2789c9b1df47f226b9afabbc29ad532d
5
5
  SHA512:
6
- metadata.gz: 8039be85a7fc0224bcd5c40d8003e21f87076f538288db950edc7fda3d4962599ed270469c975d2aea4ec6a74bb7d261ff9dc02896a0f2fe57e13e84313e2c66
7
- data.tar.gz: 9255061f0eca93ce373e1b09ae27148b18aa563255639a8790a54d4ffc192aa6cd640c41a54966f02bda7739574175c4f9b1ffd5e46a02cfae366bcc2f71b64a
6
+ metadata.gz: d43f718c5aeea36c005ddbba82aca7135e318d122fbb29f7c2b83d23f467866ea1c6f454a3d944f5ae888672433721de667618ffb1793ef9778351c9da86d75a
7
+ data.tar.gz: 8e4b19c83d44d3df10878ba3212718a565c50d1b5db0d79f248effb2e3e6b338396cb9c74af6d0922a7a57993196ff5f10765659fc573c821bc86f04e3e54dcc
@@ -29,8 +29,8 @@ Gem::Specification.new do |s|
29
29
  s.add_runtime_dependency 'capistrano','~> 3.0','>= 3.0'
30
30
  s.add_runtime_dependency 'activesupport', '~> 4.0','>= 4.0'
31
31
  s.add_runtime_dependency 'configurations', '~> 2.0', '2.0.0'
32
-
33
-
32
+ s.add_runtime_dependency 'inquirer', '~> 0.2', '>= 0.2'
33
+
34
34
  s.add_development_dependency 'rspec-rails', '~> 2.0', '>= 2.0'
35
35
  s.add_development_dependency 'guard', '~> 2.6', '>= 2.6.1'
36
36
  s.add_development_dependency 'guard-rspec', '~> 4.2', '>= 4.2.9'
@@ -0,0 +1,32 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'bundler/setup'
4
+ require 'rake'
5
+ require 'active_support/core_ext/object/blank'
6
+ require 'active_support/core_ext/hash/keys'
7
+ require 'active_support/concern'
8
+ require 'celluloid/autostart'
9
+ require 'celluloid/pmap'
10
+ require 'composable_state_machine'
11
+ require 'formatador'
12
+ require 'eventmachine'
13
+ require 'right_popen'
14
+ require 'colorize'
15
+ require 'logger'
16
+ require 'terminal-table'
17
+ require 'colorize'
18
+ require 'celluloid_pubsub'
19
+ require 'capistrano/all'
20
+ require 'fileutils'
21
+ require 'logger'
22
+ require 'pp'
23
+ require 'configurations'
24
+ # fix error with not files that can not be found
25
+ Gem.find_files('composable_state_machine/**/*.rb').each { |path| require path }
26
+
27
+ Gem.find_files('capistrano_multiconfig_parallel/initializers/**/*.rb').each { |path| require path }
28
+ Gem.find_files('capistrano_multiconfig_parallel/helpers/**/*.rb').each { |path| require path }
29
+ Gem.find_files('capistrano_multiconfig_parallel/celluloid/**/*.rb').each { |path| require path }
30
+
31
+ require_relative './base'
32
+ require_relative 'application'
@@ -2,8 +2,9 @@ require 'rubygems'
2
2
  require 'bundler'
3
3
  require 'bundler/setup'
4
4
  require 'configurations'
5
+ require 'inquirer'
6
+ require_relative './version'
5
7
  require_relative './configuration'
6
-
7
8
  # base module that has the statis methods that this gem is using
8
9
  module CapistranoMulticonfigParallel
9
10
  include CapistranoMulticonfigParallel::Configuration
@@ -28,6 +29,10 @@ module CapistranoMulticonfigParallel
28
29
  def root
29
30
  File.expand_path(File.dirname(__dir__))
30
31
  end
32
+
33
+ def ask_confirm(message, default)
34
+ Ask.input message, default: default
35
+ end
31
36
 
32
37
  def verify_app_dependencies(stages)
33
38
  applications = stages.map { |stage| stage.split(':').reverse[1] }
@@ -120,7 +120,7 @@ module CapistranoMulticonfigParallel
120
120
 
121
121
  def confirm_task_approval(results, task)
122
122
  return unless results.present?
123
- set :apps_symlink_confirmation, ask_confirm("Do you want to continue the deployment and execute #{task}?", 'Y')
123
+ set :apps_symlink_confirmation, CapistranoMulticonfigParallel.ask_confirm("Do you want to continue the deployment and execute #{task}?", 'Y/N')
124
124
  until fetch(:apps_symlink_confirmation).present?
125
125
  sleep(0.1) # keep current thread alive
126
126
  end
@@ -1,35 +1,4 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- require 'bundler/setup'
4
- require 'rake'
5
- require 'active_support/core_ext/object/blank'
6
- require 'active_support/core_ext/hash/keys'
7
- require 'active_support/concern'
8
- require 'celluloid/autostart'
9
- require 'celluloid/pmap'
10
- require 'composable_state_machine'
11
- require 'formatador'
12
- require 'eventmachine'
13
- require 'right_popen'
14
- require 'colorize'
15
- require 'logger'
16
- require 'terminal-table'
17
- require 'colorize'
18
- require 'celluloid_pubsub'
19
- require 'capistrano/all'
20
- require 'fileutils'
21
- require 'logger'
22
- require 'pp'
23
- require 'configurations'
24
- # fix error with not files that can not be found
25
- Gem.find_files('composable_state_machine/**/*.rb').each { |path| require path }
26
-
27
- Gem.find_files('capistrano_multiconfig_parallel/initializers/**/*.rb').each { |path| require path }
28
- Gem.find_files('capistrano_multiconfig_parallel/helpers/**/*.rb').each { |path| require path }
29
- Gem.find_files('capistrano_multiconfig_parallel/celluloid/**/*.rb').each { |path| require path }
30
-
31
- require_relative './base'
32
- require_relative 'application'
1
+ require_relative './all'
33
2
 
34
3
  module CapistranoMulticonfigParallel
35
4
  # this is the class that will be invoked from terminal , and willl use the invoke task as the primary function.
@@ -168,10 +168,10 @@ module CapistranoMulticonfigParallel
168
168
  def get_applications_branch_from_stdin(app, app_message)
169
169
  app_name = (app.is_a?(Hash) && app[:app].present?) ? app[:app].camelcase : app
170
170
  app_name = app_name.present? ? app_name : "current application"
171
- message = "Branch name for #{app_name} for #{app_message} :"
171
+ message = "Please enter Branch name for #{app_name} for #{app_message}"
172
172
  branch = ''
173
173
  if @argv['BRANCH'].blank? || (@argv['BRANCH'].present? && !custom_command?)
174
- set :app_branch_name, ask(message, nil)
174
+ set :app_branch_name, CapistranoMulticonfigParallel.ask_confirm(message, nil)
175
175
  branch = parse_inputted_value
176
176
  else
177
177
  branch = @argv['BRANCH']
@@ -182,8 +182,8 @@ module CapistranoMulticonfigParallel
182
182
  def get_app_additional_env_options(app, app_message)
183
183
  app_name = (app.is_a?(Hash) && app[:app].present?) ? app[:app].camelcase : app
184
184
  app_name = app_name.present? ? app_name : "current application"
185
- message = "Please write additional ENV options for #{app_name} for #{app_message} :"
186
- set :app_additional_env_options, ask_confirm(message, nil)
185
+ message = "Please write additional ENV options for #{app_name} for #{app_message}"
186
+ set :app_additional_env_options, CapistranoMulticonfigParallel.ask_confirm(message, nil)
187
187
  fetch_app_additional_env_options
188
188
  end
189
189
 
@@ -48,7 +48,7 @@ module CapistranoMulticonfigParallel
48
48
 
49
49
  def check_app_dependency_unique(applications_selected, apps_dependencies, applications_to_deploy, action)
50
50
  return applications_to_deploy if applications_selected.blank? || apps_dependencies.blank? || (apps_dependencies.map { |app| app['app'] } - applications_to_deploy.map { |app| app['app'] }).blank?
51
- set :apps_dependency_confirmation, ask_confirm("Do you want to #{action} all dependencies also ? (Y/N):", 'N')
51
+ set :apps_dependency_confirmation, CapistranoMulticonfigParallel.ask_confirm("Do you want to #{action} all dependencies also ?", 'Y/N')
52
52
  applications_to_deploy = applications_to_deploy.concat(apps_dependencies) if fetch(:apps_dependency_confirmation).present? && fetch(:apps_dependency_confirmation).downcase == 'y'
53
53
  applications_to_deploy
54
54
  end
@@ -82,7 +82,7 @@ module CapistranoMulticonfigParallel
82
82
 
83
83
  def print_frameworks_used(app_names, applications_to_deploy, action)
84
84
  app_names.each { |app| puts "#{app}" }
85
- set :apps_deploy_confirmation, ask_confirm("Are you sure you want to #{action} these apps? (Y/N):", 'N')
85
+ set :apps_deploy_confirmation, CapistranoMulticonfigParallel.ask_confirm("Are you sure you want to #{action} these apps?", 'Y/N')
86
86
  if fetch(:apps_deploy_confirmation).blank? || (fetch(:apps_deploy_confirmation).present? && fetch(:apps_deploy_confirmation).downcase == 'n')
87
87
  return []
88
88
  elsif fetch(:apps_deploy_confirmation).present? && fetch(:apps_deploy_confirmation).downcase == 'y'
@@ -8,7 +8,7 @@ module CapistranoMulticonfigParallel
8
8
  module VERSION
9
9
  MAJOR = 0
10
10
  MINOR = 0
11
- TINY = 2
11
+ TINY = 3
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -1,2 +1 @@
1
- require 'capistrano_multiconfig_parallel/version'
2
1
  require 'capistrano_multiconfig_parallel/base'
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.0.2
4
+ version: 0.0.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-22 00:00:00.000000000 Z
11
+ date: 2015-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid-pmap
@@ -250,6 +250,26 @@ dependencies:
250
250
  - - '='
251
251
  - !ruby/object:Gem::Version
252
252
  version: 2.0.0
253
+ - !ruby/object:Gem::Dependency
254
+ name: inquirer
255
+ requirement: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - ~>
258
+ - !ruby/object:Gem::Version
259
+ version: '0.2'
260
+ - - '>='
261
+ - !ruby/object:Gem::Version
262
+ version: '0.2'
263
+ type: :runtime
264
+ prerelease: false
265
+ version_requirements: !ruby/object:Gem::Requirement
266
+ requirements:
267
+ - - ~>
268
+ - !ruby/object:Gem::Version
269
+ version: '0.2'
270
+ - - '>='
271
+ - !ruby/object:Gem::Version
272
+ version: '0.2'
253
273
  - !ruby/object:Gem::Dependency
254
274
  name: rspec-rails
255
275
  requirement: !ruby/object:Gem::Requirement
@@ -595,6 +615,7 @@ files:
595
615
  - img/parallel_demo.png
596
616
  - init.rb
597
617
  - lib/capistrano_multiconfig_parallel.rb
618
+ - lib/capistrano_multiconfig_parallel/all.rb
598
619
  - lib/capistrano_multiconfig_parallel/application.rb
599
620
  - lib/capistrano_multiconfig_parallel/base.rb
600
621
  - lib/capistrano_multiconfig_parallel/celluloid/celluloid_manager.rb
@@ -610,8 +631,6 @@ files:
610
631
  - lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
611
632
  - lib/capistrano_multiconfig_parallel/helpers/standard_deploy.rb
612
633
  - lib/capistrano_multiconfig_parallel/initializers/conf.rb
613
- - lib/capistrano_multiconfig_parallel/initializers/confirm_question.rb
614
- - lib/capistrano_multiconfig_parallel/initializers/i18n.rb
615
634
  - lib/capistrano_multiconfig_parallel/initializers/rake.rb
616
635
  - lib/capistrano_multiconfig_parallel/multi_app_helpers/dependency_tracker.rb
617
636
  - lib/capistrano_multiconfig_parallel/multi_app_helpers/interactive_menu.rb
@@ -1,25 +0,0 @@
1
-
2
- module Capistrano
3
- # class used for configuration
4
- class Configuration
5
- # class used for confirming customized questions
6
- class ConfirmQuestion < Capistrano::Configuration::Question
7
- def question
8
- I18n.t(:confirm_question, key: key, default_value: default, scope: :capistrano)
9
- end
10
- end
11
- end
12
- end
13
-
14
- Capistrano::DSL::Env.class_eval do
15
- def ask_confirm(key, value, options = {})
16
- env.ask_confirm(key, value, options)
17
- end
18
- end
19
-
20
- Capistrano::Configuration.class_eval do
21
- def ask_confirm(key, default = nil, options = {})
22
- question = Capistrano::Configuration::ConfirmQuestion.new(key, default, options)
23
- set(key, question)
24
- end
25
- end
@@ -1,10 +0,0 @@
1
- require 'i18n'
2
- en = {
3
- confirm_question: '%{key} (%{default_value}): '
4
- }
5
-
6
- I18n.backend.store_translations(:en, capistrano: en)
7
-
8
- if I18n.respond_to?(:enforce_available_locales=)
9
- I18n.enforce_available_locales = true
10
- end