theme-juice 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/theme-juice/cli.rb +39 -53
- data/lib/theme-juice/executor.rb +62 -67
- data/lib/theme-juice/utilities.rb +4 -4
- data/lib/theme-juice/version.rb +1 -1
- metadata +1 -3
- data/lib/theme-juice/ascii/logo.txt +0 -30
- data/lib/theme-juice/ascii/smiley.txt +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d386ddfcb584a9490c945bec4aed3fca0d1e1d1
|
4
|
+
data.tar.gz: 65138f2d64836ff9432c75b0f57d5e33df05f8fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef429afe77aaf04ddc41e58fcc87a1acdefff4af6635708965f97acdd1cd4c0f9e6ea072a96b6a0e61441d66fa8aa6d2c60c31e987eb2a606ed00ea1ca2d27ec
|
7
|
+
data.tar.gz: e0da5fc6c4fd3b57ec577ca4e943ee1cf4211a6c584452d9d2af188aa156975f434a7641fe2a1d768b3694bfbede21ff2ea1066b357927cda50be425b9f8c458
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -28,24 +28,6 @@ module ThemeJuice
|
|
28
28
|
::ThemeJuice::Utilities.set_vvv_path options[:vvv_path]
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
32
|
-
###
|
33
|
-
# Welcome message
|
34
|
-
#
|
35
|
-
# @return {Void}
|
36
|
-
###
|
37
|
-
def welcome
|
38
|
-
|
39
|
-
# Get WP logo ASCII art
|
40
|
-
logo = File.read(File.expand_path("../ascii/logo.txt", __FILE__))
|
41
|
-
|
42
|
-
# Output welcome message
|
43
|
-
say "\n"
|
44
|
-
say logo.gsub(/[m]/) { |char| set_color(char, :green) }.gsub(/[\+\/\-\'\:\.\~dyhos]/) { |char| set_color(char, :yellow) }
|
45
|
-
say "\n"
|
46
|
-
say "Welcome to Theme Juice!".center(60), :green
|
47
|
-
say "\n\n"
|
48
|
-
end
|
49
31
|
end
|
50
32
|
|
51
33
|
###
|
@@ -81,7 +63,8 @@ module ThemeJuice
|
|
81
63
|
method_option :skip_db, type: :boolean, desc: "Skip database prompts and use defaults"
|
82
64
|
def create(site = nil)
|
83
65
|
self.force_vvv_path?
|
84
|
-
|
66
|
+
|
67
|
+
say " Welcome to Theme Juice!".ljust(terminal_width), [:black, :on_green, :bold]
|
85
68
|
|
86
69
|
if options[:site]
|
87
70
|
site = options[:site]
|
@@ -89,19 +72,19 @@ module ThemeJuice
|
|
89
72
|
|
90
73
|
# Check if user passed all required options through flags
|
91
74
|
if options.length >= 6
|
92
|
-
say "Well... looks like you just have everything all figured out, huh?", :
|
75
|
+
say " → Well... looks like you just have everything all figured out, huh?".ljust(terminal_width), [:black, :on_green]
|
93
76
|
elsif site.nil?
|
94
|
-
say "Just a few questions before we begin...", :
|
77
|
+
say " → Just a few questions before we begin...".ljust(terminal_width), [:black, :on_green]
|
95
78
|
else
|
96
|
-
say "Your site name shall be '#{site}'! Just a few more questions before we begin...", :
|
79
|
+
say " → Your site name shall be '#{site}'! Just a few more questions before we begin...".ljust(terminal_width), [:black, :on_green]
|
97
80
|
end
|
98
81
|
|
99
82
|
# Ask for the Site name if not passed directly
|
100
|
-
site ||= ask "What's the site name? (only ascii characters are allowed) :", :blue
|
83
|
+
site ||= ask " ○ What's the site name? (only ascii characters are allowed) :", :blue
|
101
84
|
|
102
85
|
# Make sure site name is valid
|
103
86
|
if site.match /[^0-9A-Za-z.\-]/
|
104
|
-
say "Site name contains invalid non-ascii characters. This name is used for creating directories, so that's not gonna work. Aborting mission.", :
|
87
|
+
say " ↑ Site name contains invalid non-ascii characters. This name is used for creating directories, so that's not gonna work. Aborting mission.".ljust(terminal_width), [:white, :on_red]
|
105
88
|
exit 1
|
106
89
|
end
|
107
90
|
|
@@ -116,7 +99,7 @@ module ThemeJuice
|
|
116
99
|
if options[:location]
|
117
100
|
site_location = options[:location]
|
118
101
|
else
|
119
|
-
site_location = ask "Where do you want to setup the site? :", :blue, default: "#{Dir.pwd}/", path: true
|
102
|
+
site_location = ask " ○ Where do you want to setup the site? :", :blue, default: "#{Dir.pwd}/", path: true
|
120
103
|
end
|
121
104
|
|
122
105
|
# Starter theme to clone
|
@@ -134,15 +117,16 @@ module ThemeJuice
|
|
134
117
|
"theme-juice/theme-juice-starter" => "https://github.com/ezekg/theme-juice-starter.git"
|
135
118
|
}
|
136
119
|
|
137
|
-
say "Which starter theme would you like to use?
|
120
|
+
say " ○ Which starter theme would you like to use? (partial name is acceptable)", :blue
|
138
121
|
choose do |menu|
|
139
|
-
menu.
|
122
|
+
menu.index = " ○"
|
123
|
+
menu.prompt = set_color " → Choose one :".ljust(16), :blue
|
140
124
|
|
141
125
|
themes.each do |theme, repo|
|
142
126
|
menu.choice theme do
|
143
127
|
|
144
128
|
if theme == "theme-juice/theme-juice-starter"
|
145
|
-
say "Awesome choice!", :green
|
129
|
+
say " ↑ Awesome choice!", :green
|
146
130
|
end
|
147
131
|
|
148
132
|
starter_theme = repo
|
@@ -150,11 +134,11 @@ module ThemeJuice
|
|
150
134
|
end
|
151
135
|
|
152
136
|
menu.choice "other" do
|
153
|
-
starter_theme = ask "What is the repository URL for the starter theme you would like to clone? :", :blue
|
137
|
+
starter_theme = ask " ○ What is the repository URL for the starter theme you would like to clone? :", :blue
|
154
138
|
end
|
155
139
|
|
156
140
|
menu.choice "none" do |opt|
|
157
|
-
say "Next time you
|
141
|
+
say " → Next time you need to create a site without a starter theme, you can just run the 'setup' command instead.".ljust(terminal_width), [:black, :on_yellow]
|
158
142
|
starter_theme, bare_setup = opt, true
|
159
143
|
end
|
160
144
|
end
|
@@ -165,11 +149,11 @@ module ThemeJuice
|
|
165
149
|
if options[:url]
|
166
150
|
dev_url = options[:url]
|
167
151
|
else
|
168
|
-
dev_url = ask "What do you want the development url to be? (this should end in '.dev') :", :blue, default: "#{site}.dev"
|
152
|
+
dev_url = ask " ○ What do you want the development url to be? (this should end in '.dev') :", :blue, default: "#{site}.dev"
|
169
153
|
end
|
170
154
|
|
171
155
|
unless dev_url.match /(.dev)$/
|
172
|
-
say "Your development url doesn't end with '.dev'. This is used within Vagrant, so that's not gonna work. Aborting mission.", :
|
156
|
+
say " ↑ Your development url doesn't end with '.dev'. This is used within Vagrant, so that's not gonna work. Aborting mission.".ljust(terminal_width), [:white, :on_red]
|
173
157
|
exit 1
|
174
158
|
end
|
175
159
|
|
@@ -180,8 +164,8 @@ module ThemeJuice
|
|
180
164
|
if options[:repository]
|
181
165
|
repository = options[:repository]
|
182
166
|
else
|
183
|
-
if yes? "Would you like to initialize a new Git repository? (y/N) :", :blue
|
184
|
-
repository = ask "What is the repository's URL? :", :blue
|
167
|
+
if yes? " ○ Would you like to initialize a new Git repository? (y/N) :", :blue
|
168
|
+
repository = ask " ○ What is the repository's URL? :", :blue
|
185
169
|
else
|
186
170
|
repository = false
|
187
171
|
end
|
@@ -192,28 +176,28 @@ module ThemeJuice
|
|
192
176
|
if options[:skip_db]
|
193
177
|
db_host = "vvv"
|
194
178
|
else
|
195
|
-
db_host = ask "Database host :", :blue, default: "vvv"
|
179
|
+
db_host = ask " ○ Database host :", :blue, default: "vvv"
|
196
180
|
end
|
197
181
|
|
198
182
|
# Database name
|
199
183
|
if options[:skip_db]
|
200
184
|
db_name = "#{clean_site_name}_db"
|
201
185
|
else
|
202
|
-
db_name = ask "Database name :", :blue, default: "#{clean_site_name}_db"
|
186
|
+
db_name = ask " ○ Database name :", :blue, default: "#{clean_site_name}_db"
|
203
187
|
end
|
204
188
|
|
205
189
|
# Database username
|
206
190
|
if options[:skip_db]
|
207
191
|
db_user = "#{clean_site_name}_user"
|
208
192
|
else
|
209
|
-
db_user = ask "Database username :", :blue, default: "#{clean_site_name}_user"
|
193
|
+
db_user = ask " ○ Database username :", :blue, default: "#{clean_site_name}_user"
|
210
194
|
end
|
211
195
|
|
212
196
|
# Database password
|
213
197
|
if options[:skip_db]
|
214
198
|
db_pass = SecureRandom.base64
|
215
199
|
else
|
216
|
-
db_pass = ask "Database password :", :blue, default: SecureRandom.base64
|
200
|
+
db_pass = ask " ○ Database password :", :blue, default: SecureRandom.base64
|
217
201
|
end
|
218
202
|
|
219
203
|
# Save options
|
@@ -232,25 +216,26 @@ module ThemeJuice
|
|
232
216
|
}
|
233
217
|
|
234
218
|
# Verify that all the options are correct
|
235
|
-
say "
|
236
|
-
say "
|
237
|
-
say "
|
238
|
-
say "
|
239
|
-
say "
|
240
|
-
say "
|
241
|
-
say "
|
242
|
-
say "
|
243
|
-
say "
|
244
|
-
say "
|
245
|
-
|
246
|
-
|
219
|
+
say " → Your settings :".ljust(terminal_width), [:black, :on_yellow]
|
220
|
+
say " ● Site name: #{opts[:site_name]}", :yellow
|
221
|
+
say " ● Site location: #{opts[:site_location]}", :yellow
|
222
|
+
say " ● Starter theme: #{opts[:starter_theme]}", :yellow
|
223
|
+
say " ● Development location: #{opts[:dev_location]}", :yellow
|
224
|
+
say " ● Development url: http://#{opts[:dev_url]}", :yellow
|
225
|
+
say " ● Initialized repository: #{opts[:repository]}", :yellow
|
226
|
+
say " ● Database host: #{opts[:db_host]}", :yellow
|
227
|
+
say " ● Database name: #{opts[:db_name]}", :yellow
|
228
|
+
say " ● Database username: #{opts[:db_user]}", :yellow
|
229
|
+
say " ● Database password: #{opts[:db_pass]}", :yellow
|
230
|
+
|
231
|
+
if yes? " ○ Do the options above look correct? (y/N) :", :blue
|
247
232
|
::ThemeJuice::Executor::create opts
|
248
233
|
else
|
249
|
-
say "Dang typos... aborting mission.", :
|
234
|
+
say " ↑ Dang typos... aborting mission.".ljust(terminal_width), [:white, :on_red]
|
250
235
|
exit 1
|
251
236
|
end
|
252
237
|
else
|
253
|
-
say "Site name is required. Aborting mission.", :
|
238
|
+
say " ↑ Site name is required. Aborting mission.".ljust(terminal_width), [:white, :on_red]
|
254
239
|
exit 1
|
255
240
|
end
|
256
241
|
end
|
@@ -281,7 +266,8 @@ module ThemeJuice
|
|
281
266
|
def delete(site)
|
282
267
|
self.force_vvv_path?
|
283
268
|
|
284
|
-
|
269
|
+
say " → Are you sure you want to delete '#{site}'?".ljust(terminal_width), [:white, :on_red]
|
270
|
+
if yes? " (y/N) :", :red
|
285
271
|
::ThemeJuice::Executor::delete site, options[:restart]
|
286
272
|
end
|
287
273
|
end
|
data/lib/theme-juice/executor.rb
CHANGED
@@ -37,7 +37,7 @@ module ThemeJuice
|
|
37
37
|
if @config[subcommand]
|
38
38
|
run ["#{@config[subcommand]} #{commands}"], false
|
39
39
|
else
|
40
|
-
say "Unable to find '#{subcommand}' command in '#{config_path}/tj-config.yml'. Aborting mission", :
|
40
|
+
say " ↑ Unable to find '#{subcommand}' command in '#{config_path}/tj-config.yml'. Aborting mission.".ljust(terminal_width), [:white, :on_red]
|
41
41
|
exit 1
|
42
42
|
end
|
43
43
|
end
|
@@ -52,7 +52,7 @@ module ThemeJuice
|
|
52
52
|
def create(opts)
|
53
53
|
@opts = opts
|
54
54
|
|
55
|
-
say "Running setup for '#{@opts[:site_name]}'...", :
|
55
|
+
say " → Running setup for '#{@opts[:site_name]}'...".ljust(terminal_width), [:black, :on_yellow]
|
56
56
|
|
57
57
|
unless project_dir_is_setup?
|
58
58
|
setup_project_dir
|
@@ -109,42 +109,36 @@ module ThemeJuice
|
|
109
109
|
end
|
110
110
|
|
111
111
|
if setup_was_successful?
|
112
|
-
say "Setup complete!", :
|
112
|
+
say " → Setup complete!".ljust(terminal_width), [:black, :on_green]
|
113
113
|
|
114
|
-
|
115
|
-
|
114
|
+
say " ↺ In order to finish creating your site, you need to provision Vagrant. Do it now?".ljust(terminal_width), [:black, :on_blue]
|
115
|
+
if yes? " (y/N) :", :blue
|
116
|
+
say " ● Restarting VVV...", :yellow
|
116
117
|
|
117
118
|
if restart_vagrant
|
118
119
|
|
119
|
-
#
|
120
|
-
|
121
|
-
|
122
|
-
# Output welcome message
|
123
|
-
say "\n"
|
124
|
-
say smiley, :yellow
|
125
|
-
say "\n"
|
126
|
-
say "Success!".center(48), :green
|
127
|
-
say "\n\n"
|
120
|
+
# Output success message
|
121
|
+
say " → Success!".ljust(terminal_width), [:black, :on_green]
|
128
122
|
|
129
123
|
# Output setup info
|
130
|
-
say "
|
131
|
-
say "
|
132
|
-
say "
|
133
|
-
say "
|
134
|
-
say "
|
135
|
-
say "
|
136
|
-
say "
|
137
|
-
say "
|
138
|
-
say "
|
139
|
-
say "
|
140
|
-
say "
|
124
|
+
say " → Your settings :".ljust(terminal_width), [:black, :on_green]
|
125
|
+
say " ● Site name: #{@opts[:site_name]}", :blue
|
126
|
+
say " ● Site location: #{@opts[:site_location]}", :blue
|
127
|
+
say " ● Starter theme: #{@opts[:starter_theme]}", :blue
|
128
|
+
say " ● Development location: #{@opts[:dev_location]}", :blue
|
129
|
+
say " ● Development url: http://#{@opts[:dev_url]}", :blue
|
130
|
+
say " ● Initialized repository: #{@opts[:repository]}", :blue
|
131
|
+
say " ● Database host: #{@opts[:db_host]}", :blue
|
132
|
+
say " ● Database name: #{@opts[:db_name]}", :blue
|
133
|
+
say " ● Database username: #{@opts[:db_user]}", :blue
|
134
|
+
say " ● Database password: #{@opts[:db_pass]}", :blue
|
141
135
|
end
|
142
136
|
else
|
143
|
-
say "Remember, Vagrant needs to be provisioned before you can use your new site. Exiting...", :
|
137
|
+
say " → Remember, Vagrant needs to be provisioned before you can use your new site. Exiting...".ljust(terminal_width), [:black, :on_yellow]
|
144
138
|
exit
|
145
139
|
end
|
146
140
|
else
|
147
|
-
say "Setup failed. Running cleanup...", :
|
141
|
+
say " ↑ Setup failed. Running cleanup...".ljust(terminal_width), [:white, :on_red]
|
148
142
|
delete @opts[:site_name], false
|
149
143
|
end
|
150
144
|
end
|
@@ -171,7 +165,7 @@ module ThemeJuice
|
|
171
165
|
if dev_site_is_setup?
|
172
166
|
remove_dev_site
|
173
167
|
else
|
174
|
-
say "Site '#{@opts[:site_name]}' does not exist.", :
|
168
|
+
say " ↑ Site '#{@opts[:site_name]}' does not exist.".ljust(terminal_width), [:white, :on_red]
|
175
169
|
exit 1
|
176
170
|
end
|
177
171
|
|
@@ -184,14 +178,14 @@ module ThemeJuice
|
|
184
178
|
end
|
185
179
|
|
186
180
|
if removal_was_successful?
|
187
|
-
say "Site '#{@opts[:site_name]}' successfully removed!", :
|
181
|
+
say " → Site '#{@opts[:site_name]}' successfully removed!".ljust(terminal_width), [:black, :on_green]
|
188
182
|
|
189
183
|
if restart
|
190
|
-
say "Restarting VVV...", :yellow
|
184
|
+
say " ● Restarting VVV...", :yellow
|
191
185
|
restart_vagrant
|
192
186
|
end
|
193
187
|
else
|
194
|
-
say "Site '#{@opts[:site_name]}' could not be fully be removed.", :
|
188
|
+
say " ↑ Site '#{@opts[:site_name]}' could not be fully be removed.".ljust(terminal_width), [:white, :on_red]
|
195
189
|
exit 1
|
196
190
|
end
|
197
191
|
end
|
@@ -209,9 +203,10 @@ module ThemeJuice
|
|
209
203
|
end
|
210
204
|
|
211
205
|
if sites.empty?
|
212
|
-
say "Nothing to list.
|
206
|
+
say " ● Nothing to list. Why haven't you created a site yet?", :yellow
|
213
207
|
else
|
214
|
-
|
208
|
+
say " → Your sites :".ljust(terminal_width), [:black, :on_green]
|
209
|
+
sites.each_with_index { |site, i| say " ● #{site}", :blue }
|
215
210
|
end
|
216
211
|
|
217
212
|
sites
|
@@ -246,20 +241,20 @@ module ThemeJuice
|
|
246
241
|
if config_is_setup? config_path
|
247
242
|
@config = YAML.load_file "#{config_path}/tj-config.yml"
|
248
243
|
else
|
249
|
-
say "Unable to find 'tj-config.yml' file in '#{config_path}'.", :
|
244
|
+
say " ↑ Unable to find 'tj-config.yml' file in '#{config_path}'.".ljust(terminal_width), [:white, :on_red]
|
250
245
|
|
251
|
-
if yes? "Would you like to create one? (y/N) :", :blue
|
246
|
+
if yes? " ○ Would you like to create one? (y/N) :", :blue
|
252
247
|
|
253
248
|
setup_config(config_path)
|
254
249
|
|
255
250
|
if config_is_setup? config_path
|
256
|
-
say "Please re-run the last command to continue.", :
|
251
|
+
say " → Please re-run the last command to continue.".ljust(terminal_width), [:black, :on_yellow]
|
257
252
|
exit
|
258
253
|
else
|
259
254
|
exit 1
|
260
255
|
end
|
261
256
|
else
|
262
|
-
say "A config file is needed to continue installation. Aborting mission.", :
|
257
|
+
say " ↑ A config file is needed to continue installation. Aborting mission.".ljust(terminal_width), [:white, :on_red]
|
263
258
|
exit 1
|
264
259
|
end
|
265
260
|
end
|
@@ -392,7 +387,7 @@ module ThemeJuice
|
|
392
387
|
# @return {Void}
|
393
388
|
###
|
394
389
|
def setup_vvv
|
395
|
-
say "Installing VVV into '#{File.expand_path("#{::ThemeJuice::Utilities.get_vvv_path}")}'...", :yellow
|
390
|
+
say " ● Installing VVV into '#{File.expand_path("#{::ThemeJuice::Utilities.get_vvv_path}")}'...", :yellow
|
396
391
|
run [
|
397
392
|
"vagrant plugin install vagrant-hostsupdater",
|
398
393
|
"vagrant plugin install vagrant-triggers",
|
@@ -408,7 +403,7 @@ module ThemeJuice
|
|
408
403
|
# @return {Void}
|
409
404
|
###
|
410
405
|
def setup_project_dir
|
411
|
-
say "Creating project directory tree in '#{@opts[:site_location]}'...", :yellow
|
406
|
+
say " ● Creating project directory tree in '#{@opts[:site_location]}'...", :yellow
|
412
407
|
run ["mkdir -p #{@opts[:site_location]}"]
|
413
408
|
end
|
414
409
|
|
@@ -421,7 +416,7 @@ module ThemeJuice
|
|
421
416
|
# @return {Void}
|
422
417
|
###
|
423
418
|
def setup_wildcard_subdomains
|
424
|
-
say "Setting up wildcard subdomains...", :yellow
|
419
|
+
say " ● Setting up wildcard subdomains...", :yellow
|
425
420
|
open File.expand_path("#{::ThemeJuice::Utilities.get_vvv_path}/Vagrantfile"), "a+" do |file|
|
426
421
|
file.puts "\n"
|
427
422
|
file.puts "###"
|
@@ -443,7 +438,7 @@ module ThemeJuice
|
|
443
438
|
# @return {Void}
|
444
439
|
###
|
445
440
|
def setup_dev_site
|
446
|
-
say "Setting up new development site at '#{@opts[:dev_location]}'...", :yellow
|
441
|
+
say " ● Setting up new development site at '#{@opts[:dev_location]}'...", :yellow
|
447
442
|
run [
|
448
443
|
"cd #{::ThemeJuice::Utilities.get_vvv_path}/www",
|
449
444
|
"mkdir tj-#{@opts[:site_name]}",
|
@@ -458,10 +453,10 @@ module ThemeJuice
|
|
458
453
|
# @return {Void}
|
459
454
|
###
|
460
455
|
def setup_config(config_path)
|
461
|
-
watch = ask "Watch command to use :", :blue, default: "bundle exec guard"
|
462
|
-
server = ask "Deployment command to use :", :blue, default: "bundle exec cap"
|
463
|
-
vendor = ask "Vendor command to use :", :blue, default: "composer"
|
464
|
-
install = ask "Commands to run on theme install :", :blue, default: "composer install"
|
456
|
+
watch = ask " ○ Watch command to use :", :blue, default: "bundle exec guard"
|
457
|
+
server = ask " ○ Deployment command to use :", :blue, default: "bundle exec cap"
|
458
|
+
vendor = ask " ○ Vendor command to use :", :blue, default: "composer"
|
459
|
+
install = ask " ○ Commands to run on theme install :", :blue, default: "composer install"
|
465
460
|
|
466
461
|
File.open "#{config_path}/tj-config.yml", "w" do |file|
|
467
462
|
file.puts "watch: #{watch}"
|
@@ -472,9 +467,9 @@ module ThemeJuice
|
|
472
467
|
end
|
473
468
|
|
474
469
|
if config_is_setup? config_path
|
475
|
-
say "Successfully added 'tj-config.yml' file.", :green
|
470
|
+
say " ● Successfully added 'tj-config.yml' file.", :green
|
476
471
|
else
|
477
|
-
say "Could not create 'tj-config.yml' file.", :
|
472
|
+
say " ↑ Could not create 'tj-config.yml' file.".ljust(terminal_width), [:white, :on_red]
|
478
473
|
end
|
479
474
|
end
|
480
475
|
|
@@ -489,9 +484,9 @@ module ThemeJuice
|
|
489
484
|
end
|
490
485
|
|
491
486
|
if hosts_is_setup?
|
492
|
-
say "Successfully added 'vvv-hosts' file.", :green
|
487
|
+
say " ● Successfully added 'vvv-hosts' file.", :green
|
493
488
|
else
|
494
|
-
say "Could not create 'vvv-hosts' file.", :
|
489
|
+
say " ↑ Could not create 'vvv-hosts' file.".ljust(terminal_width), [:white, :on_red]
|
495
490
|
end
|
496
491
|
end
|
497
492
|
|
@@ -513,9 +508,9 @@ module ThemeJuice
|
|
513
508
|
end
|
514
509
|
|
515
510
|
if database_is_setup?
|
516
|
-
say "Successfully added database to 'init-custom.sql'.", :green
|
511
|
+
say " ● Successfully added database to 'init-custom.sql'.", :green
|
517
512
|
else
|
518
|
-
say "Could not add database info for '#{@opts[:site_name]}' to 'init-custom.sql'.", :
|
513
|
+
say " ↑ Could not add database info for '#{@opts[:site_name]}' to 'init-custom.sql'.".ljust(terminal_width), [:white, :on_red]
|
519
514
|
end
|
520
515
|
end
|
521
516
|
|
@@ -535,9 +530,9 @@ module ThemeJuice
|
|
535
530
|
end
|
536
531
|
|
537
532
|
if nginx_is_setup?
|
538
|
-
say "Successfully added 'vvv-nginx.conf' file.", :green
|
533
|
+
say " ● Successfully added 'vvv-nginx.conf' file.", :green
|
539
534
|
else
|
540
|
-
say "Could not create 'vvv-nginx.conf' file.", :
|
535
|
+
say " ↑ Could not create 'vvv-nginx.conf' file.".ljust(terminal_width), [:white, :on_red]
|
541
536
|
end
|
542
537
|
end
|
543
538
|
|
@@ -557,9 +552,9 @@ module ThemeJuice
|
|
557
552
|
end
|
558
553
|
|
559
554
|
if env_is_setup?
|
560
|
-
say "Successfully added '.env.development' file.", :green
|
555
|
+
say " ● Successfully added '.env.development' file.", :green
|
561
556
|
else
|
562
|
-
say "Could not create '.env.development' file.", :
|
557
|
+
say " ↑ Could not create '.env.development' file.".ljust(terminal_width), [:white, :on_red]
|
563
558
|
end
|
564
559
|
end
|
565
560
|
|
@@ -571,7 +566,7 @@ module ThemeJuice
|
|
571
566
|
# @return {Void}
|
572
567
|
###
|
573
568
|
def setup_wordpress
|
574
|
-
say "Setting up WordPress...", :yellow
|
569
|
+
say " ● Setting up WordPress...", :yellow
|
575
570
|
|
576
571
|
unless @opts[:bare_setup]
|
577
572
|
run [
|
@@ -587,7 +582,7 @@ module ThemeJuice
|
|
587
582
|
# @return {Void}
|
588
583
|
###
|
589
584
|
def install_theme_dependencies
|
590
|
-
say "Installing theme dependencies...", :yellow
|
585
|
+
say " ● Installing theme dependencies...", :yellow
|
591
586
|
|
592
587
|
@config["install"].each do |command|
|
593
588
|
run ["cd #{@opts[:site_location]}", command], false
|
@@ -600,7 +595,7 @@ module ThemeJuice
|
|
600
595
|
# @return {Void}
|
601
596
|
###
|
602
597
|
def setup_synced_folder
|
603
|
-
say "Syncing host theme directory '#{@opts[:site_location]}' with VM theme directory '/srv/www/tj-#{@opts[:site_name]}'...", :yellow
|
598
|
+
say " ● Syncing host theme directory '#{@opts[:site_location]}' with VM theme directory '/srv/www/tj-#{@opts[:site_name]}'...", :yellow
|
604
599
|
|
605
600
|
open File.expand_path("#{::ThemeJuice::Utilities.get_vvv_path}/Vagrantfile"), "a+" do |file|
|
606
601
|
file.puts "### Begin '#{@opts[:site_name]}'"
|
@@ -622,7 +617,7 @@ module ThemeJuice
|
|
622
617
|
# @return {Void}
|
623
618
|
###
|
624
619
|
def setup_repo
|
625
|
-
say "Setting up Git repository at '#{@opts[:repository]}'...", :yellow
|
620
|
+
say " ● Setting up Git repository at '#{@opts[:repository]}'...", :yellow
|
626
621
|
|
627
622
|
if repo_is_setup?
|
628
623
|
run [
|
@@ -656,9 +651,9 @@ module ThemeJuice
|
|
656
651
|
end
|
657
652
|
|
658
653
|
if wpcli_is_setup?
|
659
|
-
say "Successfully added ssh settings to 'wp-cli.local.yml' file.", :green
|
654
|
+
say " ● Successfully added ssh settings to 'wp-cli.local.yml' file.", :green
|
660
655
|
else
|
661
|
-
say "Could not create 'wp-cli.local.yml' file.", :
|
656
|
+
say " ↑ Could not create 'wp-cli.local.yml' file.".ljust(terminal_width), [:white, :on_red]
|
662
657
|
end
|
663
658
|
end
|
664
659
|
|
@@ -670,14 +665,14 @@ module ThemeJuice
|
|
670
665
|
def remove_dev_site
|
671
666
|
|
672
667
|
unless Dir.entries("#{::ThemeJuice::Utilities.get_vvv_path}").include? "www"
|
673
|
-
say "Cannot load VVV path. Aborting mission before something bad happens.", :
|
668
|
+
say " ↑ Cannot load VVV path. Aborting mission before something bad happens.".ljust(terminal_width), [:white, :on_red]
|
674
669
|
exit 1
|
675
670
|
end
|
676
671
|
|
677
672
|
if run ["rm -rf #{@opts[:dev_location]}"]
|
678
|
-
say "VVV installation for '#{@opts[:site_name]}' successfully removed.", :yellow
|
673
|
+
say " ● VVV installation for '#{@opts[:site_name]}' successfully removed.", :yellow
|
679
674
|
else
|
680
|
-
say "Theme '#{@opts[:site_name]}' could not be removed. Make sure you have write capabilities.", :
|
675
|
+
say " ↑ Theme '#{@opts[:site_name]}' could not be removed. Make sure you have write capabilities.".ljust(terminal_width), [:white, :on_red]
|
681
676
|
end
|
682
677
|
end
|
683
678
|
|
@@ -688,7 +683,7 @@ module ThemeJuice
|
|
688
683
|
###
|
689
684
|
def remove_database
|
690
685
|
if remove_traces_from_file "#{::ThemeJuice::Utilities.get_vvv_path}/database/init-custom.sql"
|
691
|
-
say "Database for '#{@opts[:site_name]}' successfully removed.", :yellow
|
686
|
+
say " ● Database for '#{@opts[:site_name]}' successfully removed.", :yellow
|
692
687
|
end
|
693
688
|
end
|
694
689
|
|
@@ -699,7 +694,7 @@ module ThemeJuice
|
|
699
694
|
###
|
700
695
|
def remove_synced_folder
|
701
696
|
if remove_traces_from_file "#{::ThemeJuice::Utilities.get_vvv_path}/Vagrantfile"
|
702
|
-
say "Synced folders for '#{@opts[:site_name]}' successfully removed.", :yellow
|
697
|
+
say " ● Synced folders for '#{@opts[:site_name]}' successfully removed.", :yellow
|
703
698
|
end
|
704
699
|
end
|
705
700
|
|
@@ -722,7 +717,7 @@ module ThemeJuice
|
|
722
717
|
# Move temp file to actual file location
|
723
718
|
FileUtils.mv output_file, File.expand_path(input_file)
|
724
719
|
rescue LoadError => err
|
725
|
-
say err, :
|
720
|
+
say " ↑ #{err}".ljust(terminal_width), [:white, :on_red]
|
726
721
|
exit 1
|
727
722
|
ensure
|
728
723
|
# Make sure that the tempfile closes and is cleaned up, regardless of errors
|
@@ -23,9 +23,9 @@ module ThemeJuice
|
|
23
23
|
# @return {String}
|
24
24
|
###
|
25
25
|
def get_vvv_path
|
26
|
-
|
26
|
+
|
27
27
|
unless @@vvv_path
|
28
|
-
say "Cannot load VVV path. Aborting mission before something bad happens.", :
|
28
|
+
say " ↑ Cannot load VVV path. Aborting mission before something bad happens.".ljust(terminal_width), [:white, :on_red]
|
29
29
|
exit 1
|
30
30
|
end
|
31
31
|
|
@@ -60,9 +60,9 @@ module ThemeJuice
|
|
60
60
|
remote_version = remotes.map { |n, _| n.version }.sort.last
|
61
61
|
|
62
62
|
if ::Gem::Version.new(local_version) < ::Gem::Version.new(remote_version)
|
63
|
-
say "
|
63
|
+
say " → Your version of Theme Juice (#{local_version}) is outdated. There is a newer version (#{remote_version}) available. Please update now.".ljust(terminal_width), [:black, :on_yellow]
|
64
64
|
else
|
65
|
-
say "
|
65
|
+
say " → Your version of Theme Juice (#{local_version}) up to date.".ljust(terminal_width), [:black, :on_green]
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
data/lib/theme-juice/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme-juice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
@@ -47,8 +47,6 @@ executables:
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
-
- lib/theme-juice/ascii/logo.txt
|
51
|
-
- lib/theme-juice/ascii/smiley.txt
|
52
50
|
- lib/theme-juice/cli.rb
|
53
51
|
- lib/theme-juice/executor.rb
|
54
52
|
- lib/theme-juice/utilities.rb
|
@@ -1,30 +0,0 @@
|
|
1
|
-
'-/+osssssssssssso+/-'
|
2
|
-
./oys syo/.
|
3
|
-
.+ys: ..:/osyyhhhhyyso/:.. +sy+.
|
4
|
-
/ys: .+ydmmmmmmmmmmmmmmmmmmmdy+. :sy/
|
5
|
-
/h+' -odmmmmmmmmmmmmmmmmmmmmmmmmmmdo- '+h/
|
6
|
-
:ho' /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmds/ 'oh:
|
7
|
-
'sy. /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm+ .ys'
|
8
|
-
.ho /mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmy oh.
|
9
|
-
.h+ 'mmmmmmmm' 'mmmmmmmh +h.
|
10
|
-
'ho ' /mmmmmmmmmmo .dmmmmmmmms ~~ oh'
|
11
|
-
oy .h' ymmmmmmmmmm: /mmmmmmmmmy' -d. yo
|
12
|
-
.d- ymy 'dmmmmmmmmmd. ymmmmmmmmmh' /my -d.
|
13
|
-
oy -mmm+ /mmmmmmmmmmy .dmmmmmmmmmy ymm- yo
|
14
|
-
h+ +mmmd- smmmmmmmmmm+ /mmmmmmmmmm- :mmm+ +h
|
15
|
-
d/ smmmmh' 'dmmmmmmmmmd' smmmmmmmmm: 'dmmms /d
|
16
|
-
d/ smmmmms :mmmmmmmmm+ 'dmmmmmmmd. smmmms /d
|
17
|
-
h+ +mmmmmm/ smmmmmmmh + /mmmmmmmy /mmmmm+ +h
|
18
|
-
oy -mmmmmmd. 'dmmmmmd- +m/ smmmmmd. .dmmmmm- yo
|
19
|
-
.d- ymmmmmmh :mmmmm+ .dmd- 'dmmmm/ ymmmmmy -d.
|
20
|
-
oy .dmmmmmmo smmmh hmmmh' :mmmy +mmmmmd. yo
|
21
|
-
'ho -dmmmmmd: 'dmd+ .mmmmms smd- .dmmmmd- oh'
|
22
|
-
.h+ -dmmmmmd' :m+ dmmmmmm: 'do hmmmmd- +h.
|
23
|
-
.ho .ymmmmmy + hmmmmmmmd. :' ommmmy. oh.
|
24
|
-
'sy. /hmmmm+ ommmmmmmmmy -dmmh/ .ys'
|
25
|
-
:ho /hmmd- :mmmmmmmmmmmo 'hmh/ oh:
|
26
|
-
/h+ -odh' 'dmmmmmmmmmmmd: oo- +h/
|
27
|
-
/ys: ~~ smmmmmmmmmmmmmd' :sy/
|
28
|
-
.+ys '/osyyhhhhyyso/:' ./sy+.
|
29
|
-
./oys+ +syo/.
|
30
|
-
'-/+osssssssssssso+/-'
|
@@ -1,24 +0,0 @@
|
|
1
|
-
...gNMMM@@MMMNa+..
|
2
|
-
..M@M#"=!........?7TWMMN&,
|
3
|
-
..MMY=...'.....'...'''....?YMMa.
|
4
|
-
.JM#^..''.'''''''''''''''....'.JW@N.
|
5
|
-
.M#^.''.'.'''''''''''''''.'..''''.,WMh.
|
6
|
-
.MM5.J.J..'''.''''''''..'.JJ.,,'...''.JMN.
|
7
|
-
.MM.JY^' .MMa .'''''''.'.M"= .dMN,'.'.'.MM,
|
8
|
-
.@M.M$ @@MMN.''''''.'dF J@@MMp''''..MM,
|
9
|
-
M@^JF ?WH"Jb .'''''JF "H"^M,..'''.@N
|
10
|
-
JMF dF JN '''''.@F gF '.'.'J@F
|
11
|
-
J@''Jh.........JF .''''.4b...........MF''''.'.@b
|
12
|
-
M@ '.!!!!!!!!!!?''''''''.!!!??????????.'''''' @N
|
13
|
-
M@ '.......'.'.''.'.....'''''.'....'...''''.. @M
|
14
|
-
d@,''.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNr''''.''.@F
|
15
|
-
J@b '''JNWHHHHHHHHHHHHHHHHHHHHHHHHHHd@ ''''''J@F
|
16
|
-
MM.''' @KHHHHHHHHHHHHHHHHHHHHHHHHHHW@.''''..@M
|
17
|
-
.@N ''.JMKHHHHHHHHHHHHHHHHHHHHHHHHHM@ '''.'dM3
|
18
|
-
J@N.'''?MKHHHHHHHHHHHNHYY9HHHHHHHHMF.''..d@$
|
19
|
-
.MN,''.JMNHHHHHHHNY!.'''''..4NHNM5..''.MM^
|
20
|
-
4Mh,'..TMNHHHH@ ...'''...'..MD..''.JMY'
|
21
|
-
.W@N,''.?HNN# ...'..''J.M#^.'.'.J@#^
|
22
|
-
.TMMa,'..'T"MMQQHMH"T!..''..@MY!
|
23
|
-
'"MMNg...''''''''...+MMM"^
|
24
|
-
'""WMMM@@@MM@M#""!
|