wordmove 2.4.4 → 2.5.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: dae90dae7d1a6edaf941b62bb3af4bef9ee6dab4
4
- data.tar.gz: 9f7e990847276069517728f93d1e02e3ee973b3c
3
+ metadata.gz: a68e59fb1bab954285d92fb54a5bc22a80d3eaed
4
+ data.tar.gz: 04d2de2a8757d94e9bc2cd51bae581402c312f53
5
5
  SHA512:
6
- metadata.gz: 9e069b3d3d72ae264f35bf84584d4e8d68ce2ac7461d7292abeb9137b76d90f972d042216cc5d6a4d712931f0b3b3b445ff2d928acd4e38cdefea5ba527cc593
7
- data.tar.gz: a46fe14d6eda810e1702e43e446365d5a91c4b9dcc43e7a84f717aa95d25c5cda8f8cb449f6b5436dab755e27af4017a694e17a1663ca3d586b5c2b4f63d7999
6
+ metadata.gz: c816879ca889cc282e4f1702d411fe7aa7a122a19183a9e595b5db8eec71bd574fd286e79035cd138b897daec146618e528457409d79f3c541592c4b94e4e3ae
7
+ data.tar.gz: ab562f05754a7e759d0ef9c048ec2dc38fcd86bb14c4b9d56180a13fed07506190029016e27f9275779eaa10bfb2f50148c8c76d85d8f263e31a6c003651e0d5
@@ -20,6 +20,7 @@ module Wordmove
20
20
  mysql_client_doctor
21
21
  mysqldump_doctor
22
22
  mysql_server_doctor
23
+ mysql_database_doctor
23
24
  end
24
25
 
25
26
  private
@@ -41,30 +42,54 @@ module Wordmove
41
42
  end
42
43
 
43
44
  def mysql_server_doctor
44
- command = ["mysql"]
45
- command << "--host=#{Shellwords.escape(config[:host])}" if config[:host].present?
46
- command << "--port=#{Shellwords.escape(config[:port])}" if config[:port].present?
47
- command << "--user=#{Shellwords.escape(config[:user])}" if config[:user].present?
48
- if config[:password].present?
49
- command << "--password=#{Shellwords.escape(config[:password])}"
45
+ command = mysql_command
46
+
47
+ if system(command, out: File::NULL, err: File::NULL)
48
+ logger.success "Successfully connected to the MySQL server"
49
+ else
50
+ logger.error <<-LONG
51
+ We can't connect to the MySQL server using credentials
52
+ specified in the Movefile. Double check them or try
53
+ to debug your system configuration.
54
+
55
+ The command used to test was:
56
+
57
+ #{command}
58
+ LONG
50
59
  end
51
- command << "-e'QUIT'"
52
- command = command.join(" ")
60
+ end
61
+
62
+ def mysql_database_doctor
63
+ command = mysql_command(database: config[:name])
53
64
 
54
65
  if system(command, out: File::NULL, err: File::NULL)
55
66
  logger.success "Successfully connected to the database"
56
67
  else
57
- logger.error <<~LONG
58
- We can't connect to the database using credentials
59
- specified in the Movefile. Double check them or try
60
- to debug your system configuration.
68
+ logger.error <<-LONG
69
+ We can't connect to the database using credentials
70
+ specified in the Movefile, or the database does not
71
+ exists. Double check them or try to debug your
72
+ system configuration.
61
73
 
62
- The command used to test was:
74
+ The command used to test was:
63
75
 
64
- #{command}
76
+ #{command}
65
77
  LONG
66
78
  end
67
79
  end
80
+
81
+ def mysql_command(database: nil)
82
+ command = ["mysql"]
83
+ command << "--host=#{Shellwords.escape(config[:host])}" if config[:host].present?
84
+ command << "--port=#{Shellwords.escape(config[:port])}" if config[:port].present?
85
+ command << "--user=#{Shellwords.escape(config[:user])}" if config[:user].present?
86
+ if config[:password].present?
87
+ command << "--password=#{Shellwords.escape(config[:password])}"
88
+ end
89
+ command << database if database.present?
90
+ command << "-e'QUIT'"
91
+ command.join(" ")
92
+ end
68
93
  end
69
94
  end
70
95
  end
@@ -10,10 +10,22 @@ module Wordmove
10
10
  def check!
11
11
  logger.task "Checking local wp-cli installation"
12
12
 
13
- if in_path? && up_to_date?
14
- logger.success "wp-cli is correctly installed and up to date"
13
+ if in_path?
14
+ logger.success "wp-cli is correctly installed"
15
+
16
+ if up_to_date?
17
+ logger.success "wp-cli is up to date"
18
+ else
19
+ logger.error <<-LONG
20
+ wp-cli is not up to date.
21
+ Use `wp cli update` to update to the latest version.
22
+ LONG
23
+ end
15
24
  else
16
- logger.error "wp-cli is not installed (or not in your $PATH) or not up to date"
25
+ logger.error <<-LONG
26
+ wp-cli is not installed (or not in your $PATH).
27
+ Read http://wp-cli.org/#installing for installation info.
28
+ LONG
17
29
  end
18
30
  end
19
31
 
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = "2.4.4".freeze
2
+ VERSION = "2.5.0".freeze
3
3
  end
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: 2.4.4
4
+ version: 2.5.0
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: 2018-02-03 00:00:00.000000000 Z
15
+ date: 2018-02-13 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport