theme-juice 0.7.10 → 0.7.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/bin/tj +1 -6
- data/lib/theme-juice.rb +1 -0
- data/lib/theme-juice/commands/create.rb +17 -45
- data/lib/theme-juice/commands/delete.rb +1 -0
- data/lib/theme-juice/env.rb +2 -6
- data/lib/theme-juice/helpers.rb +9 -0
- data/lib/theme-juice/project.rb +2 -6
- data/lib/theme-juice/tasks/create_success.rb +0 -11
- data/lib/theme-juice/tasks/delete_success.rb +0 -9
- data/lib/theme-juice/tasks/vm_provision.rb +8 -0
- data/lib/theme-juice/tasks/vm_restart.rb +6 -0
- data/lib/theme-juice/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a40e35767cddfbeb2aab96fce9dd0cf3a509aa
|
4
|
+
data.tar.gz: 7dc5c7b4a1c816c61dc3312bd6d17bc52dcacfb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6051a33c1e1d44d2e2cf1023c85e1ecddd88e51c0ace13787a0f2d8ed5f1acef7cb06d20fb96a9875250f09cabec62014c934303172bd34ffd06aeedaee6f8ee
|
7
|
+
data.tar.gz: 9f9952d603b915ec5564b3fef51425dfe936d1420ec5fe14b46ebb1023cca8f9942bc0caec7916d9ac201e959c740d925bfee557411556e3a1e3b0c29aba708f
|
data/README.md
CHANGED
@@ -41,6 +41,7 @@ commands:
|
|
41
41
|
wp:
|
42
42
|
- wp ssh --host=vagrant %args%
|
43
43
|
backup:
|
44
|
+
- mkdir -p backup
|
44
45
|
- wp ssh --host=vagrant db export backup/$(date +'%Y-%m-%d-%H-%M-%S').sql
|
45
46
|
dist:
|
46
47
|
- tar -zcvf dist.tar.gz .
|
@@ -206,9 +207,11 @@ Uses `test` command within your config.
|
|
206
207
|
tj test # Aliases: tests spec specs
|
207
208
|
```
|
208
209
|
|
209
|
-
##
|
210
|
+
## Can I add my starter theme, ________?
|
211
|
+
Yes! Just update the `THEMES` constant inside [commands/create.rb](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/commands/create.rb#L7-L11) and make a pull request. I'll verify that it includes a `Juicefile`, and that everything looks solid. Until then (or if your theme is private), just run `tj new --theme https://your.repo/link/goes.here` to clone your theme.
|
210
212
|
|
211
|
-
|
213
|
+
## Contributing
|
214
|
+
1. First, create a _well documented_ [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature/bug fix.
|
212
215
|
1. [Fork the repository](https://github.com/ezekg/theme-juice-cli/fork).
|
213
216
|
1. Create a new feature branch. (`git checkout -b my-new-feature`)
|
214
217
|
1. Commit your changes. (`git commit -am 'add some feature'`)
|
data/bin/tj
CHANGED
data/lib/theme-juice.rb
CHANGED
@@ -50,8 +50,9 @@ module ThemeJuice
|
|
50
50
|
tasks << Tasks::DNS.new
|
51
51
|
tasks << Tasks::WPCLI.new
|
52
52
|
tasks << Tasks::Repo.new
|
53
|
-
tasks << Tasks::
|
53
|
+
tasks << Tasks::VMProvision.new
|
54
54
|
tasks << Tasks::ImportDatabase.new
|
55
|
+
tasks << Tasks::CreateSuccess.new
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
@@ -153,54 +154,25 @@ module ThemeJuice
|
|
153
154
|
repo
|
154
155
|
end
|
155
156
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
if @project.skip_db || @project.use_defaults
|
160
|
-
db_host = "vvv"
|
161
|
-
else
|
162
|
-
db_host = @io.prompt "Database host", :default => "vvv"
|
163
|
-
end
|
164
|
-
|
165
|
-
db_host
|
166
|
-
end
|
167
|
-
|
168
|
-
def db_name
|
169
|
-
return false if @project.no_db || @project.no_wp
|
170
|
-
|
171
|
-
if @project.skip_db || @project.use_defaults
|
172
|
-
db_name = "#{clean_name}_db"
|
173
|
-
else
|
174
|
-
db_name = @io.prompt "Database name", :default => "#{clean_name}_db"
|
175
|
-
end
|
157
|
+
%w[host name user pass].each do |task|
|
158
|
+
define_method "db_#{task}" do
|
159
|
+
return false if @project.no_db || @project.no_wp
|
176
160
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
if @project.skip_db || @project.use_defaults
|
184
|
-
db_user = "#{clean_name}_user"
|
185
|
-
else
|
186
|
-
db_user = @io.prompt "Database username", :default => "#{clean_name}_user"
|
187
|
-
end
|
188
|
-
|
189
|
-
db_user
|
190
|
-
end
|
191
|
-
|
192
|
-
def db_pass
|
193
|
-
return false if @project.no_db || @project.no_wp
|
161
|
+
case task
|
162
|
+
when "host" then default = "vvv"
|
163
|
+
when "name" then default = "#{clean_name}_db"
|
164
|
+
when "user" then default = "#{clean_name}_user"
|
165
|
+
when "pass" then default = Faker::Internet.password(24)
|
166
|
+
end
|
194
167
|
|
195
|
-
|
168
|
+
if @project.skip_db || @project.use_defaults
|
169
|
+
res = default
|
170
|
+
else
|
171
|
+
res = @io.prompt "Database #{task}", :default => default
|
172
|
+
end
|
196
173
|
|
197
|
-
|
198
|
-
db_pass = pass
|
199
|
-
else
|
200
|
-
db_pass = @io.prompt "Database password", :default => pass
|
174
|
+
res
|
201
175
|
end
|
202
|
-
|
203
|
-
db_pass
|
204
176
|
end
|
205
177
|
|
206
178
|
def db_import
|
data/lib/theme-juice/env.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module ThemeJuice
|
4
4
|
module Env
|
5
|
+
include Helpers
|
6
|
+
|
5
7
|
attr_accessor :vm_path
|
6
8
|
attr_accessor :vm_ip
|
7
9
|
attr_accessor :vm_prefix
|
@@ -14,12 +16,6 @@ module ThemeJuice
|
|
14
16
|
attr_accessor :verbose
|
15
17
|
attr_accessor :dryrun
|
16
18
|
|
17
|
-
def inspect
|
18
|
-
res = []
|
19
|
-
self.instance_variables.each { |k, _| res << "#{k[1..-1]}: #{instance_variable_get(k)}" }
|
20
|
-
res.sort
|
21
|
-
end
|
22
|
-
|
23
19
|
extend self
|
24
20
|
end
|
25
21
|
end
|
data/lib/theme-juice/project.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module ThemeJuice
|
4
4
|
module Project
|
5
|
+
include Helpers
|
6
|
+
|
5
7
|
attr_accessor :name
|
6
8
|
attr_accessor :location
|
7
9
|
attr_accessor :url
|
@@ -24,12 +26,6 @@ module ThemeJuice
|
|
24
26
|
attr_accessor :no_wp
|
25
27
|
attr_accessor :no_db
|
26
28
|
|
27
|
-
def inspect
|
28
|
-
res = []
|
29
|
-
self.instance_variables.each { |k, _| res << "#{k[1..-1]}: #{instance_variable_get(k)}" }
|
30
|
-
res.sort
|
31
|
-
end
|
32
|
-
|
33
29
|
extend self
|
34
30
|
end
|
35
31
|
end
|
@@ -6,25 +6,14 @@ module ThemeJuice
|
|
6
6
|
|
7
7
|
def initialize(opts = {})
|
8
8
|
super
|
9
|
-
|
10
|
-
@vm_provision = Tasks::VMProvision.new(opts)
|
11
9
|
end
|
12
10
|
|
13
11
|
def execute
|
14
|
-
provision_vm
|
15
12
|
success
|
16
13
|
end
|
17
14
|
|
18
15
|
private
|
19
16
|
|
20
|
-
def provision_vm
|
21
|
-
if @io.agree? "In order to finish creating your project, you need to provision the VM. Do it now?"
|
22
|
-
@vm_provision.execute
|
23
|
-
else
|
24
|
-
@io.notice "Remember, the VM needs to be provisioned before you can use your new site"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
17
|
def success
|
29
18
|
@io.success "Successfully created project '#{@project.name}'"
|
30
19
|
@io.list "Your settings :", :yellow, settings
|
@@ -6,23 +6,14 @@ module ThemeJuice
|
|
6
6
|
|
7
7
|
def initialize(opts = {})
|
8
8
|
super
|
9
|
-
|
10
|
-
@vm_restart = Tasks::VMRestart.new(opts)
|
11
9
|
end
|
12
10
|
|
13
11
|
def unexecute
|
14
|
-
restart_vm
|
15
12
|
success
|
16
13
|
end
|
17
14
|
|
18
15
|
private
|
19
16
|
|
20
|
-
def restart_vm
|
21
|
-
if @project.vm_restart
|
22
|
-
@vm_restart.execute
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
17
|
def success
|
27
18
|
@io.success "Successfully removed project '#{@project.name}'"
|
28
19
|
end
|
@@ -9,6 +9,14 @@ module ThemeJuice
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def execute
|
12
|
+
if @io.agree? "In order to finish creating your project, you need to provision the VM. Do it now?"
|
13
|
+
provision
|
14
|
+
else
|
15
|
+
@io.notice "Remember, the VM needs to be provisioned before you can use your new site"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def unexecute
|
12
20
|
provision
|
13
21
|
end
|
14
22
|
|
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.7.
|
4
|
+
version: 0.7.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/theme-juice/commands/deploy.rb
|
129
129
|
- lib/theme-juice/config.rb
|
130
130
|
- lib/theme-juice/env.rb
|
131
|
+
- lib/theme-juice/helpers.rb
|
131
132
|
- lib/theme-juice/io.rb
|
132
133
|
- lib/theme-juice/project.rb
|
133
134
|
- lib/theme-juice/task.rb
|