theme-juice 0.1.1 → 0.1.2
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/scaffold.rb +42 -2
- data/lib/theme-juice/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d52c78f103373783f18718a99995d629cad4f2fb
|
4
|
+
data.tar.gz: a700756fe35dd8eebf53d0381a2502fd5cc7fe88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1abf98f228790378b447d279cc99c90bab231b7a0ec2385ed6d344eb2f4056f8380eab59959e9932f431875136bd227fb9597ee6476068bb6b403b31486c75a
|
7
|
+
data.tar.gz: 09e926f758aff262b986578c3f4d8790eb3b838ed44e644bd02f8c33223746ab2c8b604e5ea780d2e9668c3a48fdb92a6b18c7d9899e4a31054fd2b6f40d1c70
|
data/lib/theme-juice/scaffold.rb
CHANGED
@@ -63,6 +63,10 @@ module ThemeJuice
|
|
63
63
|
setup_synced_folder
|
64
64
|
end
|
65
65
|
|
66
|
+
unless wpcli_is_setup?
|
67
|
+
setup_wpcli
|
68
|
+
end
|
69
|
+
|
66
70
|
if @opts[:repository]
|
67
71
|
setup_repo
|
68
72
|
end
|
@@ -266,13 +270,20 @@ module ThemeJuice
|
|
266
270
|
File.exists? File.expand_path("#{@opts[:site_location]}/.env.development")
|
267
271
|
end
|
268
272
|
|
273
|
+
###
|
274
|
+
# @return {Bool}
|
275
|
+
###
|
276
|
+
def wpcli_is_setup?
|
277
|
+
File.readlines(File.expand_path("#{@opts[:site_location]}/wp-cli.yml")).grep(/(### Begin '#{@opts[:site_name]}')/m).any?
|
278
|
+
end
|
279
|
+
|
269
280
|
###
|
270
281
|
# Install plugins and clone VVV
|
271
282
|
#
|
272
283
|
# @return {Void}
|
273
284
|
###
|
274
285
|
def setup_vvv
|
275
|
-
say "Installing VVV into '#{File.expand_path("~/vagrant")}'
|
286
|
+
say "Installing VVV into '#{File.expand_path("~/vagrant")}'...", :yellow
|
276
287
|
system [
|
277
288
|
"vagrant plugin install vagrant-hostsupdater",
|
278
289
|
"vagrant plugin install vagrant-triggers",
|
@@ -314,7 +325,7 @@ module ThemeJuice
|
|
314
325
|
# @return {Void}
|
315
326
|
###
|
316
327
|
def setup_dev_site
|
317
|
-
say "Setting up new development site at '#{@opts[:dev_location]}'
|
328
|
+
say "Setting up new development site at '#{@opts[:dev_location]}'...", :yellow
|
318
329
|
system [
|
319
330
|
"cd ~/vagrant/www",
|
320
331
|
"mkdir tj-#{@opts[:site_name]}"
|
@@ -473,6 +484,35 @@ module ThemeJuice
|
|
473
484
|
].join " && "
|
474
485
|
end
|
475
486
|
|
487
|
+
###
|
488
|
+
# Add wp-cli-ssh block to wp-cli.yml
|
489
|
+
#
|
490
|
+
# @return {Void}
|
491
|
+
###
|
492
|
+
def setup_wpcli
|
493
|
+
File.open "#{@opts[:site_location]}/wp-cli.yml", "a+" do |file|
|
494
|
+
file.puts "### Begin '#{@opts[:site_name]}'"
|
495
|
+
file.puts "#"
|
496
|
+
file.puts "# This block is automatically generated by ThemeJuice. Do not edit."
|
497
|
+
file.puts "###"
|
498
|
+
file.puts "require:"
|
499
|
+
file.puts "\t- vendor/autoload.php"
|
500
|
+
file.puts "ssh:"
|
501
|
+
file.puts "\tvagrant:"
|
502
|
+
file.puts "\t\turl: #{@opts[:dev_url]}"
|
503
|
+
file.puts "\t\tpath: /srv/www/tj-#{@opts[:site_name]}"
|
504
|
+
file.puts "\t\tcmd: cd ~/vagrant && vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%"
|
505
|
+
file.puts "### End '#{@opts[:site_name]}'"
|
506
|
+
file.puts "\n"
|
507
|
+
end
|
508
|
+
|
509
|
+
if wpcli_is_setup?
|
510
|
+
say "Successfully added ssh settings to 'wp-cli.yml'.", :green
|
511
|
+
else
|
512
|
+
say "Could not add ssh settings for '#{@opts[:site_name]}' to 'wp-cli.yml'.", :red
|
513
|
+
end
|
514
|
+
end
|
515
|
+
|
476
516
|
###
|
477
517
|
# Remove all theme files from Vagrant directory
|
478
518
|
#
|
data/lib/theme-juice/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme-juice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|