theme-juice 0.7.7 → 0.7.8
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 +4 -4
- data/README.md +204 -204
- data/bin/tj +15 -15
- data/lib/theme-juice.rb +46 -46
- data/lib/theme-juice/cli.rb +248 -248
- data/lib/theme-juice/command.rb +20 -20
- data/lib/theme-juice/commands/create.rb +221 -221
- data/lib/theme-juice/commands/delete.rb +51 -51
- data/lib/theme-juice/commands/deploy.rb +20 -20
- data/lib/theme-juice/config.rb +68 -70
- data/lib/theme-juice/env.rb +25 -25
- data/lib/theme-juice/io.rb +323 -323
- data/lib/theme-juice/project.rb +35 -35
- data/lib/theme-juice/task.rb +42 -42
- data/lib/theme-juice/tasks/create_confirm.rb +33 -33
- data/lib/theme-juice/tasks/create_success.rb +42 -42
- data/lib/theme-juice/tasks/database.rb +50 -50
- data/lib/theme-juice/tasks/delete_confirm.rb +24 -24
- data/lib/theme-juice/tasks/delete_success.rb +31 -31
- data/lib/theme-juice/tasks/dns.rb +45 -45
- data/lib/theme-juice/tasks/dot_env.rb +53 -53
- data/lib/theme-juice/tasks/entry.rb +50 -50
- data/lib/theme-juice/tasks/hosts.rb +43 -43
- data/lib/theme-juice/tasks/import_database.rb +28 -28
- data/lib/theme-juice/tasks/landrush.rb +33 -33
- data/lib/theme-juice/tasks/list.rb +50 -50
- data/lib/theme-juice/tasks/location.rb +23 -23
- data/lib/theme-juice/tasks/nginx.rb +51 -51
- data/lib/theme-juice/tasks/repo.rb +49 -49
- data/lib/theme-juice/tasks/synced_folder.rb +30 -30
- data/lib/theme-juice/tasks/theme.rb +34 -34
- data/lib/theme-juice/tasks/vm.rb +30 -30
- data/lib/theme-juice/tasks/vm_customfile.rb +42 -42
- data/lib/theme-juice/tasks/vm_location.rb +32 -32
- data/lib/theme-juice/tasks/vm_plugins.rb +32 -32
- data/lib/theme-juice/tasks/vm_provision.rb +39 -39
- data/lib/theme-juice/tasks/vm_restart.rb +25 -25
- data/lib/theme-juice/tasks/wp_cli.rb +52 -52
- data/lib/theme-juice/util.rb +45 -45
- data/lib/theme-juice/version.rb +5 -5
- metadata +6 -7
@@ -1,34 +1,34 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class Theme < Task
|
6
|
-
|
7
|
-
def initialize(opts = {})
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
if @project.theme
|
13
|
-
clone_theme
|
14
|
-
install_theme
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def clone_theme
|
21
|
-
@io.log "Cloning theme"
|
22
|
-
@util.inside @project.location do
|
23
|
-
@util.run "git clone --depth 1 #{@project.theme} .",
|
24
|
-
:verbose => @env.verbose
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def install_theme
|
29
|
-
@io.log "Running theme installation"
|
30
|
-
@config.install
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class Theme < Task
|
6
|
+
|
7
|
+
def initialize(opts = {})
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
if @project.theme
|
13
|
+
clone_theme
|
14
|
+
install_theme
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def clone_theme
|
21
|
+
@io.log "Cloning theme"
|
22
|
+
@util.inside @project.location do
|
23
|
+
@util.run "git clone --depth 1 #{@project.theme} .",
|
24
|
+
:verbose => @env.verbose
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def install_theme
|
29
|
+
@io.log "Running theme installation"
|
30
|
+
@config.install
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/theme-juice/tasks/vm.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class VM < Task
|
6
|
-
|
7
|
-
def initialize(opts = {})
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
install_vvv
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def vvv_is_installed?
|
18
|
-
File.exist? @env.vm_path
|
19
|
-
end
|
20
|
-
|
21
|
-
def install_vvv
|
22
|
-
unless vvv_is_installed?
|
23
|
-
@io.log "Installing VVV"
|
24
|
-
@util.run "git clone https://github.com/Varying-Vagrant-Vagrants/VVV.git #{@env.vm_path} --depth 1",
|
25
|
-
:verbose => @env.verbose
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class VM < Task
|
6
|
+
|
7
|
+
def initialize(opts = {})
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
install_vvv
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def vvv_is_installed?
|
18
|
+
File.exist? @env.vm_path
|
19
|
+
end
|
20
|
+
|
21
|
+
def install_vvv
|
22
|
+
unless vvv_is_installed?
|
23
|
+
@io.log "Installing VVV"
|
24
|
+
@util.run "git clone https://github.com/Varying-Vagrant-Vagrants/VVV.git #{@env.vm_path} --depth 1",
|
25
|
+
:verbose => @env.verbose
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,42 +1,42 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class VMCustomfile < Task
|
6
|
-
|
7
|
-
def initialize(opts = {})
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
create_custom_file
|
13
|
-
end
|
14
|
-
|
15
|
-
def unexecute
|
16
|
-
remove_custom_file
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def custom_file
|
22
|
-
File.expand_path "#{@env.vm_path}/Customfile"
|
23
|
-
end
|
24
|
-
|
25
|
-
def custom_file_is_setup?
|
26
|
-
File.exist? custom_file
|
27
|
-
end
|
28
|
-
|
29
|
-
def create_custom_file
|
30
|
-
unless custom_file_is_setup?
|
31
|
-
@io.log "Creating customfile"
|
32
|
-
@util.create_file custom_file, nil, :verbose => @env.verbose
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def remove_custom_file
|
37
|
-
@io.log "Removing customfile"
|
38
|
-
@util.remove_file custom_file, :verbose => @env.verbose
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class VMCustomfile < Task
|
6
|
+
|
7
|
+
def initialize(opts = {})
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
create_custom_file
|
13
|
+
end
|
14
|
+
|
15
|
+
def unexecute
|
16
|
+
remove_custom_file
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def custom_file
|
22
|
+
File.expand_path "#{@env.vm_path}/Customfile"
|
23
|
+
end
|
24
|
+
|
25
|
+
def custom_file_is_setup?
|
26
|
+
File.exist? custom_file
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_custom_file
|
30
|
+
unless custom_file_is_setup?
|
31
|
+
@io.log "Creating customfile"
|
32
|
+
@util.create_file custom_file, nil, :verbose => @env.verbose
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def remove_custom_file
|
37
|
+
@io.log "Removing customfile"
|
38
|
+
@util.remove_file custom_file, :verbose => @env.verbose
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class VMLocation < Task
|
6
|
-
|
7
|
-
def initialize(opts = {})
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
create_path
|
13
|
-
end
|
14
|
-
|
15
|
-
def unexecute
|
16
|
-
remove_path
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def create_path
|
22
|
-
@io.log "Creating project location in VM"
|
23
|
-
@util.empty_directory @project.vm_location, :verbose => @env.verbose
|
24
|
-
end
|
25
|
-
|
26
|
-
def remove_path
|
27
|
-
@io.log "Removing project location in VM"
|
28
|
-
@util.remove_dir @project.vm_location, :verbose => @env.verbose
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class VMLocation < Task
|
6
|
+
|
7
|
+
def initialize(opts = {})
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
create_path
|
13
|
+
end
|
14
|
+
|
15
|
+
def unexecute
|
16
|
+
remove_path
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def create_path
|
22
|
+
@io.log "Creating project location in VM"
|
23
|
+
@util.empty_directory @project.vm_location, :verbose => @env.verbose
|
24
|
+
end
|
25
|
+
|
26
|
+
def remove_path
|
27
|
+
@io.log "Removing project location in VM"
|
28
|
+
@util.remove_dir @project.vm_location, :verbose => @env.verbose
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class VMPlugins < Task
|
6
|
-
|
7
|
-
def initialize(opts = {})
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
install_vagrant_plugin "vagrant-triggers", "0.5.0"
|
13
|
-
install_vagrant_plugin "vagrant-hostsupdater", "0.0.11"
|
14
|
-
install_vagrant_plugin "landrush", "0.18.0" unless @env.no_landrush
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def vagrant_plugin_is_installed?(plugin)
|
20
|
-
`vagrant plugin list`.include? plugin
|
21
|
-
end
|
22
|
-
|
23
|
-
def install_vagrant_plugin(plugin, version)
|
24
|
-
unless vagrant_plugin_is_installed? plugin
|
25
|
-
@io.log "Installing #{plugin}"
|
26
|
-
@util.run "vagrant plugin install #{plugin} --plugin-version #{version}",
|
27
|
-
:verbose => @env.verbose
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class VMPlugins < Task
|
6
|
+
|
7
|
+
def initialize(opts = {})
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
install_vagrant_plugin "vagrant-triggers", "0.5.0"
|
13
|
+
install_vagrant_plugin "vagrant-hostsupdater", "0.0.11"
|
14
|
+
install_vagrant_plugin "landrush", "0.18.0" unless @env.no_landrush
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def vagrant_plugin_is_installed?(plugin)
|
20
|
+
`vagrant plugin list`.include? plugin
|
21
|
+
end
|
22
|
+
|
23
|
+
def install_vagrant_plugin(plugin, version)
|
24
|
+
unless vagrant_plugin_is_installed? plugin
|
25
|
+
@io.log "Installing #{plugin}"
|
26
|
+
@util.run "vagrant plugin install #{plugin} --plugin-version #{version}",
|
27
|
+
:verbose => @env.verbose
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -1,39 +1,39 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class VMProvision < Task
|
6
|
-
|
7
|
-
def initialize(opts = {})
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
provision
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def vm_is_up?
|
18
|
-
res = false
|
19
|
-
|
20
|
-
@util.inside @env.vm_path do
|
21
|
-
res = @util.run("vagrant status --machine-readable", {
|
22
|
-
:verbose => @env.verbose, :capture => true}).include? "running"
|
23
|
-
end
|
24
|
-
|
25
|
-
res
|
26
|
-
end
|
27
|
-
|
28
|
-
def provision
|
29
|
-
@io.log "Provisioning VM"
|
30
|
-
@util.inside @env.vm_path do
|
31
|
-
@util.run [], :verbose => @env.verbose do |cmds|
|
32
|
-
cmds << "vagrant halt" if vm_is_up?
|
33
|
-
cmds << "vagrant up --provision"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class VMProvision < Task
|
6
|
+
|
7
|
+
def initialize(opts = {})
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
provision
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def vm_is_up?
|
18
|
+
res = false
|
19
|
+
|
20
|
+
@util.inside @env.vm_path do
|
21
|
+
res = @util.run("vagrant status --machine-readable", {
|
22
|
+
:verbose => @env.verbose, :capture => true}).include? "running"
|
23
|
+
end
|
24
|
+
|
25
|
+
res
|
26
|
+
end
|
27
|
+
|
28
|
+
def provision
|
29
|
+
@io.log "Provisioning VM"
|
30
|
+
@util.inside @env.vm_path do
|
31
|
+
@util.run [], :verbose => @env.verbose do |cmds|
|
32
|
+
cmds << "vagrant halt" if vm_is_up?
|
33
|
+
cmds << "vagrant up --provision"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class VMRestart < Task
|
6
|
-
|
7
|
-
def initialize(opts = {})
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
restart
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def restart
|
18
|
-
@io.log "Restarting VM"
|
19
|
-
@util.inside @env.vm_path do
|
20
|
-
@util.run "vagrant reload", :verbose => @env.verbose
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class VMRestart < Task
|
6
|
+
|
7
|
+
def initialize(opts = {})
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
restart
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def restart
|
18
|
+
@io.log "Restarting VM"
|
19
|
+
@util.inside @env.vm_path do
|
20
|
+
@util.run "vagrant reload", :verbose => @env.verbose
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|