theme-juice 0.6.6 → 0.6.7
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.rb +6 -6
- data/lib/theme-juice/commands/create.rb +1 -1
- data/lib/theme-juice/commands/delete.rb +1 -1
- data/lib/theme-juice/commands/install.rb +1 -1
- data/lib/theme-juice/commands/list.rb +1 -1
- data/lib/theme-juice/commands/subcommand.rb +1 -1
- data/lib/theme-juice/interactions/{create_site_options.rb → create_options.rb} +11 -11
- data/lib/theme-juice/interactions/{delete_site_options.rb → delete_options.rb} +2 -2
- data/lib/theme-juice/interactions/teejay.rb +11 -1
- data/lib/theme-juice/services/{config_file.rb → config.rb} +1 -1
- data/lib/theme-juice/services/{create_site.rb → create.rb} +20 -20
- data/lib/theme-juice/services/{delete_site.rb → delete.rb} +3 -3
- data/lib/theme-juice/services/{list_sites.rb → list.rb} +1 -1
- data/lib/theme-juice/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79c12bdbd0ca6886ac67ce005433fc8a463112b6
|
4
|
+
data.tar.gz: 7e67b5a12c39127a3050ab17572c4e344c6ab444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0b1b5c0b15a19298f23b30fa2702478148ba1a536ceab07597d5e58f2af187b2d650b47f78c5c6acdaf39d868a6996acc85a5c1bcb0afc24b4f7d5c3141970b
|
7
|
+
data.tar.gz: 7ac5accc6f39612b0609d2801f4c1c3460af762a7330ceec7f694ddcf814b9413ab3c7750a71791f6109432fac31165b87bb81b164f4519bb536b6af050148ed
|
data/lib/theme-juice.rb
CHANGED
@@ -15,13 +15,13 @@ require_relative "theme-juice/version"
|
|
15
15
|
require_relative "theme-juice/environment"
|
16
16
|
require_relative "theme-juice/interaction"
|
17
17
|
require_relative "theme-juice/interactions/teejay"
|
18
|
-
require_relative "theme-juice/interactions/
|
19
|
-
require_relative "theme-juice/interactions/
|
18
|
+
require_relative "theme-juice/interactions/create_options"
|
19
|
+
require_relative "theme-juice/interactions/delete_options"
|
20
20
|
require_relative "theme-juice/service"
|
21
|
-
require_relative "theme-juice/services/
|
22
|
-
require_relative "theme-juice/services/
|
23
|
-
require_relative "theme-juice/services/
|
24
|
-
require_relative "theme-juice/services/
|
21
|
+
require_relative "theme-juice/services/config"
|
22
|
+
require_relative "theme-juice/services/create"
|
23
|
+
require_relative "theme-juice/services/delete"
|
24
|
+
require_relative "theme-juice/services/list"
|
25
25
|
require_relative "theme-juice/command"
|
26
26
|
require_relative "theme-juice/commands/install"
|
27
27
|
require_relative "theme-juice/commands/create"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
module ThemeJuice
|
4
|
-
class Interaction::
|
4
|
+
class Interaction::CreateOptions
|
5
5
|
|
6
6
|
#
|
7
7
|
# Set up interactions and environment
|
@@ -105,7 +105,7 @@ module ThemeJuice
|
|
105
105
|
if @opts[:use_defaults]
|
106
106
|
location = File.expand_path(path)
|
107
107
|
else
|
108
|
-
location = File.expand_path(@interaction.prompt "Where do you want to setup the site?", default
|
108
|
+
location = File.expand_path(@interaction.prompt "Where do you want to setup the site?", :default => path, :path => true)
|
109
109
|
end
|
110
110
|
|
111
111
|
location
|
@@ -123,7 +123,7 @@ module ThemeJuice
|
|
123
123
|
themes = {
|
124
124
|
"theme-juice/theme-juice-starter" => "https://github.com/ezekg/theme-juice-starter.git",
|
125
125
|
"other" => nil,
|
126
|
-
"none"
|
126
|
+
"none" => false
|
127
127
|
}
|
128
128
|
|
129
129
|
if @opts[:use_defaults]
|
@@ -136,7 +136,7 @@ module ThemeJuice
|
|
136
136
|
when "theme-juice/theme-juice-starter"
|
137
137
|
@interaction.success "Awesome choice!"
|
138
138
|
when "other"
|
139
|
-
themes[choice] = @interaction.prompt "What is the repository URL for the starter theme you would like to clone?"
|
139
|
+
themes[choice] = @interaction.prompt "What is the repository URL for the starter theme that you would like to clone?"
|
140
140
|
when "none"
|
141
141
|
@interaction.notice "Next time you need to create a site without a starter theme, you can just run the 'setup' command instead."
|
142
142
|
@opts[:site_bare] = true
|
@@ -166,7 +166,7 @@ module ThemeJuice
|
|
166
166
|
if @opts[:use_defaults]
|
167
167
|
url = "#{@opts[:site_name]}.dev"
|
168
168
|
else
|
169
|
-
url = @interaction.prompt "What do you want the development url to be? (this should end in '.dev')", default
|
169
|
+
url = @interaction.prompt "What do you want the development url to be? (this should end in '.dev')", :default => "#{@opts[:site_name]}.dev"
|
170
170
|
end
|
171
171
|
|
172
172
|
validate_site_dev_url url
|
@@ -184,7 +184,7 @@ module ThemeJuice
|
|
184
184
|
repo = false
|
185
185
|
else
|
186
186
|
if @interaction.agree? "Would you like to initialize a new Git repository?"
|
187
|
-
repo = @interaction.prompt "What is the repository's URL?", indent
|
187
|
+
repo = @interaction.prompt "What is the repository's URL?", :indent => 2
|
188
188
|
else
|
189
189
|
repo = false
|
190
190
|
end
|
@@ -202,7 +202,7 @@ module ThemeJuice
|
|
202
202
|
if @opts[:use_defaults] || @opts[:skip_db]
|
203
203
|
db_host = "vvv"
|
204
204
|
else
|
205
|
-
db_host = @interaction.prompt "Database host", default
|
205
|
+
db_host = @interaction.prompt "Database host", :default => "vvv"
|
206
206
|
end
|
207
207
|
|
208
208
|
db_host
|
@@ -217,7 +217,7 @@ module ThemeJuice
|
|
217
217
|
if @opts[:use_defaults] || @opts[:skip_db]
|
218
218
|
db_name = "#{@opts[:site_name_clean]}_db"
|
219
219
|
else
|
220
|
-
db_name = @interaction.prompt "Database name", default
|
220
|
+
db_name = @interaction.prompt "Database name", :default => "#{@opts[:site_name_clean]}_db"
|
221
221
|
end
|
222
222
|
|
223
223
|
db_name
|
@@ -232,7 +232,7 @@ module ThemeJuice
|
|
232
232
|
if @opts[:use_defaults] || @opts[:skip_db]
|
233
233
|
db_user = "#{@opts[:site_name_clean]}_user"
|
234
234
|
else
|
235
|
-
db_user = @interaction.prompt "Database username", default
|
235
|
+
db_user = @interaction.prompt "Database username", :default => "#{@opts[:site_name_clean]}_user"
|
236
236
|
end
|
237
237
|
|
238
238
|
db_user
|
@@ -244,12 +244,12 @@ module ThemeJuice
|
|
244
244
|
# @return {String}
|
245
245
|
#
|
246
246
|
def setup_site_db_pass
|
247
|
-
pass = Faker::Internet.password
|
247
|
+
pass = Faker::Internet.password 24
|
248
248
|
|
249
249
|
if @opts[:use_defaults] || @opts[:skip_db]
|
250
250
|
db_pass = pass
|
251
251
|
else
|
252
|
-
db_pass = @interaction.prompt "Database password", default
|
252
|
+
db_pass = @interaction.prompt "Database password", :default => pass
|
253
253
|
end
|
254
254
|
|
255
255
|
db_pass
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
module ThemeJuice
|
4
|
-
class Interaction::
|
4
|
+
class Interaction::DeleteOptions
|
5
5
|
|
6
6
|
#
|
7
7
|
# Set up interactions and environment
|
@@ -43,7 +43,7 @@ module ThemeJuice
|
|
43
43
|
# @return {String}
|
44
44
|
#
|
45
45
|
def get_site_name
|
46
|
-
name = @interaction.choose "Which site would you like to delete?", :red, ::ThemeJuice::Service::
|
46
|
+
name = @interaction.choose "Which site would you like to delete?", :red, ::ThemeJuice::Service::List.new.get_sites
|
47
47
|
end
|
48
48
|
|
49
49
|
#
|
@@ -1,6 +1,16 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
module ThemeJuice
|
4
|
-
class Interaction::TeeJay
|
4
|
+
class Interaction::TeeJay
|
5
|
+
|
6
|
+
#
|
7
|
+
# Set up interactions and environment
|
8
|
+
#
|
9
|
+
# @return {Void}
|
10
|
+
#
|
11
|
+
def initialize
|
12
|
+
@environment = ::ThemeJuice::Environment
|
13
|
+
@interaction = ::ThemeJuice::Interaction
|
14
|
+
end
|
5
15
|
end
|
6
16
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
module ThemeJuice
|
4
|
-
class Service::
|
4
|
+
class Service::Create < ::ThemeJuice::Service
|
5
5
|
|
6
6
|
#
|
7
7
|
# @param {Hash} opts
|
8
8
|
#
|
9
9
|
def initialize(opts = {})
|
10
|
-
opts = ::ThemeJuice::Interaction::
|
10
|
+
opts = ::ThemeJuice::Interaction::CreateOptions.new.setup_site_options(opts)
|
11
11
|
|
12
12
|
super
|
13
13
|
end
|
@@ -20,18 +20,18 @@ module ThemeJuice
|
|
20
20
|
def create
|
21
21
|
@interaction.notice "Running setup for '#{@opts[:site_name]}'"
|
22
22
|
|
23
|
-
setup_project_dir
|
24
|
-
setup_starter_theme
|
25
|
-
setup_vvv
|
26
|
-
setup_wildcard_subdomains
|
27
|
-
setup_hosts
|
28
|
-
setup_database
|
29
|
-
setup_nginx
|
30
|
-
setup_dev_site
|
31
|
-
setup_env
|
32
|
-
setup_synced_folder
|
33
|
-
setup_wpcli
|
34
|
-
setup_repo
|
23
|
+
setup_project_dir unless project_dir_is_setup?
|
24
|
+
setup_starter_theme unless starter_theme_is_setup?
|
25
|
+
setup_vvv unless vvv_is_setup?
|
26
|
+
setup_wildcard_subdomains unless wildcard_subdomains_is_setup?
|
27
|
+
setup_hosts unless hosts_is_setup?
|
28
|
+
setup_database unless database_is_setup?
|
29
|
+
setup_nginx unless nginx_is_setup?
|
30
|
+
setup_dev_site unless dev_site_is_setup?
|
31
|
+
setup_env unless env_is_setup?
|
32
|
+
setup_synced_folder unless synced_folder_is_setup?
|
33
|
+
setup_wpcli unless wpcli_is_setup?
|
34
|
+
setup_repo if using_repo?
|
35
35
|
|
36
36
|
if setup_was_successful?
|
37
37
|
@interaction.success "Setup complete!"
|
@@ -41,7 +41,7 @@ module ThemeJuice
|
|
41
41
|
:row => true
|
42
42
|
}
|
43
43
|
|
44
|
-
if @interaction.agree? "", { simple
|
44
|
+
if @interaction.agree? "", { :simple => true }
|
45
45
|
|
46
46
|
if restart_vagrant
|
47
47
|
@interaction.success "Success!"
|
@@ -75,7 +75,7 @@ module ThemeJuice
|
|
75
75
|
end
|
76
76
|
else
|
77
77
|
@interaction.error "Setup failed. Running cleanup" do
|
78
|
-
::ThemeJuice::Service::Delete.new({ site_name: @opts[:site_name], restart
|
78
|
+
::ThemeJuice::Service::Delete.new({ site_name: @opts[:site_name], :restart => false }).delete
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -158,10 +158,10 @@ module ThemeJuice
|
|
158
158
|
def setup_config
|
159
159
|
@interaction.log "Creating config"
|
160
160
|
|
161
|
-
watch = @interaction.prompt "Watch command to use", indent
|
162
|
-
server = @interaction.prompt "Deployment command to use", indent
|
163
|
-
vendor = @interaction.prompt "Vendor command to use", indent
|
164
|
-
install = @interaction.prompt "Commands to run on theme install (comma-delimited)", indent
|
161
|
+
watch = @interaction.prompt "Watch command to use", :indent => 2, :default => "bundle exec guard"
|
162
|
+
server = @interaction.prompt "Deployment command to use", :indent => 2, :default => "bundle exec cap"
|
163
|
+
vendor = @interaction.prompt "Vendor command to use", :indent => 2, :default => "composer"
|
164
|
+
install = @interaction.prompt "Commands to run on theme install (comma-delimited)", :indent => 2, :default => "composer install"
|
165
165
|
|
166
166
|
File.open "#{@config_path}/tj.yml", "wb" do |file|
|
167
167
|
file.puts "commands:"
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
module ThemeJuice
|
4
|
-
class Service::
|
4
|
+
class Service::Delete < ::ThemeJuice::Service
|
5
5
|
|
6
6
|
#
|
7
7
|
# @param {Hash} opts
|
8
8
|
#
|
9
9
|
def initialize(opts)
|
10
|
-
opts = ThemeJuice::Interaction::
|
10
|
+
opts = ThemeJuice::Interaction::DeleteOptions.new.get_site_options(opts)
|
11
11
|
|
12
12
|
super
|
13
13
|
end
|
@@ -24,7 +24,7 @@ module ThemeJuice
|
|
24
24
|
:row => true
|
25
25
|
}
|
26
26
|
|
27
|
-
if @interaction.agree? "", { color
|
27
|
+
if @interaction.agree? "", { :color => :red, :simple => true }
|
28
28
|
|
29
29
|
remove_dev_site if dev_site_is_setup?
|
30
30
|
remove_database if database_is_setup?
|
data/lib/theme-juice/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
@@ -70,14 +70,14 @@ files:
|
|
70
70
|
- lib/theme-juice/commands/subcommand.rb
|
71
71
|
- lib/theme-juice/environment.rb
|
72
72
|
- lib/theme-juice/interaction.rb
|
73
|
-
- lib/theme-juice/interactions/
|
74
|
-
- lib/theme-juice/interactions/
|
73
|
+
- lib/theme-juice/interactions/create_options.rb
|
74
|
+
- lib/theme-juice/interactions/delete_options.rb
|
75
75
|
- lib/theme-juice/interactions/teejay.rb
|
76
76
|
- lib/theme-juice/service.rb
|
77
|
-
- lib/theme-juice/services/
|
78
|
-
- lib/theme-juice/services/
|
79
|
-
- lib/theme-juice/services/
|
80
|
-
- lib/theme-juice/services/
|
77
|
+
- lib/theme-juice/services/config.rb
|
78
|
+
- lib/theme-juice/services/create.rb
|
79
|
+
- lib/theme-juice/services/delete.rb
|
80
|
+
- lib/theme-juice/services/list.rb
|
81
81
|
- lib/theme-juice/version.rb
|
82
82
|
- lib/theme-juice.rb
|
83
83
|
- LICENSE
|