theme-juice 0.1.8 → 0.1.9
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 +19 -9
- data/lib/theme-juice/scaffold.rb +12 -14
- data/lib/theme-juice/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 964a8ffb47c2eb9e67a2b0481a9c6bbb2376d43f
|
4
|
+
data.tar.gz: 4472173c815c9d389bcc190f1c2f5a8ee414e554
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c921f287e5cc822f5e597ba619946d5999f73767a20228a5f5bc7d60095d21f98cec629b156b62f82d40f126d1e40a11a582d505dd18ebac936714e41a70ce
|
7
|
+
data.tar.gz: 9e8f085dfb997465220e4ec70c438fc4415a61162b0cbf0aaef60cb41f4bc3b3092219ea63d2efbf24c06a508ee3320f1181c8198c68dfe34a2fb6d5a948f71d
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -13,18 +13,28 @@ module ThemeJuice
|
|
13
13
|
###
|
14
14
|
def welcome
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
# Get WP logo ASCII art
|
17
|
+
logo = File.read(File.expand_path("../ascii/logo.txt", __FILE__))
|
18
|
+
|
19
|
+
# Output welcome message
|
20
|
+
say "\n"
|
21
|
+
say logo.gsub(/[m]/) { |char| set_color(char, :green) }.gsub(/[\+\/\-\'\:\.\~dyhos]/) { |char| set_color(char, :yellow) }
|
22
|
+
say "\n"
|
23
|
+
say "Welcome to Theme Juice!".center(60), :green
|
24
|
+
say "\n\n"
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
###
|
29
|
+
# Print current version
|
30
|
+
#
|
31
|
+
# @return {String}
|
32
|
+
###
|
33
|
+
desc "version", "Print current version"
|
34
|
+
def version
|
35
|
+
say "Current version: #{::ThemeJuice::VERSION}", :green
|
36
|
+
end
|
37
|
+
|
28
38
|
###
|
29
39
|
# Install and setup VVV environment
|
30
40
|
#
|
data/lib/theme-juice/scaffold.rb
CHANGED
@@ -63,7 +63,7 @@ module ThemeJuice
|
|
63
63
|
setup_synced_folder
|
64
64
|
end
|
65
65
|
|
66
|
-
|
66
|
+
unless wpcli_is_setup?
|
67
67
|
setup_wpcli
|
68
68
|
end
|
69
69
|
|
@@ -77,11 +77,11 @@ module ThemeJuice
|
|
77
77
|
if restart_vagrant
|
78
78
|
|
79
79
|
# Get smiley ASCII art
|
80
|
-
|
80
|
+
smiley = File.read(File.expand_path("../ascii/smiley.txt", __FILE__))
|
81
81
|
|
82
82
|
# Output welcome message
|
83
83
|
say "\n"
|
84
|
-
say
|
84
|
+
say smiley, :yellow
|
85
85
|
say "\n"
|
86
86
|
say "Success!".center(48), :green
|
87
87
|
say "\n\n"
|
@@ -289,14 +289,7 @@ module ThemeJuice
|
|
289
289
|
# @return {Bool}
|
290
290
|
###
|
291
291
|
def wpcli_is_setup?
|
292
|
-
File.
|
293
|
-
end
|
294
|
-
|
295
|
-
###
|
296
|
-
# @return {Bool}
|
297
|
-
###
|
298
|
-
def wpcli_exists?
|
299
|
-
File.exists? File.expand_path("#{@opts[:site_location]}/wp-cli.yml")
|
292
|
+
File.exists? File.expand_path("#{@opts[:site_location]}/wp-cli.local.yml")
|
300
293
|
end
|
301
294
|
|
302
295
|
###
|
@@ -525,7 +518,7 @@ module ThemeJuice
|
|
525
518
|
# @return {Void}
|
526
519
|
###
|
527
520
|
def setup_wpcli
|
528
|
-
File.open "#{@opts[:site_location]}/wp-cli.yml", "a+" do |file|
|
521
|
+
File.open "#{@opts[:site_location]}/wp-cli.local.yml", "a+" do |file|
|
529
522
|
file.puts "require:"
|
530
523
|
file.puts "\t- vendor/autoload.php"
|
531
524
|
file.puts "ssh:"
|
@@ -535,7 +528,12 @@ module ThemeJuice
|
|
535
528
|
file.puts "\t\tcmd: cd ~/vagrant && vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%"
|
536
529
|
file.puts "\n"
|
537
530
|
end
|
538
|
-
|
531
|
+
|
532
|
+
if wpcli_is_setup?
|
533
|
+
say "Successfully added ssh settings to 'wp-cli.local.yml' file.", :green
|
534
|
+
else
|
535
|
+
say "Could not create 'wp-cli.local.yml' file.", :red
|
536
|
+
end
|
539
537
|
end
|
540
538
|
|
541
539
|
###
|
@@ -544,7 +542,7 @@ module ThemeJuice
|
|
544
542
|
# @return {Void}
|
545
543
|
###
|
546
544
|
def remove_dev_site
|
547
|
-
if
|
545
|
+
if run ["rm -rf #{@opts[:dev_location]}"]
|
548
546
|
say "VVV installation for '#{@opts[:site_name]}' successfully removed.", :yellow
|
549
547
|
else
|
550
548
|
say "Theme '#{@opts[:site_name]}' could not be removed. Make sure you have write capabilities.", :red
|
data/lib/theme-juice/version.rb
CHANGED