theme-juice 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a53e76ff764ee9274d0607d7fd2095100260df47
4
- data.tar.gz: 4185a029dd165675c3bd7d36173b7760babe5de3
3
+ metadata.gz: 964a8ffb47c2eb9e67a2b0481a9c6bbb2376d43f
4
+ data.tar.gz: 4472173c815c9d389bcc190f1c2f5a8ee414e554
5
5
  SHA512:
6
- metadata.gz: 0d96f30c99459f8e173e7422e336506f32b397dbf60a0f67d5fc21d8fa33e80a5a96c93ec79a2d9c36452880912cbfd9a40f27d6d2cb0025c405009921917526
7
- data.tar.gz: b6fcb290f8770f46b55bc943402832ade82e9efcea9c9ca83278e62aeb11dc0006080f2161d8eb8e7a664f96366904c67fe7a1f6509dbd8cc68f89368659d886
6
+ metadata.gz: 27c921f287e5cc822f5e597ba619946d5999f73767a20228a5f5bc7d60095d21f98cec629b156b62f82d40f126d1e40a11a582d505dd18ebac936714e41a70ce
7
+ data.tar.gz: 9e8f085dfb997465220e4ec70c438fc4415a61162b0cbf0aaef60cb41f4bc3b3092219ea63d2efbf24c06a508ee3320f1181c8198c68dfe34a2fb6d5a948f71d
@@ -13,18 +13,28 @@ module ThemeJuice
13
13
  ###
14
14
  def welcome
15
15
 
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"
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
  #
@@ -63,7 +63,7 @@ module ThemeJuice
63
63
  setup_synced_folder
64
64
  end
65
65
 
66
- if wpcli_exists? && !wpcli_is_setup?
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
- success = File.read(File.expand_path("../ascii/smiley.txt", __FILE__))
80
+ smiley = File.read(File.expand_path("../ascii/smiley.txt", __FILE__))
81
81
 
82
82
  # Output welcome message
83
83
  say "\n"
84
- say set_color(success, :yellow)
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.readlines(File.expand_path("#{@opts[:site_location]}/wp-cli.yml")).grep(/(url: #{@opts[:dev_url]})/m).any?
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
- say "Successfully added ssh settings to 'wp-cli.yml'.", :green
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 system "rm -rf #{@opts[:dev_location]}"
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
@@ -1,3 +1,3 @@
1
1
  module ThemeJuice
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse