theme-juice 0.7.14 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -167
- data/lib/theme-juice/cli.rb +64 -91
- data/lib/theme-juice/commands/create.rb +26 -27
- data/lib/theme-juice/commands/delete.rb +4 -7
- data/lib/theme-juice/commands/deploy.rb +1 -14
- data/lib/theme-juice/env.rb +52 -3
- data/lib/theme-juice/helpers/singleton_helper.rb +8 -1
- data/lib/theme-juice/man/tj +212 -0
- data/lib/theme-juice/man/tj-create +115 -0
- data/lib/theme-juice/man/tj-create.txt +75 -0
- data/lib/theme-juice/man/tj-delete +53 -0
- data/lib/theme-juice/man/tj-delete.txt +39 -0
- data/lib/theme-juice/man/tj-setup +92 -0
- data/lib/theme-juice/man/tj-setup.txt +61 -0
- data/lib/theme-juice/man/tj.txt +130 -0
- data/lib/theme-juice/project.rb +13 -0
- data/lib/theme-juice/task.rb +0 -12
- data/lib/theme-juice/tasks/list.rb +0 -3
- data/lib/theme-juice/tasks/vm.rb +6 -6
- data/lib/theme-juice/version.rb +1 -1
- metadata +24 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d50dfbc36432478d991daefbc81e53ddcd798df3
|
4
|
+
data.tar.gz: e8e747c5a0241e2a9f7d47587082289202ac6b98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 162908ca692a307bec00807795c192715844ba0ae37026bfb2f6a3d53bc39f3b9d20f1e1fed7256da2dd57b13cafa95ccb58469a36959f08bf3c153e57b7cc83
|
7
|
+
data.tar.gz: 065bb0c1940a1f74837e0ed820ada4c5fc24c65034d028e45355e62112b0377d6de0889615f8ecc9dee47682859e3660f211c461b1f70cca2a49a51acbf5d142
|
data/README.md
CHANGED
@@ -5,38 +5,14 @@
|
|
5
5
|
[![Code Climate](https://img.shields.io/codeclimate/coverage/github/ezekg/theme-juice-cli.svg?style=flat-square)]()
|
6
6
|
[![GitHub license](https://img.shields.io/github/license/ezekg/theme-juice-cli.svg?style=flat-square)](https://github.com/ezekg/theme-juice-cli/blob/master/LICENSE)
|
7
7
|
|
8
|
+
_This project is currently under active development and will not be completely 'stable' per-say until we hit `1.0`. Everything here is subject to change without notice, but with that said, we will of course semantically version all of our releases. Feel free to contribute to the development with new features or bug fixes. [View our contributing guidelines](#contributing)_
|
9
|
+
|
8
10
|
## What is it?
|
9
11
|
Theme Juice is a WordPress development command line utility that allows you to scaffold out entire Vagrant development environments in seconds (using [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) as the VM), manage dependencies and build tools, and even handle deployments.
|
10
12
|
|
11
|
-
### But Why?
|
12
|
-
This project sprung out of an annoyance for the current workflow associated with WordPress and development in general. Things like:
|
13
|
-
* Local development. It's insanely hard (and intimidating!) for non-ops/CS engineers.
|
14
|
-
* WAMP/LAMP sucks.
|
15
|
-
* The local env setup process is monotonous. It's the same thing _over and over again_, aside from a couple variables here and there.
|
16
|
-
* It seems as though every few months a new build tool comes out, so you end up with projects created within the range of just a year or 2 having _completely_ different build tools. Does this project use Grunt? Guard? Oh, I see, it's using Gulp! No thanks.
|
17
|
-
* Dependency management for WordPress is terrible.
|
18
|
-
* A decent Git workflow for WordPress is even more terrible. Bloated repositories, out of date plugins, out of date core. It's a nightmare.
|
19
|
-
* Given all of that, projects are hard to maintain, especially across multiple environments. It's hard to onboard new team members. It just sucks.
|
20
|
-
|
21
|
-
In order to remedy most of those, I created a little Rake script that automated things like scaffolding out a new development site and also aliasing a few of the build tools that I used. A couple months later, I extracted that out to a little gem so that it didn't have to sit inside of a `Rakefile` (mainly because it utilized the oh-so-efficient copy-and-paste update method).
|
22
|
-
|
23
|
-
After using it for a few more months, adding features here and there, I realized how much it had changed my workflow. I was spending less time fighting the tools I wanted to use, and more time on our projects doing what I love (coding!). It sped up our workflow and made coding more enjoyable. The project really started to evolve into a true command line utility from there.
|
24
|
-
|
25
|
-
Another month or so down the line, I wanted to move `tj` out of alpha and really give it the attention and structure it deserved. So I spent a few more months doing a complete rewrite, learning a ton along the way. I bought a few books like [Design Patterns in Ruby](http://designpatternsinruby.com/) and gradually built up my Ruby skills. One thing I really wanted to focus on was _convention over configuration_, because most people don't care about the details; they want a local development site _that just works_.
|
26
|
-
|
27
|
-
Fast forward to now, and `tj` has become a staple for our WordPress development. It really has changed the way we do things. Enjoy.
|
28
|
-
|
29
13
|
## Installation
|
30
14
|
* First, install [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) for local development.
|
31
|
-
* Then
|
32
|
-
* [Composer](https://getcomposer.org/)
|
33
|
-
* [NPM](https://www.npmjs.com/) ([Here's a good guide on properly installing NPM to not need `sudo`](http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/))
|
34
|
-
* [Grunt-CLI](http://gruntjs.com/)
|
35
|
-
* [Gulp-CLI](http://gulpjs.com/)
|
36
|
-
* [Bower](http://bower.io/)
|
37
|
-
* [WP-CLI](http://wp-cli.org/)
|
38
|
-
* Make sure they're executable without `sudo`
|
39
|
-
* Finally, install with: `gem install theme-juice`
|
15
|
+
* Then install with: `gem install theme-juice`
|
40
16
|
* That's it!
|
41
17
|
|
42
18
|
## Windows users
|
@@ -92,150 +68,16 @@ You can specify an unlimited number of commands with an unlimited number of argu
|
|
92
68
|
|
93
69
|
## Usage
|
94
70
|
|
95
|
-
|
96
|
-
List all commands for `tj`.
|
97
|
-
```bash
|
98
|
-
tj
|
99
|
-
```
|
100
|
-
|
101
|
-
### Print version:
|
102
|
-
This command will print the current version of `tj`.
|
103
|
-
```bash
|
104
|
-
tj --version # Aliases: -v version
|
105
|
-
```
|
71
|
+
Use the `man` page to print command usage:
|
106
72
|
|
107
|
-
### Global flags:
|
108
|
-
| Flag | Type | Description |
|
109
|
-
|:---------------------- |:------ |:------------------------------------------ |
|
110
|
-
| `[--vm-path=PATH]` | Path | Force path to VM |
|
111
|
-
| `[--vm-ip=IP]` | String | Force IP address for VM |
|
112
|
-
| `[--vm-prefix=PREFIX]` | String | Force directory prefix for project in VM |
|
113
|
-
| `[--yolo]` | Bool | Say yes to anything and everything |
|
114
|
-
| `[--boring]` | Bool | Disable all the coolness |
|
115
|
-
| `[--no-unicode]` | Bool | Disable all unicode characters |
|
116
|
-
| `[--no-colors]` | Bool | Disable all colored output |
|
117
|
-
| `[--no-animations]` | Bool | Disable all animations |
|
118
|
-
| `[--no-landrush]` | Bool | Disable landrush for DNS |
|
119
|
-
| `[--verbose]` | Bool | Verbose output |
|
120
|
-
| `[--dryrun]` | Bool | Disable executing any commands |
|
121
|
-
|
122
|
-
_Use `ENV` variables to set global flags. For example, by running `export TJ_VM_PATH=~/vagrant-vvv`, the `ENV` variable will be used instead of the default `vm-path` from then on. You can remove global flags with `unset TJ_VM_PATH`_
|
123
|
-
|
124
|
-
### Creating a new development project:
|
125
|
-
Use this to create a new project. It will automagically set up your VM, including a local development site at `http://<url>.dev` with WordPress installed and a fresh WP database. It will sync up your local site installation with the Vagrant VM, so you can organize your projects however you want. This task will also install VVV into your `vm-path` directory if it has not already been installed.
|
126
|
-
```bash
|
127
|
-
tj create # Aliases: mk new
|
128
73
|
```
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
| `[-n, --name=NAME]` | String | Name of the project |
|
134
|
-
| `[-l, --location=LOCATION]` | Path | Location of the local project |
|
135
|
-
| `[-t, --theme=THEME]` | URL | Starter theme to install |
|
136
|
-
| `[-u, --url=URL]` | URL | Development URL for the project |
|
137
|
-
| `[-r, --repository=REPO]` | URL | Initialize a new Git remote repository |
|
138
|
-
| `[-i, --import-db=DB]` | Path | Import an existing database |
|
139
|
-
| `[--bare]` | Bool | Create a project without a starter theme |
|
140
|
-
| `[--skip-repo]` | Bool | Skip repository prompts and use default settings |
|
141
|
-
| `[--skip-db]` | Bool | Skip database prompts and use default settings |
|
142
|
-
| `[--use-defaults]` | Bool | Skip all prompts and use default settings |
|
143
|
-
| `[--no-wp]` | Bool | New project is not a WordPress install |
|
144
|
-
| `[--no-db]` | Bool | New project does not need a database |
|
145
|
-
|
146
|
-
### Setting up an existing project:
|
147
|
-
Use this to setup an existing local project within the development environment. You will go through the setup process to create the necessary files for the VM, including `vvv-hosts`, `vvv-nginx.conf`, DNS settings, and a fresh database (unless one already exists by the name chosen). This is essentially an alias for `create`, but with a few options being skipped.
|
148
|
-
```bash
|
149
|
-
tj setup # Aliases: up init
|
150
|
-
```
|
151
|
-
|
152
|
-
#### Option flags:
|
153
|
-
| Flag | Type | Description |
|
154
|
-
|:----------------------------------- |:------ |:------------------------------------------------ |
|
155
|
-
| `[-n, --name=NAME]` | String | Name of the project |
|
156
|
-
| `[-l, --location=LOCATION]` | Path | Location of the local project |
|
157
|
-
| `[-u, --url=URL]` | URL | Development URL for the project |
|
158
|
-
| `[-r, --repository=REPO]` | URL | Initialize a new Git remote repository |
|
159
|
-
| `[-i, --import-db=DB]` | Path | Import an existing database |
|
160
|
-
| `[--skip-repo]` | Bool | Skip repository prompts and use default settings |
|
161
|
-
| `[--skip-db]` | Bool | Skip database prompts and use default settings |
|
162
|
-
| `[--use-defaults]` | Bool | Skip all prompts and use default settings |
|
163
|
-
| `[--no-wp]` | Bool | New project is not a WordPress install |
|
164
|
-
| `[--no-db]` | Bool | New project does not need a database |
|
165
|
-
|
166
|
-
### Deleting a project from the VM:
|
167
|
-
Use this to remove a project from your development environment. This will only remove files that were generated by `tj`. including the database setup, development url, and shared directories. _It will not touch your local folders that were synced to the VM._
|
168
|
-
```bash
|
169
|
-
tj delete # Aliases: rm remove trash
|
170
|
-
```
|
171
|
-
|
172
|
-
#### Option flags:
|
173
|
-
| Flag | Type | Description |
|
174
|
-
|:------------------- |:------ |:------------------------------- |
|
175
|
-
| `[-n, --name=NAME]` | String | Name of the project |
|
176
|
-
| `[-u, --url=URL]` | URL | Development URL for the project |
|
177
|
-
| `[--db-drop]` | Bool | Drop project's database |
|
178
|
-
| `[--vm-restart]` | Bool | Restart VM after deletion |
|
179
|
-
|
180
|
-
### Managing deployment and migration (coming soon):
|
181
|
-
```bash
|
182
|
-
tj deploy # Aliases: server remote
|
183
|
-
```
|
184
|
-
|
185
|
-
### Listing all `tj` projects in the VM:
|
186
|
-
Use this to list all projects within your VM that were generated by `tj`.
|
187
|
-
```bash
|
188
|
-
tj list # Aliases: ls projects apps sites
|
189
|
-
```
|
190
|
-
|
191
|
-
### Managing development environment:
|
192
|
-
Use this to easily manage your [Varying Vagrant Vagrants](https://github.com/Varying-Vagrant-Vagrants/VVV) VM. This is a wrapper for Vagrant commands executed within your VM path.
|
193
|
-
```bash
|
194
|
-
tj vm # Aliases: vagrant vvv
|
195
|
-
```
|
196
|
-
|
197
|
-
### Running installation for project:
|
198
|
-
Uses `install` command within your config.
|
199
|
-
```bash
|
200
|
-
tj install # Aliases: build
|
201
|
-
```
|
202
|
-
|
203
|
-
### Watching and compiling assets:
|
204
|
-
Use this to watch and compile assets with your preferred build tool, whether that be [Grunt](https://github.com/gruntjs/grunt), [Gulp](https://github.com/gulpjs/gulp), [Guard](https://github.com/guard/guard), or whatever. This is simply a wrapper for whatever command is in your config file.
|
205
|
-
```bash
|
206
|
-
tj watch # Aliases: dev
|
207
|
-
```
|
208
|
-
|
209
|
-
### Managing vendor dependencies:
|
210
|
-
Use this to easily manage your dependencies with [Composer](https://github.com/composer/composer), or whatever command you set within your config.
|
211
|
-
```bash
|
212
|
-
tj vendor # Aliases: deps
|
213
|
-
```
|
214
|
-
|
215
|
-
### Locally executing WP-CLI inside your VM:
|
216
|
-
Upon setup, an `ssh` block for the VM is automatically added to the `wp-cli.local.yml` file with all of your VM paths. In our starter theme, we use [wp-cli-ssh](https://github.com/xwp/wp-cli-ssh) to run `wp` commands locally.
|
217
|
-
In order to do the same, it needs to be a dependency in your `composer.json`.
|
218
|
-
```bash
|
219
|
-
tj wp # Aliases: wordpress
|
220
|
-
```
|
221
|
-
|
222
|
-
### Backing up your database:
|
223
|
-
Uses `backup` command within your config.
|
224
|
-
```bash
|
225
|
-
tj backup # Aliases: bk
|
226
|
-
```
|
227
|
-
|
228
|
-
### Distributing a package of your project:
|
229
|
-
Uses `dist` command within your config.
|
230
|
-
```bash
|
231
|
-
tj dist # Aliases: zip package pkg
|
74
|
+
tj
|
75
|
+
tj -h
|
76
|
+
tj help
|
77
|
+
tj --help
|
232
78
|
```
|
233
79
|
|
234
|
-
|
235
|
-
Uses `test` command within your config.
|
236
|
-
```bash
|
237
|
-
tj test # Aliases: tests spec specs
|
238
|
-
```
|
80
|
+
See [themejuice.it](http://themejuice.it) for the full documentation.
|
239
81
|
|
240
82
|
## Can I add my starter theme, ________?
|
241
83
|
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 the theme includes a `Juicefile` (not required, but preferred to automate build steps), and that everything looks solid. Until then (or if your theme is private), just run `tj create --theme https://your.repo/link/goes.here` to clone your theme.
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -6,36 +6,37 @@ module ThemeJuice
|
|
6
6
|
def initialize(*)
|
7
7
|
super
|
8
8
|
|
9
|
-
@version
|
10
|
-
@env
|
11
|
-
@io
|
12
|
-
@config
|
13
|
-
@project
|
14
|
-
@util
|
15
|
-
@list
|
16
|
-
@create
|
17
|
-
@delete
|
18
|
-
@deploy
|
9
|
+
@version = VERSION
|
10
|
+
@env = Env
|
11
|
+
@io = IO
|
12
|
+
@config = Config
|
13
|
+
@project = Project
|
14
|
+
@util = Util.new
|
15
|
+
@list = Tasks::List
|
16
|
+
@create = Commands::Create
|
17
|
+
@delete = Commands::Delete
|
18
|
+
@deploy = Commands::Deploy
|
19
19
|
|
20
20
|
init_env
|
21
21
|
end
|
22
22
|
|
23
23
|
no_commands do
|
24
24
|
def init_env
|
25
|
-
@env.vm_path = options
|
26
|
-
@env.vm_ip = options
|
27
|
-
@env.vm_prefix = options
|
28
|
-
@env.yolo = options
|
29
|
-
@env.boring = options
|
30
|
-
@env.no_unicode = options
|
31
|
-
@env.no_colors = options
|
32
|
-
@env.no_animations = options
|
33
|
-
@env.no_landrush = options
|
34
|
-
@env.verbose = options
|
35
|
-
@env.dryrun = options
|
25
|
+
@env.vm_path = options[:vm_path]
|
26
|
+
@env.vm_ip = options[:vm_ip]
|
27
|
+
@env.vm_prefix = options[:vm_prefix]
|
28
|
+
@env.yolo = options[:yolo]
|
29
|
+
@env.boring = options[:boring]
|
30
|
+
@env.no_unicode = options[:no_unicode]
|
31
|
+
@env.no_colors = options[:no_colors]
|
32
|
+
@env.no_animations = options[:no_animations]
|
33
|
+
@env.no_landrush = options[:no_landrush]
|
34
|
+
@env.verbose = options[:verbose]
|
35
|
+
@env.dryrun = options[:dryrun]
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
map %w[man, doc, docs] => :help
|
39
40
|
map %w[--version -v] => :version
|
40
41
|
map %w[mk new] => :create
|
41
42
|
map %w[up init] => :setup
|
@@ -50,23 +51,40 @@ module ThemeJuice
|
|
50
51
|
map %w[tests spec specs] => :test
|
51
52
|
map %w[server remote] => :deploy
|
52
53
|
map %w[vagrant vvv] => :vm
|
53
|
-
|
54
|
-
class_option :
|
55
|
-
class_option :
|
56
|
-
class_option :
|
57
|
-
class_option :
|
58
|
-
class_option :
|
59
|
-
class_option :
|
60
|
-
class_option :
|
61
|
-
class_option :
|
62
|
-
class_option :
|
63
|
-
class_option :
|
64
|
-
class_option :
|
54
|
+
|
55
|
+
class_option :vm_box, :type => :string, :default => nil, :desc => "Force Vagrant box for VM"
|
56
|
+
class_option :vm_path, :type => :string, :default => nil, :desc => "Force path to VM"
|
57
|
+
class_option :vm_ip, :type => :string, :default => nil, :desc => "Force IP address of VM"
|
58
|
+
class_option :vm_prefix, :type => :string, :default => nil, :desc => "Force directory prefix for project in VM"
|
59
|
+
class_option :yolo, :type => :boolean, :desc => "Say yes to anything and everything (try it)"
|
60
|
+
class_option :boring, :type => :boolean, :desc => "Prints all output without anything fancy"
|
61
|
+
class_option :no_unicode, :type => :boolean, :desc => "Prints all output without unicode characters"
|
62
|
+
class_option :no_colors, :type => :boolean, :aliases => "--no-color", :desc => "Prints all output without color"
|
63
|
+
class_option :no_animations, :type => :boolean, :desc => "Prints all output without animations (coming soon)"
|
64
|
+
class_option :no_landrush, :type => :boolean, :desc => "Disable landrush for DNS"
|
65
|
+
class_option :verbose, :type => :boolean, :desc => "Prints out additional logging information"
|
66
|
+
class_option :dryrun, :type => :boolean, :aliases => "--dry-run", :desc => "Run a command without actually executing anything"
|
67
|
+
|
68
|
+
desc "--help, -h", "View man page"
|
69
|
+
def help(command = nil)
|
70
|
+
root = File.expand_path "../man", __FILE__
|
71
|
+
man = ["tj", command].compact.join("-")
|
72
|
+
begin
|
73
|
+
if File.exist? "#{root}/#{man}"
|
74
|
+
if OS.windows?
|
75
|
+
@io.speak File.read "#{root}/#{man}.txt", :color => :white
|
76
|
+
else
|
77
|
+
@util.run "man #{root}/#{man}", :verbose => @env.verbose
|
78
|
+
end
|
79
|
+
else
|
80
|
+
@io.speak "No man page available for '#{command}'", :color => :red
|
81
|
+
end
|
82
|
+
rescue
|
83
|
+
super
|
84
|
+
end
|
85
|
+
end
|
65
86
|
|
66
87
|
desc "--version, -v", "Print current version"
|
67
|
-
#
|
68
|
-
# @return {String}
|
69
|
-
#
|
70
88
|
def version
|
71
89
|
@io.speak @version, :color => :green
|
72
90
|
end
|
@@ -78,15 +96,12 @@ module ThemeJuice
|
|
78
96
|
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
79
97
|
method_option :repository, :type => :string, :aliases => "-r", :desc => "Initialize a new Git remote repository"
|
80
98
|
method_option :db_import, :type => :string, :aliases => %w[-i --import-db], :desc => "Import an existing database"
|
81
|
-
method_option :bare, :type => :boolean,
|
99
|
+
method_option :bare, :type => :boolean, :aliases => %w[--no-theme], :desc => "Create a project without a starter theme"
|
82
100
|
method_option :skip_repo, :type => :boolean, :desc => "Skip repository prompts and use default settings"
|
83
101
|
method_option :skip_db, :type => :boolean, :desc => "Skip database prompts and use default settings"
|
84
102
|
method_option :use_defaults, :type => :boolean, :desc => "Skip all prompts and use default settings"
|
85
|
-
method_option :no_wp, :type => :boolean, :desc => "
|
86
|
-
method_option :no_db, :type => :boolean, :desc => "
|
87
|
-
#
|
88
|
-
# @return {Void}
|
89
|
-
#
|
103
|
+
method_option :no_wp, :type => :boolean, :desc => "Project is not a WordPress install"
|
104
|
+
method_option :no_db, :type => :boolean, :desc => "Project does not need a database"
|
90
105
|
def create
|
91
106
|
@io.hello
|
92
107
|
@create.new(options).execute
|
@@ -101,115 +116,73 @@ module ThemeJuice
|
|
101
116
|
method_option :skip_repo, :type => :boolean, :desc => "Skip repository prompts and use default settings"
|
102
117
|
method_option :skip_db, :type => :boolean, :desc => "Skip database prompts and use default settings"
|
103
118
|
method_option :use_defaults, :type => :boolean, :desc => "Skip all prompts and use default settings"
|
104
|
-
method_option :no_wp, :type => :boolean, :desc => "
|
105
|
-
method_option :no_db, :type => :boolean, :desc => "
|
106
|
-
#
|
107
|
-
# @return {Void}
|
108
|
-
#
|
119
|
+
method_option :no_wp, :type => :boolean, :desc => "Project is not a WordPress install"
|
120
|
+
method_option :no_db, :type => :boolean, :desc => "Project does not need a database"
|
109
121
|
def setup
|
110
122
|
@io.hello
|
111
|
-
@create.new(options.dup.merge(
|
112
|
-
:theme => false,
|
113
|
-
:bare => true,
|
114
|
-
})).execute
|
123
|
+
@create.new(options.dup.merge(:bare => true)).execute
|
115
124
|
end
|
116
125
|
|
117
|
-
desc "delete", "Delete project (does not delete local project)"
|
126
|
+
desc "delete", "Delete a project (does not delete local project)"
|
118
127
|
method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => "Name of the project"
|
119
128
|
method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => "Development URL for the project"
|
120
|
-
method_option :db_drop, :type => :boolean, :aliases => "--drop-db", :desc => "Drop project's database"
|
121
|
-
method_option :vm_restart, :type => :boolean, :aliases => "--restart-vm", :desc => "Restart VM after deletion"
|
122
|
-
#
|
123
|
-
# @return {Void}
|
124
|
-
#
|
129
|
+
method_option :db_drop, :type => :boolean, :aliases => "--drop-db", :desc => "Drop the project's database"
|
130
|
+
method_option :vm_restart, :type => :boolean, :aliases => "--restart-vm", :desc => "Restart the VM after deletion"
|
125
131
|
def delete
|
126
132
|
@delete.new(options).unexecute
|
127
133
|
end
|
128
134
|
|
129
135
|
desc "deploy", "Manage deployment and migration"
|
130
|
-
#
|
131
|
-
# @return {Void}
|
132
|
-
#
|
133
136
|
def deploy
|
134
137
|
@deploy.new(options).execute
|
135
138
|
end
|
136
139
|
|
137
140
|
desc "list", "List all projects"
|
138
|
-
#
|
139
|
-
# @return {Void}
|
140
|
-
#
|
141
141
|
def list
|
142
142
|
@list.new(options).list :projects
|
143
143
|
end
|
144
144
|
|
145
145
|
desc "update", "Update tj and its dependencies"
|
146
|
-
#
|
147
|
-
# @return {Void}
|
148
|
-
#
|
149
146
|
def update(*commands)
|
150
147
|
@io.error "Not implemented"
|
151
148
|
end
|
152
149
|
|
153
150
|
desc "install", "Run installation for project"
|
154
|
-
#
|
155
|
-
# @return {Void}
|
156
|
-
#
|
157
151
|
def install(*commands)
|
158
152
|
@config.install commands
|
159
153
|
end
|
160
154
|
|
161
|
-
desc "watch [COMMANDS]", "
|
162
|
-
#
|
163
|
-
# @return {Void}
|
164
|
-
#
|
155
|
+
desc "watch [COMMANDS]", "Manage development build tools"
|
165
156
|
def watch(*commands)
|
166
157
|
@config.watch commands
|
167
158
|
end
|
168
159
|
|
169
160
|
desc "vendor [COMMANDS]", "Manage vendor dependencies"
|
170
|
-
#
|
171
|
-
# @return {Void}
|
172
|
-
#
|
173
161
|
def vendor(*commands)
|
174
162
|
@config.vendor commands
|
175
163
|
end
|
176
164
|
|
177
165
|
desc "dist [COMMANDS]", "Package project for distribution"
|
178
|
-
#
|
179
|
-
# @return {Void}
|
180
|
-
#
|
181
166
|
def dist(*commands)
|
182
167
|
@config.dist commands
|
183
168
|
end
|
184
169
|
|
185
170
|
desc "wp [COMMANDS]", "Manage WordPress installation"
|
186
|
-
#
|
187
|
-
# @return {Void}
|
188
|
-
#
|
189
171
|
def wp(*commands)
|
190
172
|
@config.wp commands
|
191
173
|
end
|
192
174
|
|
193
175
|
desc "backup [COMMANDS]", "Backup project"
|
194
|
-
#
|
195
|
-
# @return {Void}
|
196
|
-
#
|
197
176
|
def backup(*commands)
|
198
177
|
@config.backup commands
|
199
178
|
end
|
200
179
|
|
201
180
|
desc "test [COMMANDS]", "Manage and run project tests"
|
202
|
-
#
|
203
|
-
# @return {Void}
|
204
|
-
#
|
205
181
|
def test(*commands)
|
206
182
|
@config.test commands
|
207
183
|
end
|
208
184
|
|
209
185
|
desc "vm [COMMANDS]", "Manage development environment"
|
210
|
-
#
|
211
|
-
# @return {Void}
|
212
|
-
#
|
213
186
|
def vm(*commands)
|
214
187
|
@util.inside @env.vm_path do
|
215
188
|
@util.run "vagrant #{commands.join(" ")}", :verbose => @env.verbose
|