theme-juice 0.26.2 → 0.26.3

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: 18fed89907f2b222c1212bfc73e86af92d5256b3
4
- data.tar.gz: b293d6edb73a89dcfee197170fc6fa9c0cf97021
3
+ metadata.gz: 993a7061f134c09e5214a50afd234d7c72f3e56a
4
+ data.tar.gz: cac7fcedefb39e8d768727237ed03014522f4dfe
5
5
  SHA512:
6
- metadata.gz: d4438d9c8a2593149e2b835db3a47f2c2321b42b53b89de5d7edbd4ee641c748b7dbccc8f83ff7be7f12eabedbbb82c3997156893271a3229d185b86f88c60f0
7
- data.tar.gz: e0475d25a7091f9de01eb5930f6cb8944c8d7307ba0800c5ac90fa74933d0958f50f4b8fbcbac57886769a6409f7f2bfeb19fd01080874e078ee0680d7eaf7b8
6
+ metadata.gz: 060a2da004e18ec839ab6e25d7bdd0fb95c9f1a50ac1e75e783056590e4ad25d804836987e4fb4406a3ef5b19c7bded3cc1126cc46ed022b9613a3bef4ab6295
7
+ data.tar.gz: 4e738554ac822d7e020f200b60570d8cf39b2cb022b0544d3e34cceb2d71c0cc947dd812012a07a26920e56fc142f424016f42963aa5075c425733b4e6ae4d07
@@ -121,7 +121,7 @@ module ThemeJuice
121
121
  end
122
122
 
123
123
  desc "init", "Initialize the VM"
124
- method_option :provision, :type => :boolean, :aliases => %w[--restart], :desc => ""
124
+ method_option :provision, :type => :boolean, :desc => ""
125
125
  def init
126
126
  @io.say "Initializing the VM...", {
127
127
  :color => [:black, :on_green, :bold],
@@ -148,6 +148,7 @@ module ThemeJuice
148
148
  method_option :no_config, :type => :boolean, :aliases => %w[--no-juicefile], :desc => ""
149
149
  method_option :wp_config_modify, :type => :boolean, :aliases => %w[--modify-wp-config], :desc => ""
150
150
  method_option :no_ssl, :type => :boolean, :aliases => %w[--no-https], :desc => ""
151
+ method_option :provision, :type => :boolean, :desc => ""
151
152
  def create
152
153
  @io.hello
153
154
  @create.new(options).execute
@@ -169,6 +170,7 @@ module ThemeJuice
169
170
  method_option :no_config, :type => :boolean, :aliases => %w[--no-juicefile], :desc => ""
170
171
  method_option :wp_config_modify, :type => :boolean, :aliases => %w[--modify-wp-config], :desc => ""
171
172
  method_option :no_ssl, :type => :boolean, :aliases => %w[--no-https], :desc => ""
173
+ method_option :provision, :type => :boolean, :desc => ""
172
174
  def setup
173
175
  @io.hello
174
176
  @create.new(options.dup.merge(:bare => true)).execute
@@ -41,7 +41,11 @@ module ThemeJuice
41
41
  tasks << Tasks::DNS.new
42
42
  tasks << Tasks::WPCLI.new
43
43
  tasks << Tasks::Repo.new
44
- tasks << Tasks::VMRestart.new
44
+ if @project.provision
45
+ tasks << Tasks::VMProvision.new
46
+ else
47
+ tasks << Tasks::VMRestart.new
48
+ end
45
49
  tasks << Tasks::ImportDatabase.new
46
50
  tasks << Tasks::CreateSuccess.new
47
51
  end
@@ -60,6 +64,7 @@ module ThemeJuice
60
64
  @project.wp_config_modify = @opts.fetch("wp_config_modify") { false }
61
65
  @project.no_config = @opts.fetch("no_config") { false }
62
66
  @project.no_ssl = @opts.fetch("no_ssl") { false }
67
+ @project.provision = @opts.fetch("provision") { false }
63
68
  @project.no_env = @opts.fetch("no_env") { @project.wp_config_modify }
64
69
  @project.name = @opts.fetch("name") { name }
65
70
  @project.location = @opts.fetch("location") { location }
@@ -92,7 +97,7 @@ module ThemeJuice
92
97
  @io.error "Project name '#{name}' looks like it's empty. Aborting mission."
93
98
  end
94
99
 
95
- "#{name}".match /[^0-9A-Za-z.\-]/ do |char|
100
+ "#{name}".match /[^0-9a-z\.\-]/ do |char|
96
101
  @io.error "Project name contains an invalid character '#{char}'. This name is used internally for a ton of stuff, so that's not gonna work. Aborting mission."
97
102
  end
98
103
 
@@ -133,6 +138,10 @@ module ThemeJuice
133
138
  @io.error "Your development url '#{url}' doesn't end with '.dev'. This is used internally by Landrush, so that's not gonna work. Aborting mission."
134
139
  end
135
140
 
141
+ "#{url}".match /[^0-9a-z\.\-]/ do |char|
142
+ @io.error "Your development url contains an invalid character '#{char}'. Aborting mission."
143
+ end
144
+
136
145
  true
137
146
  end
138
147
 
@@ -113,4 +113,8 @@ Modify \fBwp\-config\.php\fR file contents with project configuration (this flag
113
113
  .TP
114
114
  \fB\-\-no\-ssl\fR, \fB\-\-no\-https\fR
115
115
  Project does not need SSL support
116
+ .
117
+ .TP
118
+ \fB\-\-provision\fR
119
+ Run provisioners after creating project
116
120
 
@@ -92,6 +92,9 @@ GLOBAL OPTIONS
92
92
  --no-ssl, --no-https
93
93
  Project does not need SSL support
94
94
 
95
+ --provision
96
+ Run provisioners after creating project
97
+
95
98
 
96
99
 
97
100
 
@@ -15,6 +15,6 @@ Initializes the virtual machine\.
15
15
  .SH "GLOBAL OPTIONS"
16
16
  .
17
17
  .TP
18
- \fB\-\-provision\fR, \fB\-\-restart\fR
18
+ \fB\-\-provision\fR
19
19
  Run provisioners after initializing the virtual machine
20
20
 
@@ -12,7 +12,7 @@ DESCRIPTION
12
12
  Initializes the virtual machine.
13
13
 
14
14
  GLOBAL OPTIONS
15
- --provision, --restart
15
+ --provision
16
16
  Run provisioners after initializing the virtual machine
17
17
 
18
18
 
@@ -73,4 +73,8 @@ Modify \fBwp\-config\.php\fR file contents with project configuration (this flag
73
73
  .TP
74
74
  \fB\-\-no\-ssl\fR, \fB\-\-no\-https\fR
75
75
  Project does not need SSL support
76
+ .
77
+ .TP
78
+ \fB\-\-provision\fR
79
+ Run provisioners after setting up project
76
80
 
@@ -60,6 +60,9 @@ GLOBAL OPTIONS
60
60
  --no-ssl, --no-https
61
61
  Project does not need SSL support
62
62
 
63
+ --provision
64
+ Run provisioners after setting up project
65
+
63
66
 
64
67
 
65
68
 
@@ -9,11 +9,7 @@ module ThemeJuice
9
9
  end
10
10
 
11
11
  def execute
12
- if @project.provision
13
- provision
14
- else
15
- restart
16
- end
12
+ provision
17
13
  end
18
14
 
19
15
  def unexecute
@@ -42,16 +38,6 @@ module ThemeJuice
42
38
  end
43
39
  end
44
40
  end
45
-
46
- def restart
47
- @io.log "Restarting VM"
48
- @util.inside @env.vm_path do
49
- @util.run [] do |cmds|
50
- cmds << "vagrant halt" if vm_is_up?
51
- cmds << "vagrant up --no-provision"
52
- end
53
- end
54
- end
55
41
  end
56
42
  end
57
43
  end
@@ -13,18 +13,29 @@ module ThemeJuice
13
13
  end
14
14
 
15
15
  def unexecute
16
- if @project.vm_restart
17
- restart
18
- end
16
+ restart if @project.vm_restart
19
17
  end
20
18
 
21
19
  private
22
20
 
21
+ def vm_is_up?
22
+ res = false
23
+
24
+ @util.inside @env.vm_path do
25
+ res = @util.run("vagrant status --machine-readable", {
26
+ :verbose => @env.verbose, :capture => true }).include? "running"
27
+ end
28
+
29
+ res
30
+ end
31
+
23
32
  def restart
24
33
  @io.log "Restarting VM"
25
34
  @util.inside @env.vm_path do
26
- @util.run "vagrant reload", { :verbose => @env.verbose,
27
- :capture => @env.quiet }
35
+ @util.run [] do |cmds|
36
+ cmds << "vagrant halt" if vm_is_up?
37
+ cmds << "vagrant up"
38
+ end
28
39
  end
29
40
  end
30
41
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.26.2"
4
+ VERSION = "0.26.3"
5
5
  end
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.26.2
4
+ version: 0.26.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-20 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor