wordmove 6.0.0.alpha.3 → 6.0.0.alpha.4

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
  SHA256:
3
- metadata.gz: 940d75a3bdf8e78dfff726d64c99c2a303ed0d0323c596df8617a1dc7d3e23ee
4
- data.tar.gz: 5b1c355dc1bfd4111f9f1f3cabdfae9f248dd1c4437b3111d4555b70bf6ec02f
3
+ metadata.gz: ff2399e2a947da60d6acac49fb8dc6beb32f3571d4f79cf5f1ea0c5f8f0fcfe6
4
+ data.tar.gz: 1aa500f453341eceb9a1d82d03abec6c139de29806b840d0844f578241ae696c
5
5
  SHA512:
6
- metadata.gz: 6627537b7592ba9453612c3eea7cce646ab54e8c8383c0b76fa19f6f68dd6f66a5ddb6e82739606e5a8cf5972bff566f7d5a454e9f61b46289f6a43bf543f5c0
7
- data.tar.gz: d12311a3fdd3d48e1fe041a7c58f90337364b281e9c63bda4299fcf23e50712489949860a690c803927b77d721325f962ce9fd2de8e7934ad8217ee33559272e
6
+ metadata.gz: 7e3480a25ffeff1808227e5036dc4c7e0d69d92822019b3ffb3e5d47b54bf60809d1a0951c3ee38574dd9e9f345ddcff7d49e92ab171c5930e8d2d0d9f886fd0
7
+ data.tar.gz: 5c742c2644d644f9f3d61c0d77dbc15c69957244f98c20dade5e04867b59d55202b88449ea1a9f5ff9ca2952a7e43b1db24fdf8c4e4d387438dd8b0807317096
@@ -30,8 +30,6 @@ module Wordmove
30
30
  # @!scope class
31
31
  # @return [LightService::Context] Action's context
32
32
  executed do |context| # rubocop:disable Metrics/BlockLength
33
- next context if context.database_task == false
34
-
35
33
  context.logger.task 'Adapt local DB'
36
34
 
37
35
  unless wp_in_path?
@@ -30,8 +30,6 @@ module Wordmove
30
30
  # @!scope class
31
31
  # @return [LightService::Context] Action's context
32
32
  executed do |context| # rubocop:disable Metrics/BlockLength
33
- next context if context.database_task == false
34
-
35
33
  context.logger.task 'Adapt remote DB'
36
34
 
37
35
  unless wp_in_path?
@@ -20,9 +20,7 @@ module Wordmove
20
20
  # @param logger [Wordmove::Logger]
21
21
  # @!scope class
22
22
  # @return [LightService::Context] Action's context
23
- executed do |context| # rubocop:disable Metrics/BlockLength
24
- next context if context.database_task == false
25
-
23
+ executed do |context|
26
24
  context.logger.task 'Backup local DB'
27
25
 
28
26
  if simulate?(cli_options: context.cli_options)
@@ -21,8 +21,6 @@ module Wordmove
21
21
  # @!scope class
22
22
  # @return [LightService::Context] Action's context
23
23
  executed do |context|
24
- next context if context.database_task == false
25
-
26
24
  context.logger.task 'Backup remote DB'
27
25
 
28
26
  if simulate?(cli_options: context.cli_options)
@@ -19,8 +19,6 @@ module Wordmove
19
19
  # @!scope class
20
20
  # @return [LightService::Context] Action's context
21
21
  executed do |context| # rubocop:disable Metrics/BlockLength
22
- next context if context.database_task == false
23
-
24
22
  context.logger.task 'Cleanup'
25
23
 
26
24
  if simulate?(cli_options: context.cli_options)
@@ -25,8 +25,6 @@ module Wordmove
25
25
  # @!scope class
26
26
  # @return [LightService::Context] Action's context
27
27
  executed do |context| # rubocop:disable Metrics/BlockLength
28
- next context if context.database_task == false
29
-
30
28
  context.logger.task 'Download remote DB'
31
29
 
32
30
  if simulate?(cli_options: context.cli_options)
@@ -25,8 +25,6 @@ module Wordmove
25
25
  # @!scope class
26
26
  # @return [LightService::Context] Action's context
27
27
  executed do |context| # rubocop:disable Metrics/BlockLength
28
- next context if context.database_task == false
29
-
30
28
  context.logger.task 'Upload and import adapted DB'
31
29
 
32
30
  result = Wordmove::Actions::PutFile.execute(
@@ -16,11 +16,6 @@ module Wordmove
16
16
  promises :db_paths
17
17
 
18
18
  executed do |context| # rubocop:disable Metrics/BlockLength
19
- if context.database_task == false
20
- context.db_paths = false
21
- next context
22
- end
23
-
24
19
  next context if simulate?(cli_options: context.cli_options)
25
20
 
26
21
  content_dir = local_wp_content_dir(local_options: context.local_options)
@@ -17,8 +17,6 @@ module Wordmove
17
17
  # @!scope class
18
18
  # @return [LightService::Context] Action's context
19
19
  executed do |context|
20
- next context if context.database_task == false
21
-
22
20
  context.logger.task 'Backup remote DB'
23
21
 
24
22
  if simulate?(cli_options: context.cli_options)
@@ -17,8 +17,6 @@ module Wordmove
17
17
  # @!scope class
18
18
  # @return [LightService::Context] Action's context
19
19
  executed do |context| # rubocop:disable Metrics/BlockLength
20
- next context if context.database_task == false
21
-
22
20
  context.logger.task 'Cleanup'
23
21
 
24
22
  if simulate?(cli_options: context.cli_options)
@@ -24,8 +24,6 @@ module Wordmove
24
24
  # @!scope class
25
25
  # @return [LightService::Context] Action's context
26
26
  executed do |context| # rubocop:disable Metrics/BlockLength
27
- next context if context.database_task == false
28
-
29
27
  context.logger.task 'Download remote DB'
30
28
 
31
29
  next context if simulate?(cli_options: context.cli_options)
@@ -24,8 +24,6 @@ module Wordmove
24
24
  # @!scope class
25
25
  # @return [LightService::Context] Action's context
26
26
  executed do |context| # rubocop:disable Metrics/BlockLength
27
- next context if context.database_task == false
28
-
29
27
  context.logger.task 'Upload and import adapted DB'
30
28
 
31
29
  result = Wordmove::Actions::PutFile.execute(
@@ -35,14 +35,15 @@ module Wordmove
35
35
  ->(ctx) { ctx.wordpress_task },
36
36
  [Wordmove::Actions::Ftp::PullWordpress]
37
37
  ),
38
- iterate(:folder_tasks, [Wordmove::Actions::Ftp::GetDirectory])
39
- ].concat [
40
- Wordmove::Actions::SetupContextForDb,
41
- Wordmove::Actions::BackupLocalDb,
42
- Wordmove::Actions::Ftp::DownloadRemoteDb,
43
- Wordmove::Actions::AdaptRemoteDb,
44
- Wordmove::Actions::Ftp::CleanupAfterAdapt
45
- ].concat [
38
+ iterate(:folder_tasks, [Wordmove::Actions::Ftp::GetDirectory]),
39
+ reduce_if(->(ctx) { ctx.database_task },
40
+ [
41
+ Wordmove::Actions::SetupContextForDb,
42
+ Wordmove::Actions::BackupLocalDb,
43
+ Wordmove::Actions::Ftp::DownloadRemoteDb,
44
+ Wordmove::Actions::AdaptRemoteDb,
45
+ Wordmove::Actions::Ftp::CleanupAfterAdapt
46
+ ]),
46
47
  Wordmove::Actions::RunAfterPullHook # Will fail and warn the user
47
48
  ]
48
49
  end
@@ -35,15 +35,16 @@ module Wordmove
35
35
  ->(ctx) { ctx.wordpress_task },
36
36
  [Wordmove::Actions::Ftp::PushWordpress]
37
37
  ),
38
- iterate(:folder_tasks, [Wordmove::Actions::Ftp::PutDirectory])
39
- ].concat [
40
- Wordmove::Actions::SetupContextForDb,
41
- Wordmove::Actions::Ftp::DownloadRemoteDb,
42
- Wordmove::Actions::Ftp::BackupRemoteDb,
43
- Wordmove::Actions::AdaptLocalDb,
44
- Wordmove::Actions::Ftp::PutAndImportDumpRemotely,
45
- Wordmove::Actions::Ftp::CleanupAfterAdapt
46
- ].concat [
38
+ iterate(:folder_tasks, [Wordmove::Actions::Ftp::PutDirectory]),
39
+ reduce_if(->(ctx) { ctx.database_task },
40
+ [
41
+ Wordmove::Actions::SetupContextForDb,
42
+ Wordmove::Actions::Ftp::DownloadRemoteDb,
43
+ Wordmove::Actions::Ftp::BackupRemoteDb,
44
+ Wordmove::Actions::AdaptLocalDb,
45
+ Wordmove::Actions::Ftp::PutAndImportDumpRemotely,
46
+ Wordmove::Actions::Ftp::CleanupAfterAdapt
47
+ ]),
47
48
  Wordmove::Actions::RunAfterPushHook # Will fail and warn the user
48
49
  ]
49
50
  end
@@ -35,14 +35,15 @@ module Wordmove
35
35
  ->(ctx) { ctx.wordpress_task },
36
36
  [Wordmove::Actions::Ssh::PullWordpress]
37
37
  ),
38
- iterate(:folder_tasks, [Wordmove::Actions::Ssh::GetDirectory])
39
- ].concat [
40
- Wordmove::Actions::SetupContextForDb,
41
- Wordmove::Actions::BackupLocalDb,
42
- Wordmove::Actions::Ssh::DownloadRemoteDb,
43
- Wordmove::Actions::AdaptRemoteDb,
44
- Wordmove::Actions::Ssh::CleanupAfterAdapt
45
- ].concat [
38
+ iterate(:folder_tasks, [Wordmove::Actions::Ssh::GetDirectory]),
39
+ reduce_if(->(ctx) { ctx.database_task },
40
+ [
41
+ Wordmove::Actions::SetupContextForDb,
42
+ Wordmove::Actions::BackupLocalDb,
43
+ Wordmove::Actions::Ssh::DownloadRemoteDb,
44
+ Wordmove::Actions::AdaptRemoteDb,
45
+ Wordmove::Actions::Ssh::CleanupAfterAdapt
46
+ ]),
46
47
  Wordmove::Actions::RunAfterPullHook
47
48
  ]
48
49
  end
@@ -35,15 +35,16 @@ module Wordmove
35
35
  ->(ctx) { ctx.wordpress_task },
36
36
  [Wordmove::Actions::Ssh::PushWordpress]
37
37
  ),
38
- iterate(:folder_tasks, [Wordmove::Actions::Ssh::PutDirectory])
39
- ].concat [
40
- Wordmove::Actions::SetupContextForDb,
41
- Wordmove::Actions::Ssh::DownloadRemoteDb,
42
- Wordmove::Actions::Ssh::BackupRemoteDb,
43
- Wordmove::Actions::AdaptLocalDb,
44
- Wordmove::Actions::Ssh::PutAndImportDumpRemotely,
45
- Wordmove::Actions::Ssh::CleanupAfterAdapt
46
- ].concat [
38
+ iterate(:folder_tasks, [Wordmove::Actions::Ssh::PutDirectory]),
39
+ reduce_if(->(ctx) { ctx.database_task },
40
+ [
41
+ Wordmove::Actions::SetupContextForDb,
42
+ Wordmove::Actions::Ssh::DownloadRemoteDb,
43
+ Wordmove::Actions::Ssh::BackupRemoteDb,
44
+ Wordmove::Actions::AdaptLocalDb,
45
+ Wordmove::Actions::Ssh::PutAndImportDumpRemotely,
46
+ Wordmove::Actions::Ssh::CleanupAfterAdapt
47
+ ]),
47
48
  Wordmove::Actions::RunAfterPushHook
48
49
  ]
49
50
  end
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = '6.0.0.alpha.3'.freeze
2
+ VERSION = '6.0.0.alpha.4'.freeze
3
3
  end
@@ -33,8 +33,8 @@ module Wordmove
33
33
  [
34
34
  'wp search-replace',
35
35
  "--path=#{wpcli_config_path(context)}",
36
- context.remote_options[config_key],
37
- context.local_options[config_key],
36
+ context.dig(:remote_options, config_key),
37
+ context.dig(:local_options, config_key),
38
38
  '--quiet',
39
39
  '--skip-columns=guid',
40
40
  '--all-tables',
@@ -50,7 +50,7 @@ module Wordmove
50
50
  # @return [String]
51
51
  # @!scope class
52
52
  def wpcli_config_path(context)
53
- load_from_yml(context) || load_from_wpcli || context.local_options[:wordpress_path]
53
+ load_from_yml(context) || load_from_wpcli || context.dig(:local_options, :wordpress_path)
54
54
  end
55
55
 
56
56
  # If wordpress installation brings a `wp-cli.yml` file in its root folder,
@@ -60,7 +60,7 @@ module Wordmove
60
60
  # @!scope class
61
61
  # @!visibility private
62
62
  def load_from_yml(context)
63
- yml_path = File.join(context.local_options[:wordpress_path], 'wp-cli.yml')
63
+ yml_path = File.join(context.dig(:local_options, :wordpress_path), 'wp-cli.yml')
64
64
 
65
65
  return unless File.exist?(yml_path)
66
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordmove
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.alpha.3
4
+ version: 6.0.0.alpha.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2021-12-27 00:00:00.000000000 Z
15
+ date: 2021-12-30 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport