wordpress-deploy 1.0.0.alpha2 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/.gitignore +7 -1
  2. data/Guardfile +1 -16
  3. data/README.md +56 -0
  4. data/lib/wordpress_deploy.rb +43 -9
  5. data/lib/wordpress_deploy/cli/helpers.rb +6 -3
  6. data/lib/wordpress_deploy/cli/utility.rb +56 -33
  7. data/lib/wordpress_deploy/config.rb +77 -0
  8. data/lib/wordpress_deploy/database/mysql.rb +281 -20
  9. data/lib/wordpress_deploy/environment.rb +85 -43
  10. data/lib/wordpress_deploy/environments.rb +89 -0
  11. data/lib/wordpress_deploy/logger.rb +3 -3
  12. data/lib/wordpress_deploy/{transfer_protocols → storage}/ftp.rb +52 -116
  13. data/lib/wordpress_deploy/storage/local.rb +12 -0
  14. data/lib/wordpress_deploy/version.rb +1 -1
  15. data/lib/wordpress_deploy/wordpress/salts.rb +68 -0
  16. data/spec/data/blue.rb +52 -0
  17. data/spec/data/development.rb +49 -0
  18. data/spec/data/green.rb +52 -0
  19. data/spec/data/production.rb +52 -0
  20. data/spec/data/red.rb +52 -0
  21. data/spec/data/wp-config.php +90 -0
  22. data/spec/spec_helper.rb +16 -5
  23. data/spec/wordpress_deploy/cli/utility_spec.rb +48 -0
  24. data/spec/{environment_spec.rb → wordpress_deploy/config_spec.rb} +9 -7
  25. data/spec/wordpress_deploy/database/mysql_spec.rb +147 -0
  26. data/spec/wordpress_deploy/environment_spec.rb +96 -0
  27. data/spec/wordpress_deploy/environments_spec.rb +65 -0
  28. data/spec/wordpress_deploy/storage/ftp_spec.rb +58 -0
  29. data/spec/wordpress_deploy/storage/local_spec.rb +0 -0
  30. data/spec/wordpress_deploy/wordpress/salts_spec.rb +70 -0
  31. data/{spec/data/wp-config-sample.php → templates/wp-config.erb} +17 -17
  32. data/wordpress_deploy.gemspec +7 -6
  33. metadata +64 -30
  34. data/Gemfile.lock +0 -83
  35. data/lib/wordpress_deploy/wordpress/configuration.rb +0 -196
  36. data/spec/data/ftp.yml +0 -4
  37. data/spec/data/wp-config.yml +0 -128
  38. data/spec/database/mysql_spec.rb +0 -93
  39. data/spec/transfer_protocols/ftp_spec.rb +0 -193
  40. data/spec/wordpress/configuration_spec.rb +0 -202
@@ -0,0 +1,12 @@
1
+ module WordpressDeploy
2
+ module Storage
3
+ class Local
4
+
5
+ def destination(new_dest = nil)
6
+ @destination = new_dest.to_s unless new_dest.nil?
7
+ @destination
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module WordpressDeploy
2
- VERSION = "1.0.0.alpha2"
2
+ VERSION = "1.0.0.rc1"
3
3
  end
@@ -0,0 +1,68 @@
1
+ module WordpressDeploy
2
+ module Wordpress
3
+ class Salts
4
+
5
+ @@keys = [
6
+ :@auth_key, :@secure_auth_key, :@logged_in_key,
7
+ :@nonce_key, :@auth_salt, :@secure_auth_salt,
8
+ :@logged_in_salt, :@nonce_salt
9
+ ]
10
+
11
+ def initialize(&block)
12
+ ##
13
+ # Create initial values for all the salts
14
+ @@keys.each { |key| instance_variable_set(key, Salts.salt) }
15
+
16
+ instance_eval(&block) if block_given?
17
+ end
18
+
19
+ ##
20
+ # Returns 64 psuedo-random characters as a string
21
+ # Characters can be a-zA-z or !@#$%^&*()-~+=|/{}:;,.?<>[]
22
+ def self.salt
23
+ salt_array.sample(64).join("")
24
+ end
25
+
26
+ ##
27
+ # Respond with the named configuration if the method name is a
28
+ # a valid configuration that has been loaded.
29
+ def method_missing(method, *args, &block)
30
+ instance_variable = "@#{method.to_s}".to_sym
31
+
32
+ if @@keys.include? instance_variable
33
+ args.flatten!
34
+ # Set the instance variable to the value passed in
35
+ unless args.empty?
36
+ instance_variable_set(instance_variable, args[0])
37
+ end
38
+
39
+ # Return the value of the instance_variable
40
+ instance_variable_get(instance_variable)
41
+ else
42
+ super
43
+ end
44
+ end
45
+
46
+ ##
47
+ # Respond to an configuration name as though it is a method.
48
+ def respond_to?(method)
49
+ instance_variable = "@#{method.to_s}".to_sym
50
+ return true if @@keys.include? instance_variable
51
+ super
52
+ end
53
+
54
+ private
55
+
56
+ def is_a_key?(potential_key)
57
+ end
58
+
59
+ ##
60
+ # The Salting array
61
+ # Provides the array of available characters that can bet used as salt
62
+ def self.salt_array
63
+ @salt_array ||= %w{0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ! @ # $ % ^ & * ( ) - ~ + = | / { } : ; , . ? < > [ ]}
64
+ end
65
+
66
+ end
67
+ end
68
+ end
data/spec/data/blue.rb ADDED
@@ -0,0 +1,52 @@
1
+ ##
2
+ # This is an example of a default WordpressDeploy configuration file. The
3
+ # values here are examples to show you what to do.
4
+ WordpressDeploy::Environment.new(:blue) do
5
+
6
+ base_url "localhost"
7
+
8
+ ##
9
+ # Connection and settings for the MySQL database that wordpress
10
+ # connects to
11
+ database do
12
+ name "blue"
13
+ user "harrison"
14
+ password "w5@reba?9?pepuk7w9a#H86ustaGawE!"
15
+ host "torphagenes.com:/tmp/mysql5.sock"
16
+ charset "utf8"
17
+ collate ""
18
+
19
+ ##
20
+ # If this parameter is not defined wp_
21
+ # is assumed.
22
+ table_prefix "wp_";
23
+ end
24
+
25
+ ##
26
+ # Authentication Unique Keys and Salts
27
+ # https://api.wordpress.org/secret-key/1.1/salt/
28
+ # If no salts are supplied they will be generated automatically
29
+ #
30
+ # NOTE This entire block is optional
31
+ salts do
32
+ #auth_key '*oH{(q=`tIzdNJKUk$XfHNNjKd$W=f$S`CtD.,;x0R}$/A,}]!+q0>>QfB#.Bsw]'
33
+ #secure_auth_key '{yg|7Q*j-?$%`b|Z!+5U,pvM,eA0+$/ruprp.mO[;|fExU:n0,-!at0+3UY@;h`X'
34
+ #logged_in_key 'k]N 9I<-rZq#k Xg)IPhv$E*ktbD7Z_AtI){U;(P;0r#LJlYncEr%8v9tG`>BHU+'
35
+ #nonce_key ' /w9->::-YB Xa#lf%TPH+cIf?]Ru4OfKGF2h8PHsa)2,n-~kRJ<[slUg<GZ Asx'
36
+ #auth_salt 'VYwGGP,#|9P[5RCUTdv2c8)`^{dotU0fWrU`JE9qq^n=F4//e)fCs<HF6sd>~yjW'
37
+ #secure_auth_salt 'ok}@vSs=n6%_%UCO|&[?Jc;,-,.#Q3}zR4ej%IoAL7RavTN/Xe,UrQ4)p}onRie0'
38
+ #logged_in_salt 'Z!,C*:Q_I9A`[pJm-b0Z/(Gm2qvK8>0~| T&)lM+sxG.OdEmgHbAGF&(^>2.rDGW'
39
+ #nonce_salt 'ay)${bFV=F1KH[`NZ+W+Zk?Hc:@}jN}Ec)+Zn[F1fyP,mwi|@tk/(1hdp[G2F%os'
40
+ end
41
+
42
+ ##
43
+ # Block defines the settings for the transfer of files
44
+ # to this configuration.
45
+ transfer :Ftp do
46
+ host "ftp.torphagenes.com"
47
+ user "harrison"
48
+ password "w5@reba?9?pepuk7w9a#H86ustaGawE!"
49
+ destination "/wordpress"
50
+ end
51
+
52
+ end
@@ -0,0 +1,49 @@
1
+ ##
2
+ # This is an example of a default WordpressDeploy configuration file. The
3
+ # values here are examples to show you what to do.
4
+ WordpressDeploy::Environment.new(:development) do
5
+
6
+ base_url "localhost"
7
+
8
+ ##
9
+ # Connection and settings for the MySQL database that wordpress
10
+ # connects to
11
+ database do
12
+ name "developer_database_name"
13
+ user "root"
14
+ password "q9&hu6Re_*dReWr_GAba_2wr89#2Ra8$"
15
+ host "localhost"
16
+ charset "utf8"
17
+ collate ""
18
+
19
+ ##
20
+ # If this parameter is not defined wp_
21
+ # is assumed.
22
+ table_prefix "wp_";
23
+ end
24
+
25
+ ##
26
+ # Authentication Unique Keys and Salts
27
+ # https://api.wordpress.org/secret-key/1.1/salt/
28
+ # If no salts are supplied they will be generated automatically
29
+ #
30
+ # NOTE This entire block is optional
31
+ salts do
32
+ #auth_key '*oH{(q=`tIzdNJKUk$XfHNNjKd$W=f$S`CtD.,;x0R}$/A,}]!+q0>>QfB#.Bsw]'
33
+ #secure_auth_key '{yg|7Q*j-?$%`b|Z!+5U,pvM,eA0+$/ruprp.mO[;|fExU:n0,-!at0+3UY@;h`X'
34
+ #logged_in_key 'k]N 9I<-rZq#k Xg)IPhv$E*ktbD7Z_AtI){U;(P;0r#LJlYncEr%8v9tG`>BHU+'
35
+ #nonce_key ' /w9->::-YB Xa#lf%TPH+cIf?]Ru4OfKGF2h8PHsa)2,n-~kRJ<[slUg<GZ Asx'
36
+ #auth_salt 'VYwGGP,#|9P[5RCUTdv2c8)`^{dotU0fWrU`JE9qq^n=F4//e)fCs<HF6sd>~yjW'
37
+ #secure_auth_salt 'ok}@vSs=n6%_%UCO|&[?Jc;,-,.#Q3}zR4ej%IoAL7RavTN/Xe,UrQ4)p}onRie0'
38
+ #logged_in_salt 'Z!,C*:Q_I9A`[pJm-b0Z/(Gm2qvK8>0~| T&)lM+sxG.OdEmgHbAGF&(^>2.rDGW'
39
+ #nonce_salt 'ay)${bFV=F1KH[`NZ+W+Zk?Hc:@}jN}Ec)+Zn[F1fyP,mwi|@tk/(1hdp[G2F%os'
40
+ end
41
+
42
+ ##
43
+ # Block defines the settings for the transfer of files
44
+ # to this configuration.
45
+ transfer :Local do
46
+ destination "/wordpress"
47
+ end
48
+
49
+ end
@@ -0,0 +1,52 @@
1
+ ##
2
+ # This is an example of a default WordpressDeploy configuration file. The
3
+ # values here are examples to show you what to do.
4
+ WordpressDeploy::Environment.new(:green) do
5
+
6
+ base_url "localhost"
7
+
8
+ ##
9
+ # Connection and settings for the MySQL database that wordpress
10
+ # connects to
11
+ database do
12
+ name "green"
13
+ user "domenick.dare"
14
+ password "Daw&HEWuzaz6sa&epHech_spAKucHaTH"
15
+ host "yundt.org"
16
+ charset "utf8"
17
+ collate ""
18
+
19
+ ##
20
+ # If this parameter is not defined wp_
21
+ # is assumed.
22
+ table_prefix "wp_";
23
+ end
24
+
25
+ ##
26
+ # Authentication Unique Keys and Salts
27
+ # https://api.wordpress.org/secret-key/1.1/salt/
28
+ # If no salts are supplied they will be generated automatically
29
+ #
30
+ # NOTE This entire block is optional
31
+ salts do
32
+ #auth_key '*oH{(q=`tIzdNJKUk$XfHNNjKd$W=f$S`CtD.,;x0R}$/A,}]!+q0>>QfB#.Bsw]'
33
+ #secure_auth_key '{yg|7Q*j-?$%`b|Z!+5U,pvM,eA0+$/ruprp.mO[;|fExU:n0,-!at0+3UY@;h`X'
34
+ #logged_in_key 'k]N 9I<-rZq#k Xg)IPhv$E*ktbD7Z_AtI){U;(P;0r#LJlYncEr%8v9tG`>BHU+'
35
+ #nonce_key ' /w9->::-YB Xa#lf%TPH+cIf?]Ru4OfKGF2h8PHsa)2,n-~kRJ<[slUg<GZ Asx'
36
+ #auth_salt 'VYwGGP,#|9P[5RCUTdv2c8)`^{dotU0fWrU`JE9qq^n=F4//e)fCs<HF6sd>~yjW'
37
+ #secure_auth_salt 'ok}@vSs=n6%_%UCO|&[?Jc;,-,.#Q3}zR4ej%IoAL7RavTN/Xe,UrQ4)p}onRie0'
38
+ #logged_in_salt 'Z!,C*:Q_I9A`[pJm-b0Z/(Gm2qvK8>0~| T&)lM+sxG.OdEmgHbAGF&(^>2.rDGW'
39
+ #nonce_salt 'ay)${bFV=F1KH[`NZ+W+Zk?Hc:@}jN}Ec)+Zn[F1fyP,mwi|@tk/(1hdp[G2F%os'
40
+ end
41
+
42
+ ##
43
+ # Block defines the settings for the transfer of files
44
+ # to this configuration.
45
+ transfer :Ftp do
46
+ host "ftp.yundt.org"
47
+ user "domenick.dare"
48
+ password "Daw&HEWuzaz6sa&epHech_spAKucHaTH"
49
+ destination "/wordpress"
50
+ end
51
+
52
+ end
@@ -0,0 +1,52 @@
1
+ ##
2
+ # This is an example of a default WordpressDeploy configuration file. The
3
+ # values here are examples to show you what to do.
4
+ WordpressDeploy::Environment.new(:production) do
5
+
6
+ base_url "localhost"
7
+
8
+ ##
9
+ # Connection and settings for the MySQL database that wordpress
10
+ # connects to
11
+ database do
12
+ name "production_database_name"
13
+ user "some_user"
14
+ password "trecuwawraJaZe6P@kucraDrachustUq"
15
+ host "abbott.biz:6654"
16
+ charset "utf8"
17
+ collate ""
18
+
19
+ ##
20
+ # If this parameter is not defined wp_
21
+ # is assumed.
22
+ table_prefix "wp_";
23
+ end
24
+
25
+ ##
26
+ # Authentication Unique Keys and Salts
27
+ # https://api.wordpress.org/secret-key/1.1/salt/
28
+ # If no salts are supplied they will be generated automatically
29
+ #
30
+ # NOTE This entire block is optional
31
+ salts do
32
+ #auth_key '*oH{(q=`tIzdNJKUk$XfHNNjKd$W=f$S`CtD.,;x0R}$/A,}]!+q0>>QfB#.Bsw]'
33
+ #secure_auth_key '{yg|7Q*j-?$%`b|Z!+5U,pvM,eA0+$/ruprp.mO[;|fExU:n0,-!at0+3UY@;h`X'
34
+ #logged_in_key 'k]N 9I<-rZq#k Xg)IPhv$E*ktbD7Z_AtI){U;(P;0r#LJlYncEr%8v9tG`>BHU+'
35
+ #nonce_key ' /w9->::-YB Xa#lf%TPH+cIf?]Ru4OfKGF2h8PHsa)2,n-~kRJ<[slUg<GZ Asx'
36
+ #auth_salt 'VYwGGP,#|9P[5RCUTdv2c8)`^{dotU0fWrU`JE9qq^n=F4//e)fCs<HF6sd>~yjW'
37
+ #secure_auth_salt 'ok}@vSs=n6%_%UCO|&[?Jc;,-,.#Q3}zR4ej%IoAL7RavTN/Xe,UrQ4)p}onRie0'
38
+ #logged_in_salt 'Z!,C*:Q_I9A`[pJm-b0Z/(Gm2qvK8>0~| T&)lM+sxG.OdEmgHbAGF&(^>2.rDGW'
39
+ #nonce_salt 'ay)${bFV=F1KH[`NZ+W+Zk?Hc:@}jN}Ec)+Zn[F1fyP,mwi|@tk/(1hdp[G2F%os'
40
+ end
41
+
42
+ ##
43
+ # Block defines the settings for the transfer of files
44
+ # to this configuration.
45
+ transfer :Ftp do
46
+ host "ftp.abbott.biz:6655"
47
+ user "some_user"
48
+ password "trecuwawraJaZe6P@kucraDrachustUq"
49
+ end
50
+
51
+ end
52
+
data/spec/data/red.rb ADDED
@@ -0,0 +1,52 @@
1
+ ##
2
+ # This is an example of a default WordpressDeploy configuration file. The
3
+ # values here are examples to show you what to do.
4
+ WordpressDeploy::Environment.new(:red) do
5
+
6
+ base_url "localhost"
7
+
8
+ ##
9
+ # Connection and settings for the MySQL database that wordpress
10
+ # connects to
11
+ database do
12
+ name "red"
13
+ user "red_user"
14
+ password "Bun__huPEMeBreM6tebRAp@eguzuQExe"
15
+ host "hanerutherford.biz"
16
+ charset "utf8"
17
+ collate ""
18
+
19
+ ##
20
+ # If this parameter is not defined wp_
21
+ # is assumed.
22
+ table_prefix "wp_";
23
+ end
24
+
25
+ ##
26
+ # Authentication Unique Keys and Salts
27
+ # https://api.wordpress.org/secret-key/1.1/salt/
28
+ # If no salts are supplied they will be generated automatically
29
+ #
30
+ # NOTE This entire block is optional
31
+ salts do
32
+ auth_key '*oH{(q=`tIzdNJKUk$XfHNNjKd$W=f$S`CtD.,;x0R}$/A,}]!+q0>>QfB#.Bsw]'
33
+ secure_auth_key '{yg|7Q*j-?$%`b|Z!+5U,pvM,eA0+$/ruprp.mO[;|fExU:n0,-!at0+3UY@;h`X'
34
+ logged_in_key 'k]N 9I<-rZq#k Xg)IPhv$E*ktbD7Z_AtI){U;(P;0r#LJlYncEr%8v9tG`>BHU+'
35
+ nonce_key ' /w9->::-YB Xa#lf%TPH+cIf?]Ru4OfKGF2h8PHsa)2,n-~kRJ<[slUg<GZ Asx'
36
+ auth_salt 'VYwGGP,#|9P[5RCUTdv2c8)`^{dotU0fWrU`JE9qq^n=F4//e)fCs<HF6sd>~yjW'
37
+ secure_auth_salt 'ok}@vSs=n6%_%UCO|&[?Jc;,-,.#Q3}zR4ej%IoAL7RavTN/Xe,UrQ4)p}onRie0'
38
+ logged_in_salt 'Z!,C*:Q_I9A`[pJm-b0Z/(Gm2qvK8>0~| T&)lM+sxG.OdEmgHbAGF&(^>2.rDGW'
39
+ nonce_salt 'ay)${bFV=F1KH[`NZ+W+Zk?Hc:@}jN}Ec)+Zn[F1fyP,mwi|@tk/(1hdp[G2F%os'
40
+ end
41
+
42
+ ##
43
+ # Block defines the settings for the transfer of files
44
+ # to this configuration.
45
+ transfer :Ftp do
46
+ host "ftp.hanerutherford.biz"
47
+ user "red_user"
48
+ password "Bun__huPEMeBreM6tebRAp@eguzuQExe"
49
+ destination "/html"
50
+ end
51
+
52
+ end
@@ -0,0 +1,90 @@
1
+ <?php
2
+ /**
3
+ * The base configurations of the WordPress.
4
+ *
5
+ * This file has the following configurations: MySQL settings, Table Prefix,
6
+ * Secret Keys, WordPress Language, and ABSPATH. You can find more information
7
+ * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
8
+ * wp-config.php} Codex page. You can get the MySQL settings from your web host.
9
+ *
10
+ * This file is used by the wp-config.php creation script during the
11
+ * installation. You don't have to use the web site, you can just copy this file
12
+ * to "wp-config.php" and fill in the values.
13
+ *
14
+ * @package WordPress
15
+ */
16
+
17
+ // ** MySQL settings - You can get this info from your web host ** //
18
+ /** The name of the database for WordPress */
19
+ define('DB_NAME', 'production_database_name');
20
+
21
+ /** MySQL database username */
22
+ define('DB_USER', 'some_user');
23
+
24
+ /** MySQL database password */
25
+ define('DB_PASSWORD', 'trecuwawraJaZe6P@kucraDrachustUq');
26
+
27
+ /** MySQL hostname */
28
+ define('DB_HOST', 'abbott.biz:6654');
29
+
30
+ /** Database Charset to use in creating database tables. */
31
+ define('DB_CHARSET', 'utf8');
32
+
33
+ /** The Database Collate type. Don't change this if in doubt. */
34
+ define('DB_COLLATE', 'ryan-collate');
35
+
36
+ /**#@+
37
+ * Authentication Unique Keys and Salts.
38
+ *
39
+ * Change these to different unique phrases!
40
+ * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
41
+ * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
42
+ *
43
+ * @since 2.6.0
44
+ */
45
+ define('AUTH_KEY', '<r-*;SgTbz7&}VlyE.[H,F~4GB+s>)MRm9Y8KuUw{c15!Q3i/vIqtA^|jOPa6feW');
46
+ define('SECURE_AUTH_KEY', 'a%*bxGH)us+mQOPh7[I2$U{;Eijk.r#w!T>NZz&S?<V:AWY~vyC]3odLe}q9D56t');
47
+ define('LOGGED_IN_KEY', 'k#>.*)5W,V|OJSHRF?;dvmb/{LGg8hNB2ZQK]s$0+-1Itw7ux^YElr@9fn6i<P4j');
48
+ define('NONCE_KEY', 'hCOW{xmyPG*z;oYJtgRvMFrnI.k0%&1KL,ewUT^2!>up=E:QD/)+d[|6$#?qSs]<');
49
+ define('AUTH_SALT', '~qC3]YB&ou/ry6<z{-WhPNR|I.mL2)XdHS+1p}?Ql^MKEiGA(>:f=#tc%;84Tkx7');
50
+ define('SECURE_AUTH_SALT', 'RF,ZU<H^$Cgq}8S&[Y4zE65OBW(+.:0LDMGlr/ujk#JT{-?;29iyP*d~)nVp1cbe');
51
+ define('LOGGED_IN_SALT', 'aT6q#EXyj3s*=Qf%0doLFc$?@O4i:S)I[GZRH/PWJw{^mY8(N,.xpMVD91etnv}&');
52
+ define('NONCE_SALT', 'FSOjHgapy-3b>&B^c@Pzw49ALqZ!<M7uvGJUnV;t#.C/kxoX:5*}{21=hsRT?l8,');
53
+
54
+ /**#@-*/
55
+
56
+ /**
57
+ * WordPress Database Table prefix.
58
+ *
59
+ * You can have multiple installations in one database if you give each a unique
60
+ * prefix. Only numbers, letters, and underscores please!
61
+ */
62
+ $table_prefix = 'ryan_';
63
+
64
+ /**
65
+ * WordPress Localized Language, defaults to English.
66
+ *
67
+ * Change this to localize WordPress. A corresponding MO file for the chosen
68
+ * language must be installed to wp-content/languages. For example, install
69
+ * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
70
+ * language support.
71
+ */
72
+ define('WPLANG', 'de_DE');
73
+
74
+ /**
75
+ * For developers: WordPress debugging mode.
76
+ *
77
+ * Change this to true to enable the display of notices during development.
78
+ * It is strongly recommended that plugin and theme developers use WP_DEBUG
79
+ * in their development environments.
80
+ */
81
+ define('WP_DEBUG', true);
82
+
83
+ /* That's all, stop editing! Happy blogging. */
84
+
85
+ /** Absolute path to the WordPress directory. */
86
+ if ( !defined('ABSPATH') )
87
+ define('ABSPATH', dirname(__FILE__) . '/');
88
+
89
+ /** Sets up WordPress vars and included files. */
90
+ require_once(ABSPATH . 'wp-settings.php');
data/spec/spec_helper.rb CHANGED
@@ -7,6 +7,12 @@ def data_dir
7
7
  File.join(File.dirname(__FILE__), "data")
8
8
  end
9
9
 
10
+ # Set shell to basic
11
+ $0 = "thor"
12
+ $thor_runner = true
13
+ ARGV.clear
14
+ Thor::Base.shell = Thor::Shell::Basic
15
+
10
16
  RSpec.configure do |config|
11
17
  # == Mock Framework
12
18
  #
@@ -19,15 +25,20 @@ RSpec.configure do |config|
19
25
 
20
26
  # Reset the environment for each spec that is run
21
27
  config.before(:each) do
22
- WordpressDeploy::Environment.root_dir = data_dir
23
- WordpressDeploy::Environment.wp_dir = "."
24
- WordpressDeploy::Environment.config_dir = "."
25
- WordpressDeploy::Environment.logging = false
28
+ WordpressDeploy::Config.root_dir = data_dir
29
+ WordpressDeploy::Config.wp_dir = "."
30
+ WordpressDeploy::Config.config_dir = "."
31
+ WordpressDeploy::Config.sql_dir = "."
32
+ WordpressDeploy::Config.logging = false
33
+ end
34
+
35
+ config.before(:all) do
36
+ WordpressDeploy::Environments.load
26
37
  end
27
38
 
28
39
  # Clean-up log files after each spec
29
40
  config.after(:all) do
30
- WordpressDeploy::Environment.clean!
41
+ WordpressDeploy::Config.clean!
31
42
  end
32
43
 
33
44
  end