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
data/lib/theme-juice.rb
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
require "thor"
|
4
|
-
require "faker"
|
5
|
-
require "os"
|
6
|
-
require "yaml"
|
7
|
-
|
8
|
-
module ThemeJuice
|
9
|
-
end
|
10
|
-
|
11
|
-
require_relative "theme-juice/version"
|
12
|
-
require_relative "theme-juice/env"
|
13
|
-
require_relative "theme-juice/project"
|
14
|
-
require_relative "theme-juice/util"
|
15
|
-
require_relative "theme-juice/io"
|
16
|
-
require_relative "theme-juice/config"
|
17
|
-
require_relative "theme-juice/task"
|
18
|
-
require_relative "theme-juice/tasks/entry"
|
19
|
-
require_relative "theme-juice/tasks/vm"
|
20
|
-
require_relative "theme-juice/tasks/create_confirm"
|
21
|
-
require_relative "theme-juice/tasks/delete_confirm"
|
22
|
-
require_relative "theme-juice/tasks/location"
|
23
|
-
require_relative "theme-juice/tasks/theme"
|
24
|
-
require_relative "theme-juice/tasks/repo"
|
25
|
-
require_relative "theme-juice/tasks/dot_env"
|
26
|
-
require_relative "theme-juice/tasks/hosts"
|
27
|
-
require_relative "theme-juice/tasks/nginx"
|
28
|
-
require_relative "theme-juice/tasks/vm_plugins"
|
29
|
-
require_relative "theme-juice/tasks/vm_location"
|
30
|
-
require_relative "theme-juice/tasks/vm_customfile"
|
31
|
-
require_relative "theme-juice/tasks/database"
|
32
|
-
require_relative "theme-juice/tasks/landrush"
|
33
|
-
require_relative "theme-juice/tasks/synced_folder"
|
34
|
-
require_relative "theme-juice/tasks/dns"
|
35
|
-
require_relative "theme-juice/tasks/wp_cli"
|
36
|
-
require_relative "theme-juice/tasks/create_success"
|
37
|
-
require_relative "theme-juice/tasks/delete_success"
|
38
|
-
require_relative "theme-juice/tasks/vm_provision"
|
39
|
-
require_relative "theme-juice/tasks/vm_restart"
|
40
|
-
require_relative "theme-juice/tasks/import_database"
|
41
|
-
require_relative "theme-juice/tasks/list"
|
42
|
-
require_relative "theme-juice/command"
|
43
|
-
require_relative "theme-juice/commands/create"
|
44
|
-
require_relative "theme-juice/commands/delete"
|
45
|
-
require_relative "theme-juice/commands/deploy"
|
46
|
-
require_relative "theme-juice/cli"
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require "thor"
|
4
|
+
require "faker"
|
5
|
+
require "os"
|
6
|
+
require "yaml"
|
7
|
+
|
8
|
+
module ThemeJuice
|
9
|
+
end
|
10
|
+
|
11
|
+
require_relative "theme-juice/version"
|
12
|
+
require_relative "theme-juice/env"
|
13
|
+
require_relative "theme-juice/project"
|
14
|
+
require_relative "theme-juice/util"
|
15
|
+
require_relative "theme-juice/io"
|
16
|
+
require_relative "theme-juice/config"
|
17
|
+
require_relative "theme-juice/task"
|
18
|
+
require_relative "theme-juice/tasks/entry"
|
19
|
+
require_relative "theme-juice/tasks/vm"
|
20
|
+
require_relative "theme-juice/tasks/create_confirm"
|
21
|
+
require_relative "theme-juice/tasks/delete_confirm"
|
22
|
+
require_relative "theme-juice/tasks/location"
|
23
|
+
require_relative "theme-juice/tasks/theme"
|
24
|
+
require_relative "theme-juice/tasks/repo"
|
25
|
+
require_relative "theme-juice/tasks/dot_env"
|
26
|
+
require_relative "theme-juice/tasks/hosts"
|
27
|
+
require_relative "theme-juice/tasks/nginx"
|
28
|
+
require_relative "theme-juice/tasks/vm_plugins"
|
29
|
+
require_relative "theme-juice/tasks/vm_location"
|
30
|
+
require_relative "theme-juice/tasks/vm_customfile"
|
31
|
+
require_relative "theme-juice/tasks/database"
|
32
|
+
require_relative "theme-juice/tasks/landrush"
|
33
|
+
require_relative "theme-juice/tasks/synced_folder"
|
34
|
+
require_relative "theme-juice/tasks/dns"
|
35
|
+
require_relative "theme-juice/tasks/wp_cli"
|
36
|
+
require_relative "theme-juice/tasks/create_success"
|
37
|
+
require_relative "theme-juice/tasks/delete_success"
|
38
|
+
require_relative "theme-juice/tasks/vm_provision"
|
39
|
+
require_relative "theme-juice/tasks/vm_restart"
|
40
|
+
require_relative "theme-juice/tasks/import_database"
|
41
|
+
require_relative "theme-juice/tasks/list"
|
42
|
+
require_relative "theme-juice/command"
|
43
|
+
require_relative "theme-juice/commands/create"
|
44
|
+
require_relative "theme-juice/commands/delete"
|
45
|
+
require_relative "theme-juice/commands/deploy"
|
46
|
+
require_relative "theme-juice/cli"
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -1,248 +1,248 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
#
|
4
|
-
# Monkey patch to not print out reverse bool options on --help
|
5
|
-
#
|
6
|
-
# @see https://github.com/erikhuda/thor/issues/417
|
7
|
-
#
|
8
|
-
class Thor
|
9
|
-
class Option < Argument
|
10
|
-
def usage(padding = 0)
|
11
|
-
sample = if banner && !banner.to_s.empty?
|
12
|
-
"#{switch_name}=#{banner}"
|
13
|
-
else
|
14
|
-
switch_name
|
15
|
-
end
|
16
|
-
|
17
|
-
sample = "[#{sample}]" unless required?
|
18
|
-
|
19
|
-
# if boolean?
|
20
|
-
# sample << ", [#{dasherize("no-" + human_name)}]" unless name == "force" or name.start_with?("no-")
|
21
|
-
# end
|
22
|
-
|
23
|
-
if aliases.empty?
|
24
|
-
(" " * padding) << sample
|
25
|
-
else
|
26
|
-
"#{aliases.join(', ')}, #{sample}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
VALID_TYPES.each do |type|
|
31
|
-
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
32
|
-
def #{type}?
|
33
|
-
self.type == #{type.inspect}
|
34
|
-
end
|
35
|
-
RUBY
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
module ThemeJuice
|
41
|
-
class CLI < Thor
|
42
|
-
|
43
|
-
def initialize(*)
|
44
|
-
super
|
45
|
-
|
46
|
-
@version = VERSION
|
47
|
-
@env = Env
|
48
|
-
@io = IO
|
49
|
-
@config = Config
|
50
|
-
@project = Project
|
51
|
-
@util = Util.new
|
52
|
-
@list = Tasks::List
|
53
|
-
@create = Commands::Create
|
54
|
-
@delete = Commands::Delete
|
55
|
-
@deploy = Commands::Deploy
|
56
|
-
@env.vm_path = options.fetch "vm_path", ENV.fetch("TJ_VM_PATH", File.expand_path("~/vagrant"))
|
57
|
-
@env.vm_ip = options.fetch "vm_ip", ENV.fetch("TJ_VM_IP", "192.168.50.4")
|
58
|
-
@env.vm_prefix = options.fetch "vm_prefix", ENV.fetch("TJ_VM_PREFIX", "tj-")
|
59
|
-
@env.yolo = options.fetch "yolo", ENV.fetch("TJ_YOLO", false)
|
60
|
-
@env.boring = options.fetch "boring", ENV.fetch("TJ_BORING", false)
|
61
|
-
@env.no_unicode = options.fetch "no_unicode", ENV.fetch("TJ_NO_UNICODE", @env.boring)
|
62
|
-
@env.no_colors = options.fetch "no_colors", ENV.fetch("TJ_NO_COLORS", @env.boring)
|
63
|
-
@env.no_animations = options.fetch "no_animations", ENV.fetch("TJ_NO_ANIMATIONS", @env.boring)
|
64
|
-
@env.no_landrush = options.fetch "no_landrush", ENV.fetch("TJ_NO_LANDRUSH", false)
|
65
|
-
@env.verbose = options.fetch "verbose", ENV.fetch("TJ_VERBOSE", false)
|
66
|
-
@env.dryrun = options.fetch "dryrun", ENV.fetch("TJ_DRYRUN", false)
|
67
|
-
end
|
68
|
-
|
69
|
-
map %w[--version -v] => :version
|
70
|
-
map %w[mk make new add] => :create
|
71
|
-
map %w[up prep init] => :setup
|
72
|
-
map %w[rm remove trash teardown] => :delete
|
73
|
-
map %w[ls projects apps sites] => :list
|
74
|
-
map %w[assets dev build] => :watch
|
75
|
-
map %w[dependencies deps] => :vendor
|
76
|
-
map %w[distrubute pack package] => :dist
|
77
|
-
map %w[wordpress] => :wp
|
78
|
-
map %w[bk] => :backup
|
79
|
-
map %w[tests spec specs] => :test
|
80
|
-
map %w[deployer server remote] => :deploy
|
81
|
-
map %w[vagrant vvv] => :vm
|
82
|
-
|
83
|
-
class_option :vm_path, :type => :string, :default => nil, :desc => "Force path to VM"
|
84
|
-
class_option :vm_ip, :type => :string, :default => nil, :desc => "Force IP address for VM"
|
85
|
-
class_option :vm_prefix, :type => :string, :default => nil, :desc => "Force directory prefix for project in VM"
|
86
|
-
class_option :yolo, :type => :boolean, :desc => "Say yes to anything and everything"
|
87
|
-
class_option :boring, :type => :boolean, :desc => "Disable all the coolness"
|
88
|
-
class_option :no_unicode, :type => :boolean, :desc => "Disable all unicode characters"
|
89
|
-
class_option :no_colors, :type => :boolean, :desc => "Disable all colored output"
|
90
|
-
class_option :no_animations, :type => :boolean, :desc => "Disable all animations"
|
91
|
-
class_option :no_landrush, :type => :boolean, :desc => "Disable landrush for DNS"
|
92
|
-
class_option :verbose, :type => :boolean, :desc => "Verbose output"
|
93
|
-
class_option :dryrun, :type => :boolean, :desc => "Disable running all commands"
|
94
|
-
|
95
|
-
desc "--version, -v", "Print current version"
|
96
|
-
#
|
97
|
-
# @return {String}
|
98
|
-
#
|
99
|
-
def version
|
100
|
-
@io.speak @version, :color => :green
|
101
|
-
end
|
102
|
-
|
103
|
-
desc "create", "Create new project"
|
104
|
-
method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => "Name of the project"
|
105
|
-
method_option :location, :type => :string, :aliases => "-l", :default => nil, :desc => "Location of the local project"
|
106
|
-
method_option :theme, :type => :string, :aliases => "-t", :default => nil, :desc => "Starter theme to install"
|
107
|
-
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
108
|
-
method_option :repository, :type => :string, :aliases => "-r", :desc => "Initialize a new Git remote repository"
|
109
|
-
method_option :db_import, :type => :string, :aliases => %w[-i --import-db], :desc => "Import an existing database"
|
110
|
-
method_option :bare, :type => :boolean, :desc => "Create a project without a starter theme"
|
111
|
-
method_option :skip_repo, :type => :boolean, :desc => "Skip repository prompts and use default settings"
|
112
|
-
method_option :skip_db, :type => :boolean, :desc => "Skip database prompts and use default settings"
|
113
|
-
method_option :use_defaults, :type => :boolean, :desc => "Skip all prompts and use default settings"
|
114
|
-
method_option :no_wp, :type => :boolean, :desc => "New project is not a WordPress install"
|
115
|
-
method_option :no_db, :type => :boolean, :desc => "New project does not need a database"
|
116
|
-
#
|
117
|
-
# @return {Void}
|
118
|
-
#
|
119
|
-
def create
|
120
|
-
@io.hello
|
121
|
-
@create.new(options).execute
|
122
|
-
end
|
123
|
-
|
124
|
-
desc "setup", "Setup existing project"
|
125
|
-
method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => "Name of the project"
|
126
|
-
method_option :location, :type => :string, :aliases => "-l", :default => nil, :desc => "Location of the local project"
|
127
|
-
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
128
|
-
method_option :repository, :type => :string, :aliases => "-r", :desc => "Initialize a new Git remote repository"
|
129
|
-
method_option :import_db, :type => :string, :aliases => "-i", :desc => "Import an existing database"
|
130
|
-
method_option :skip_repo, :type => :boolean, :desc => "Skip repository prompts and use default settings"
|
131
|
-
method_option :skip_db, :type => :boolean, :desc => "Skip database prompts and use default settings"
|
132
|
-
method_option :use_defaults, :type => :boolean, :desc => "Skip all prompts and use default settings"
|
133
|
-
method_option :no_wp, :type => :boolean, :desc => "New project is not a WordPress install"
|
134
|
-
method_option :no_db, :type => :boolean, :desc => "New project does not need a database"
|
135
|
-
#
|
136
|
-
# @return {Void}
|
137
|
-
#
|
138
|
-
def setup
|
139
|
-
@io.hello
|
140
|
-
@create.new(options.dup.merge({
|
141
|
-
:theme => false,
|
142
|
-
:bare => true,
|
143
|
-
})).execute
|
144
|
-
end
|
145
|
-
|
146
|
-
desc "delete", "Delete project (does not delete local project)"
|
147
|
-
method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => "Name of the project"
|
148
|
-
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
149
|
-
method_option :db_drop, :type => :boolean, :aliases => "--drop-db", :desc => "Drop project's database"
|
150
|
-
method_option :vm_restart, :type => :boolean, :aliases => "--restart-vm", :desc => "Restart VM after deletion"
|
151
|
-
#
|
152
|
-
# @return {Void}
|
153
|
-
#
|
154
|
-
def delete
|
155
|
-
@delete.new(options).unexecute
|
156
|
-
end
|
157
|
-
|
158
|
-
desc "deploy", "Manage deployment and migration"
|
159
|
-
#
|
160
|
-
# @return {Void}
|
161
|
-
#
|
162
|
-
def deploy
|
163
|
-
@deploy.new(options).execute
|
164
|
-
end
|
165
|
-
|
166
|
-
desc "list", "List all projects"
|
167
|
-
#
|
168
|
-
# @return {Void}
|
169
|
-
#
|
170
|
-
def list
|
171
|
-
@list.new(options).list :projects
|
172
|
-
end
|
173
|
-
|
174
|
-
desc "update", "Update tj and its dependencies"
|
175
|
-
#
|
176
|
-
# @return {Void}
|
177
|
-
#
|
178
|
-
def update(*commands)
|
179
|
-
@io.error "Not implemented"
|
180
|
-
end
|
181
|
-
|
182
|
-
desc "install", "Run installation for project"
|
183
|
-
#
|
184
|
-
# @return {Void}
|
185
|
-
#
|
186
|
-
def install(*commands)
|
187
|
-
@config.install commands
|
188
|
-
end
|
189
|
-
|
190
|
-
desc "watch [COMMANDS]", "Watch and compile assets"
|
191
|
-
#
|
192
|
-
# @return {Void}
|
193
|
-
#
|
194
|
-
def watch(*commands)
|
195
|
-
@config.watch commands
|
196
|
-
end
|
197
|
-
|
198
|
-
desc "vendor [COMMANDS]", "Manage vendor dependencies"
|
199
|
-
#
|
200
|
-
# @return {Void}
|
201
|
-
#
|
202
|
-
def vendor(*commands)
|
203
|
-
@config.vendor commands
|
204
|
-
end
|
205
|
-
|
206
|
-
desc "dist [COMMANDS]", "Package project for distribution"
|
207
|
-
#
|
208
|
-
# @return {Void}
|
209
|
-
#
|
210
|
-
def dist(*commands)
|
211
|
-
@config.dist commands
|
212
|
-
end
|
213
|
-
|
214
|
-
desc "wp [COMMANDS]", "Manage WordPress installation"
|
215
|
-
#
|
216
|
-
# @return {Void}
|
217
|
-
#
|
218
|
-
def wp(*commands)
|
219
|
-
@config.wp commands
|
220
|
-
end
|
221
|
-
|
222
|
-
desc "backup [COMMANDS]", "Backup project"
|
223
|
-
#
|
224
|
-
# @return {Void}
|
225
|
-
#
|
226
|
-
def backup(*commands)
|
227
|
-
@config.backup commands
|
228
|
-
end
|
229
|
-
|
230
|
-
desc "test [COMMANDS]", "Manage and run project tests"
|
231
|
-
#
|
232
|
-
# @return {Void}
|
233
|
-
#
|
234
|
-
def test(*commands)
|
235
|
-
@config.test commands
|
236
|
-
end
|
237
|
-
|
238
|
-
desc "vm [COMMANDS]", "Manage development environment"
|
239
|
-
#
|
240
|
-
# @return {Void}
|
241
|
-
#
|
242
|
-
def vm(*commands)
|
243
|
-
@util.inside @env.vm_path do
|
244
|
-
@util.run "vagrant #{commands.join(" ")}", :verbose => @env.verbose
|
245
|
-
end
|
246
|
-
end
|
247
|
-
end
|
248
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
#
|
4
|
+
# Monkey patch to not print out reverse bool options on --help
|
5
|
+
#
|
6
|
+
# @see https://github.com/erikhuda/thor/issues/417
|
7
|
+
#
|
8
|
+
class Thor
|
9
|
+
class Option < Argument
|
10
|
+
def usage(padding = 0)
|
11
|
+
sample = if banner && !banner.to_s.empty?
|
12
|
+
"#{switch_name}=#{banner}"
|
13
|
+
else
|
14
|
+
switch_name
|
15
|
+
end
|
16
|
+
|
17
|
+
sample = "[#{sample}]" unless required?
|
18
|
+
|
19
|
+
# if boolean?
|
20
|
+
# sample << ", [#{dasherize("no-" + human_name)}]" unless name == "force" or name.start_with?("no-")
|
21
|
+
# end
|
22
|
+
|
23
|
+
if aliases.empty?
|
24
|
+
(" " * padding) << sample
|
25
|
+
else
|
26
|
+
"#{aliases.join(', ')}, #{sample}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
VALID_TYPES.each do |type|
|
31
|
+
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
32
|
+
def #{type}?
|
33
|
+
self.type == #{type.inspect}
|
34
|
+
end
|
35
|
+
RUBY
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
module ThemeJuice
|
41
|
+
class CLI < Thor
|
42
|
+
|
43
|
+
def initialize(*)
|
44
|
+
super
|
45
|
+
|
46
|
+
@version = VERSION
|
47
|
+
@env = Env
|
48
|
+
@io = IO
|
49
|
+
@config = Config
|
50
|
+
@project = Project
|
51
|
+
@util = Util.new
|
52
|
+
@list = Tasks::List
|
53
|
+
@create = Commands::Create
|
54
|
+
@delete = Commands::Delete
|
55
|
+
@deploy = Commands::Deploy
|
56
|
+
@env.vm_path = options.fetch "vm_path", ENV.fetch("TJ_VM_PATH", File.expand_path("~/vagrant"))
|
57
|
+
@env.vm_ip = options.fetch "vm_ip", ENV.fetch("TJ_VM_IP", "192.168.50.4")
|
58
|
+
@env.vm_prefix = options.fetch "vm_prefix", ENV.fetch("TJ_VM_PREFIX", "tj-")
|
59
|
+
@env.yolo = options.fetch "yolo", ENV.fetch("TJ_YOLO", false)
|
60
|
+
@env.boring = options.fetch "boring", ENV.fetch("TJ_BORING", false)
|
61
|
+
@env.no_unicode = options.fetch "no_unicode", ENV.fetch("TJ_NO_UNICODE", @env.boring)
|
62
|
+
@env.no_colors = options.fetch "no_colors", ENV.fetch("TJ_NO_COLORS", @env.boring)
|
63
|
+
@env.no_animations = options.fetch "no_animations", ENV.fetch("TJ_NO_ANIMATIONS", @env.boring)
|
64
|
+
@env.no_landrush = options.fetch "no_landrush", ENV.fetch("TJ_NO_LANDRUSH", false)
|
65
|
+
@env.verbose = options.fetch "verbose", ENV.fetch("TJ_VERBOSE", false)
|
66
|
+
@env.dryrun = options.fetch "dryrun", ENV.fetch("TJ_DRYRUN", false)
|
67
|
+
end
|
68
|
+
|
69
|
+
map %w[--version -v] => :version
|
70
|
+
map %w[mk make new add] => :create
|
71
|
+
map %w[up prep init] => :setup
|
72
|
+
map %w[rm remove trash teardown] => :delete
|
73
|
+
map %w[ls projects apps sites] => :list
|
74
|
+
map %w[assets dev build] => :watch
|
75
|
+
map %w[dependencies deps] => :vendor
|
76
|
+
map %w[distrubute pack package] => :dist
|
77
|
+
map %w[wordpress] => :wp
|
78
|
+
map %w[bk] => :backup
|
79
|
+
map %w[tests spec specs] => :test
|
80
|
+
map %w[deployer server remote] => :deploy
|
81
|
+
map %w[vagrant vvv] => :vm
|
82
|
+
|
83
|
+
class_option :vm_path, :type => :string, :default => nil, :desc => "Force path to VM"
|
84
|
+
class_option :vm_ip, :type => :string, :default => nil, :desc => "Force IP address for VM"
|
85
|
+
class_option :vm_prefix, :type => :string, :default => nil, :desc => "Force directory prefix for project in VM"
|
86
|
+
class_option :yolo, :type => :boolean, :desc => "Say yes to anything and everything"
|
87
|
+
class_option :boring, :type => :boolean, :desc => "Disable all the coolness"
|
88
|
+
class_option :no_unicode, :type => :boolean, :desc => "Disable all unicode characters"
|
89
|
+
class_option :no_colors, :type => :boolean, :desc => "Disable all colored output"
|
90
|
+
class_option :no_animations, :type => :boolean, :desc => "Disable all animations"
|
91
|
+
class_option :no_landrush, :type => :boolean, :desc => "Disable landrush for DNS"
|
92
|
+
class_option :verbose, :type => :boolean, :desc => "Verbose output"
|
93
|
+
class_option :dryrun, :type => :boolean, :desc => "Disable running all commands"
|
94
|
+
|
95
|
+
desc "--version, -v", "Print current version"
|
96
|
+
#
|
97
|
+
# @return {String}
|
98
|
+
#
|
99
|
+
def version
|
100
|
+
@io.speak @version, :color => :green
|
101
|
+
end
|
102
|
+
|
103
|
+
desc "create", "Create new project"
|
104
|
+
method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => "Name of the project"
|
105
|
+
method_option :location, :type => :string, :aliases => "-l", :default => nil, :desc => "Location of the local project"
|
106
|
+
method_option :theme, :type => :string, :aliases => "-t", :default => nil, :desc => "Starter theme to install"
|
107
|
+
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
108
|
+
method_option :repository, :type => :string, :aliases => "-r", :desc => "Initialize a new Git remote repository"
|
109
|
+
method_option :db_import, :type => :string, :aliases => %w[-i --import-db], :desc => "Import an existing database"
|
110
|
+
method_option :bare, :type => :boolean, :desc => "Create a project without a starter theme"
|
111
|
+
method_option :skip_repo, :type => :boolean, :desc => "Skip repository prompts and use default settings"
|
112
|
+
method_option :skip_db, :type => :boolean, :desc => "Skip database prompts and use default settings"
|
113
|
+
method_option :use_defaults, :type => :boolean, :desc => "Skip all prompts and use default settings"
|
114
|
+
method_option :no_wp, :type => :boolean, :desc => "New project is not a WordPress install"
|
115
|
+
method_option :no_db, :type => :boolean, :desc => "New project does not need a database"
|
116
|
+
#
|
117
|
+
# @return {Void}
|
118
|
+
#
|
119
|
+
def create
|
120
|
+
@io.hello
|
121
|
+
@create.new(options).execute
|
122
|
+
end
|
123
|
+
|
124
|
+
desc "setup", "Setup existing project"
|
125
|
+
method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => "Name of the project"
|
126
|
+
method_option :location, :type => :string, :aliases => "-l", :default => nil, :desc => "Location of the local project"
|
127
|
+
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
128
|
+
method_option :repository, :type => :string, :aliases => "-r", :desc => "Initialize a new Git remote repository"
|
129
|
+
method_option :import_db, :type => :string, :aliases => "-i", :desc => "Import an existing database"
|
130
|
+
method_option :skip_repo, :type => :boolean, :desc => "Skip repository prompts and use default settings"
|
131
|
+
method_option :skip_db, :type => :boolean, :desc => "Skip database prompts and use default settings"
|
132
|
+
method_option :use_defaults, :type => :boolean, :desc => "Skip all prompts and use default settings"
|
133
|
+
method_option :no_wp, :type => :boolean, :desc => "New project is not a WordPress install"
|
134
|
+
method_option :no_db, :type => :boolean, :desc => "New project does not need a database"
|
135
|
+
#
|
136
|
+
# @return {Void}
|
137
|
+
#
|
138
|
+
def setup
|
139
|
+
@io.hello
|
140
|
+
@create.new(options.dup.merge({
|
141
|
+
:theme => false,
|
142
|
+
:bare => true,
|
143
|
+
})).execute
|
144
|
+
end
|
145
|
+
|
146
|
+
desc "delete", "Delete project (does not delete local project)"
|
147
|
+
method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => "Name of the project"
|
148
|
+
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
149
|
+
method_option :db_drop, :type => :boolean, :aliases => "--drop-db", :desc => "Drop project's database"
|
150
|
+
method_option :vm_restart, :type => :boolean, :aliases => "--restart-vm", :desc => "Restart VM after deletion"
|
151
|
+
#
|
152
|
+
# @return {Void}
|
153
|
+
#
|
154
|
+
def delete
|
155
|
+
@delete.new(options).unexecute
|
156
|
+
end
|
157
|
+
|
158
|
+
desc "deploy", "Manage deployment and migration"
|
159
|
+
#
|
160
|
+
# @return {Void}
|
161
|
+
#
|
162
|
+
def deploy
|
163
|
+
@deploy.new(options).execute
|
164
|
+
end
|
165
|
+
|
166
|
+
desc "list", "List all projects"
|
167
|
+
#
|
168
|
+
# @return {Void}
|
169
|
+
#
|
170
|
+
def list
|
171
|
+
@list.new(options).list :projects
|
172
|
+
end
|
173
|
+
|
174
|
+
desc "update", "Update tj and its dependencies"
|
175
|
+
#
|
176
|
+
# @return {Void}
|
177
|
+
#
|
178
|
+
def update(*commands)
|
179
|
+
@io.error "Not implemented"
|
180
|
+
end
|
181
|
+
|
182
|
+
desc "install", "Run installation for project"
|
183
|
+
#
|
184
|
+
# @return {Void}
|
185
|
+
#
|
186
|
+
def install(*commands)
|
187
|
+
@config.install commands
|
188
|
+
end
|
189
|
+
|
190
|
+
desc "watch [COMMANDS]", "Watch and compile assets"
|
191
|
+
#
|
192
|
+
# @return {Void}
|
193
|
+
#
|
194
|
+
def watch(*commands)
|
195
|
+
@config.watch commands
|
196
|
+
end
|
197
|
+
|
198
|
+
desc "vendor [COMMANDS]", "Manage vendor dependencies"
|
199
|
+
#
|
200
|
+
# @return {Void}
|
201
|
+
#
|
202
|
+
def vendor(*commands)
|
203
|
+
@config.vendor commands
|
204
|
+
end
|
205
|
+
|
206
|
+
desc "dist [COMMANDS]", "Package project for distribution"
|
207
|
+
#
|
208
|
+
# @return {Void}
|
209
|
+
#
|
210
|
+
def dist(*commands)
|
211
|
+
@config.dist commands
|
212
|
+
end
|
213
|
+
|
214
|
+
desc "wp [COMMANDS]", "Manage WordPress installation"
|
215
|
+
#
|
216
|
+
# @return {Void}
|
217
|
+
#
|
218
|
+
def wp(*commands)
|
219
|
+
@config.wp commands
|
220
|
+
end
|
221
|
+
|
222
|
+
desc "backup [COMMANDS]", "Backup project"
|
223
|
+
#
|
224
|
+
# @return {Void}
|
225
|
+
#
|
226
|
+
def backup(*commands)
|
227
|
+
@config.backup commands
|
228
|
+
end
|
229
|
+
|
230
|
+
desc "test [COMMANDS]", "Manage and run project tests"
|
231
|
+
#
|
232
|
+
# @return {Void}
|
233
|
+
#
|
234
|
+
def test(*commands)
|
235
|
+
@config.test commands
|
236
|
+
end
|
237
|
+
|
238
|
+
desc "vm [COMMANDS]", "Manage development environment"
|
239
|
+
#
|
240
|
+
# @return {Void}
|
241
|
+
#
|
242
|
+
def vm(*commands)
|
243
|
+
@util.inside @env.vm_path do
|
244
|
+
@util.run "vagrant #{commands.join(" ")}", :verbose => @env.verbose
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|