theme-juice 0.8.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91d47b7e0fd30654ac1d54a0097a953eb916af23
4
- data.tar.gz: a6b2fe4130dfd09e971b34a4b4557416dfed6e6f
3
+ metadata.gz: acf36f2a3870a2e63c713285fb91c7da4e9d2393
4
+ data.tar.gz: 194ed25293316904e6ac46137c044204fc904dd9
5
5
  SHA512:
6
- metadata.gz: ab0beeb38e31465f50033eab21e1e38c45ed08c11f68ff3520233e1786987d2498b04b19f845f2e6090445899eb4f198dad55e3bb5c19c1398bb47768e6cdac0
7
- data.tar.gz: 96fe2fb07b69df25fdfd0e2d4269df8b02b024c3236c3151e7e4c4baeb3066dc2ef8e2144f49d1990c5686633722c737c2f194228236e44193d71fcc54e8e6e1
6
+ metadata.gz: 4b4bd5e07b172eb92e28d4a27c90c6855381e4ee5d3d37e1d6c9eb7e196bbf9d7e7afeb2373768016ca3f4c8bf80ba5054943a5f59cf0d0f7a3ccc120cf25384
7
+ data.tar.gz: 241be55eb0c498e64e49670404b0c96fb3700f294c00fcc9ff71568224eff6cbee2a119d397a1d61057b474e6cf5641c61a1b48485e5987763e2f95e4bb16809
data/README.md CHANGED
@@ -1,36 +1,133 @@
1
- # Theme Juice
2
- [![Gem Version](http://img.shields.io/gem/v/theme-juice.svg)](https://rubygems.org/gems/theme-juice)
3
- [![Travis](https://img.shields.io/travis/ezekg/theme-juice-cli.svg?style=flat-square)]()
4
- [![Code Climate](https://img.shields.io/codeclimate/github/ezekg/theme-juice-cli.svg?style=flat-square)]()
5
- [![Code Climate](https://img.shields.io/codeclimate/coverage/github/ezekg/theme-juice-cli.svg?style=flat-square)]()
1
+ # Theme Juice CLI
2
+ [![Gem Version](http://img.shields.io/gem/v/theme-juice.svg?style=flat-square)](https://rubygems.org/gems/theme-juice)
3
+ [![Travis](https://img.shields.io/travis/ezekg/theme-juice-cli.svg?style=flat-square)](https://travis-ci.org/ezekg/theme-juice-cli)
4
+ [![Code Climate](https://img.shields.io/codeclimate/github/ezekg/theme-juice-cli.svg?style=flat-square)](https://codeclimate.com/github/ezekg/theme-juice-cli)
5
+ [![Code Climate](https://img.shields.io/codeclimate/coverage/github/ezekg/theme-juice-cli.svg?style=flat-square)](https://codeclimate.com/github/ezekg/theme-juice-cli)
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)_
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. (We will of course semantically version all of our releases, with the minor version being incremented with new features/breaking changes.) Feel free to contribute to the development with new features, ideas or bug fixes._
9
+
10
+ [View our contributing guidelines to get started!](#contributing)
9
11
 
10
12
  ## What is it?
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.
13
+ **Theme Juice** is a WordPress development command line utility that allows you to scaffold out an entire Vagrant development environment in seconds (using an Apache fork of [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) called [VVV-Apache](https://github.com/ericmann/vvv-apache.git) as the VM). It also helps you manage dependencies and build tools, and can even handle your deployments.
14
+
15
+ ## Requirements
16
+ **`tj` requires [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) to be able to create virtual machines for local development. Please download and install both of these before getting started.**
17
+
18
+ I recommend one of the latest versions of Ruby MRI (2.2, 2.1, 2.0). `tj` requires at least MRI 1.9.3. For the full report, check out the [Travis CI build status](https://travis-ci.org/ezekg/theme-juice-cli), where I test against an array of Ruby interpreters.
12
19
 
13
20
  ## Installation
14
- * First, install [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) for local development.
15
- * Then install with: `gem install theme-juice`
16
- * That's it!
21
+ ```
22
+ gem install theme-juice
23
+ ```
24
+
25
+ ## Getting Started
26
+
27
+ #### Create a new project
28
+ This will lead you through a series of prompts to set up required project information, such as name, location, theme, database info, etc. Using the specified information, it will run the installation process and set up a local development environment, if it hasn't already been set up. It will sync your local project location with the project
29
+ location within the VM, so you can run this from anywhere on your local system.
30
+
31
+ ```
32
+ tj create
33
+ ```
34
+
35
+ #### Set up an existing project
36
+ This sets up an existing local project within the development environment. You will go through a series of prompts to create the necessary files. This command is essentially an alias for `tj create --bare`.
17
37
 
18
- ## Windows users
19
- Since Windows doesn't support UTF-8 characters inside of the terminal, and is picky about colors, you'll have to run `tj` with a couple flags. What has worked for me on my Windows machine at home is to run all commands through [git-scm](http://git-scm.com/downloads) with the `--boring --no-landrush` flags.
38
+ ```
39
+ tj setup
40
+ ```
41
+
42
+ #### Removing a project
43
+ This will remove a project from your development environment. This will only remove files that were generated by `tj` i.e. the database setup, DNS setup, and the project's shared directories.
20
44
 
21
- This disables all unicode characters and colors from being output, and disables [Landrush](https://github.com/phinze/landrush), which isn't fully supported on Windows. To set these globally via the `ENV`, run:
45
+ It will not touch your local folders that were synced to the VM.
46
+
47
+ ```
48
+ tj delete
49
+ ```
50
+
51
+ #### Want More?
52
+ Want to check out all of the various flags and features `tj` offers? Just ask `tj` for help, and you'll be greeted with a nice `man` page full of information about how to use just about everything.
53
+
54
+ ```
55
+ tj help
56
+ ```
57
+
58
+ Or, check out [themejuice.it](http://themejuice.it) for a pretty website chock-full of documentation.
59
+
60
+ ## FAQ
61
+
62
+ 1. [Is Windows Supported?](#is-windows-supported)
63
+ 1. [Can I use the original VVV instead of VVV-Apache?](#can-i-use-the-original-vvv-instead-of-vvv-apache)
64
+ 1. [So, does that mean I can use any Vagrant box?](#so-does-that-mean-i-can-use-any-vagrant-box)
65
+ 1. [What is a `Customfile`?](#what-is-a-customfile)
66
+ 1. [What is a `Juicefile`?](#what-is-a-juicefile)
67
+ 1. [Does `tj` handle deployments?](#does-tj-handle-deployments)
68
+ 1. [Can I access a project from another device (i.e. mobile)?](#can-i-access-a-project-from-another-device-ie-mobile)
69
+ 1. [Help! It won't let me `git clone` anything!](#help-it-wont-let-me-git-clone-anything)
70
+ 1. [Can I add my starter theme, ________?](#can-i-add-my-starter-theme-________)
71
+
72
+ #### Is Windows supported?
73
+ Yes! But, since Windows doesn't support UTF-8 characters inside of the terminal, and is picky about ASCII colors, you'll probably have to run `tj` with a couple flags.
74
+
75
+ Something that has worked for me on one of my Windows machines is to run all commands through [git-scm](http://git-scm.com/downloads) with the `--boring --no-landrush` flags. This will disable all unicode characters and colors from being output, and will also disable [Landrush](https://github.com/phinze/landrush), which isn't fully supported on Windows.
76
+
77
+ To set these globally via the `ENV`, set the following environment variables or run the commands below in your terminal:
22
78
 
23
79
  ```bash
24
80
  export TJ_BORING=true
25
81
  export TJ_NO_LANDRUSH=true
26
82
  ```
27
83
 
28
- In addition to that, `tj` uses the [OS gem](https://github.com/rdp/os) to sniff out your OS and adjusts a few things accordingly to make sure things don't break. _I don't regularly develop on Windows, so if you encounter any bugs, please let me know through a **well-documented** issue and I'll try my best to get it resolved._
84
+ In addition to that, `tj` uses the [OS gem](https://github.com/rdp/os) to sniff out your OS and it'll adjust a few things accordingly to make sure that nothing breaks.
85
+
86
+ _I don't regularly develop on Windows, so if you encounter any bugs, please let me know through a **well-documented** issue and I'll try my best to get it resolved._
87
+
88
+ #### Can I use the original VVV instead of VVV-Apache?
89
+ Definitely. If you want to use `tj` with Nginx and the [original VVV](https://github.com/Varying-Vagrant-Vagrants/VVV), it's as simple as running `tj` with a few flags:
90
+
91
+ ```bash
92
+ tj new --vm-box git@github.com:Varying-Vagrant-Vagrants/VVV.git --nginx
93
+ ```
29
94
 
30
- ## Config
31
- Because everybody likes to use different tools, you can create a `Juicefile` or `tj.yaml` config (with an optional preceding `.`) that will house all of your theme-specific commands. This allows you to use a streamlined set of commands that will act as aliases to your per-project configuration, as well as starter-theme specific information, such as deployment configuration, etc. For right now, we'll just stick to the `commands` section.
95
+ To use these permanently, set the appropriate `ENV` variables through your `.bashrc` or similar, i.e. `export TJ_VM_BOX=git@github.com:Varying-Vagrant-Vagrants/VVV.git` and `export TJ_NGINX=true`.
32
96
 
33
- If you're into [Grunt](https://github.com/gruntjs/grunt), then use it. Prefer [Gulp](https://github.com/gulpjs/gulp)? What about [Guard](https://github.com/guard/guard)? Go right ahead. It's compeletely up to you and your team. This is obviously relative to the starter theme you use, since you can't exactly use Grunt with a project that doesn't support it.
97
+ _Note: Before running this, you might want to either choose a new `vm-path`, or destroy any existing VMs inside of your `~/vagrant` directory. If `tj` detects a VM already installed, it will skip installing the new box._
98
+
99
+ #### So, does that mean I can use any Vagrant box?
100
+ Yes and no; in order for `tj` to properly create a project, the Vagrant box needs to follow the same directory structure as VVV, and include a `Customfile`. Here is the required structure that `tj` needs in order to be able to create new projects:
101
+
102
+ ```
103
+ ├── config/
104
+ | |
105
+ | ├── {apache,nginx}-config/
106
+ | | |
107
+ | | ├── site-1.conf
108
+ | | ├── site-2.conf
109
+ | | ..
110
+ | ..
111
+ ├── www/
112
+ | |
113
+ | ├── site-1/
114
+ | | |
115
+ | | ├── index.php
116
+ | | ..
117
+ | ├── site-2/
118
+ | | |
119
+ | | ├── index.php
120
+ | | ..
121
+ | ..
122
+ ├── Customfile
123
+ ...
124
+ ```
125
+
126
+ #### What is a `Customfile`?
127
+ [It's a file that contains custom rules to add into the main `Vagrantfile`, without actually having to modify it](https://github.com/Varying-Vagrant-Vagrants/VVV/blob/develop/Vagrantfile#L208-L218). This allows us to easily modify the Vagrant box without causing merge conflicts if you were to update the VM source via `git pull`.
128
+
129
+ #### What is a `Juicefile`?
130
+ A YAML configuration file (`Juicefile`) can be used to store commonly-used build scripts. Each command block sequence can be mapped to an individual project's build tool, allowing a streamlined set of commands to be used across multiple projects that utilize different tools. In the near-future, this will also house your deployment configuration.
34
131
 
35
132
  Below is the config that comes baked into [our starter theme](https://github.com/ezekg/theme-juice-starter):
36
133
 
@@ -54,7 +151,7 @@ commands:
54
151
  - tar -zcvf dist.tar.gz .
55
152
  ```
56
153
 
57
- Each list of commands is run within a single execution, with all `%args%`/`%argN%` being replaced by the passed command. Here's a few example scenarios:
154
+ Each command sequence is run within a single execution, with all `%args%`/`%argN%` being replaced by the passed command. Here's a few example scenarios:
58
155
  ```bash
59
156
  # Will contain all arguments stitched together by a space
60
157
  cmd1 %args%
@@ -64,28 +161,37 @@ cmd2 '%arg1% %arg2% %arg3%'
64
161
  cmd3 "%arg4%"
65
162
  ```
66
163
 
67
- You can specify an unlimited number of commands with an unlimited number of arguments; however, should be careful with how this is used. Don't do something like including `sudo rm -rf %arg1%` in a command, and then passing `/` as an argument. Keep it simple. These are meant to make your life easier by managing build tools, not to do fancy scripting.
164
+ You can specify an unlimited number of commands with an unlimited number of arguments; however, you should be careful with how this is used. Don't go including `sudo rm -rf %arg1%` in a command, while passing `/` as an argument. Keep it simple. These are meant to make your life easier by helping you manage build tools, not to do fancy scripting.
165
+
166
+ #### Does `tj` handle deployments?
167
+ Eventually, yes. It's not currently production-ready, but as soon as it is, we'll have detailed instructions on how to configure and deploy applications using `tj`. Right now, I'm leaning towards integrating an automated Capistrano workflow, but am open to other options. [Have an idea and want to contribute?](#contributing)
168
+
169
+ #### Can I access a project from another device (i.e. mobile)?
170
+ Yes! Every project created with `tj` will automatically be set up to support using [xip.io](http://xip.io/). If you're using OSX, then everything should work out of the box. If you're not using OSX, then you'll need to point port `80` on your host machine to `8080`; Vagrant cannot do this by default for security reasons.
68
171
 
69
- ## Usage
172
+ Once everything is good to go, you can access a project from another device on the same network by going to `<project-name>.<your-hosts-ip-address>.xip.io` e.g. `themejuice.192.168.1.1.xip.io`.
70
173
 
71
- Use the `man` page to print command usage:
174
+ #### Help! It won't let me `git clone` anything!
175
+ You most likely don't have [SSH-keys for GitHub set up correctly (if even at all)](https://help.github.com/articles/error-permission-denied-publickey/). Either set that up, or manually run `tj` with the appropriate flags corresponding to the problem-repository, swapping out `git@github.com:` for `https://github.com/`:
72
176
 
73
177
  ```
74
- tj
75
- tj -h
76
- tj help
77
- tj --help
178
+ tj create --theme https://github.com/theme/repository.git --vm-box https://github.com/vm-box/repository.git
78
179
  ```
79
180
 
80
- See [themejuice.it](http://themejuice.it) for the full documentation.
81
-
82
- ## Can I add my starter theme, ________?
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.
181
+ #### Can I add my starter theme, ________?
182
+ 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-L12) 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.
84
183
 
85
184
  ## Contributing
86
- 1. First, create a _well documented_ [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature/bug fix.
87
- 1. [Fork the repository](https://github.com/ezekg/theme-juice-cli/fork).
88
- 1. Create a new feature branch. (`git checkout -b my-new-feature`)
89
- 1. Commit your changes. (`git commit -am 'add some feature'`)
90
- 1. Push to the new branch. (`git push origin my-new-feature`)
91
- 1. Create a new Pull Request.
185
+ 1. First, create a _well documented_ [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature/bug fix
186
+ 1. After getting approval for the new feature, [fork the repository](https://github.com/ezekg/theme-juice-cli/fork)
187
+ 1. Create a new feature branch (`git checkout -b my-new-feature`)
188
+ 1. Write tests before pushing your changes, then run Rspec (`rake`)
189
+ 1. Commit your changes (`git commit -am 'add some feature'`)
190
+ 1. Push to the new branch (`git push origin my-new-feature`)
191
+ 1. Create a new Pull Request
192
+
193
+ ## License
194
+ Please see [LICENSE](https://github.com/ezekg/theme-juice-cli/blob/master/LICENSE) for licensing details.
195
+
196
+ ## Author
197
+ Ezekiel Gabrielse, [@ezekkkg](https://twitter.com/ezekkkg), [http://ezekielg.com](http://ezekielg.com)
@@ -9,7 +9,6 @@ module ThemeJuice
9
9
  end
10
10
 
11
11
  require "theme-juice/version"
12
- require "theme-juice/patches/option"
13
12
  require "theme-juice/helpers/singleton_helper"
14
13
  require "theme-juice/env"
15
14
  require "theme-juice/project"
@@ -18,15 +17,16 @@ require "theme-juice/io"
18
17
  require "theme-juice/config"
19
18
  require "theme-juice/task"
20
19
  require "theme-juice/tasks/entry"
21
- require "theme-juice/tasks/vm"
20
+ require "theme-juice/tasks/vm_box"
22
21
  require "theme-juice/tasks/create_confirm"
23
22
  require "theme-juice/tasks/delete_confirm"
24
23
  require "theme-juice/tasks/location"
25
24
  require "theme-juice/tasks/theme"
26
25
  require "theme-juice/tasks/repo"
27
26
  require "theme-juice/tasks/dot_env"
28
- require "theme-juice/tasks/hosts"
27
+ require "theme-juice/tasks/forward_ports"
29
28
  require "theme-juice/tasks/nginx"
29
+ require "theme-juice/tasks/apache"
30
30
  require "theme-juice/tasks/vm_plugins"
31
31
  require "theme-juice/tasks/vm_location"
32
32
  require "theme-juice/tasks/vm_customfile"
@@ -22,22 +22,24 @@ module ThemeJuice
22
22
 
23
23
  no_commands do
24
24
  def init_env
25
- @env.vm_box = options[:vm_box]
26
- @env.vm_path = options[:vm_path]
27
- @env.vm_ip = options[:vm_ip]
28
- @env.vm_prefix = options[:vm_prefix]
29
- @env.yolo = options[:yolo]
30
- @env.boring = options[:boring]
31
- @env.no_unicode = options[:no_unicode]
32
- @env.no_colors = options[:no_colors]
33
- @env.no_animations = options[:no_animations]
34
- @env.no_landrush = options[:no_landrush]
35
- @env.verbose = options[:verbose]
36
- @env.dryrun = options[:dryrun]
25
+ @env.vm_box = options[:vm_box]
26
+ @env.vm_path = options[:vm_path]
27
+ @env.vm_ip = options[:vm_ip]
28
+ @env.vm_prefix = options[:vm_prefix]
29
+ @env.yolo = options[:yolo]
30
+ @env.boring = options[:boring]
31
+ @env.no_unicode = options[:no_unicode]
32
+ @env.no_colors = options[:no_colors]
33
+ @env.no_animations = options[:no_animations]
34
+ @env.no_landrush = options[:no_landrush]
35
+ @env.no_port_forward = options[:no_port_forward]
36
+ @env.verbose = options[:verbose]
37
+ @env.dryrun = options[:dryrun]
38
+ @env.nginx = options[:nginx]
37
39
  end
38
40
  end
39
41
 
40
- map %w[man, doc, docs] => :help
42
+ map %w[man doc docs] => :help
41
43
  map %w[--version -v] => :version
42
44
  map %w[mk new] => :create
43
45
  map %w[up init] => :setup
@@ -52,19 +54,21 @@ module ThemeJuice
52
54
  map %w[tests spec specs] => :test
53
55
  map %w[server remote] => :deploy
54
56
  map %w[vagrant vvv] => :vm
55
-
56
- class_option :vm_box, :type => :string, :default => nil, :desc => "Force Vagrant box for VM"
57
- class_option :vm_path, :type => :string, :default => nil, :desc => "Force path to VM"
58
- class_option :vm_ip, :type => :string, :default => nil, :desc => "Force IP address of VM"
59
- class_option :vm_prefix, :type => :string, :default => nil, :desc => "Force directory prefix for project in VM"
60
- class_option :yolo, :type => :boolean, :desc => "Say yes to anything and everything (try it)"
61
- class_option :boring, :type => :boolean, :desc => "Prints all output without anything fancy"
62
- class_option :no_unicode, :type => :boolean, :desc => "Prints all output without unicode characters"
63
- class_option :no_colors, :type => :boolean, :aliases => "--no-color", :desc => "Prints all output without color"
64
- class_option :no_animations, :type => :boolean, :desc => "Prints all output without animations (coming soon)"
65
- class_option :no_landrush, :type => :boolean, :desc => "Disable landrush for DNS"
66
- class_option :verbose, :type => :boolean, :desc => "Prints out additional logging information"
67
- class_option :dryrun, :type => :boolean, :aliases => "--dry-run", :desc => "Run a command without actually executing anything"
57
+
58
+ class_option :vm_box, :type => :string, :default => nil, :desc => "Force Vagrant box for use as VM"
59
+ class_option :vm_path, :type => :string, :default => nil, :desc => "Force path to VM"
60
+ class_option :vm_ip, :type => :string, :default => nil, :desc => "Force IP address of VM"
61
+ class_option :vm_prefix, :type => :string, :default => nil, :desc => "Force directory prefix for project in VM"
62
+ class_option :yolo, :type => :boolean, :desc => "Say yes to anything and everything (try it)"
63
+ class_option :boring, :type => :boolean, :desc => "Prints all output without anything fancy"
64
+ class_option :no_unicode, :type => :boolean, :desc => "Prints all output without unicode characters"
65
+ class_option :no_colors, :type => :boolean, :aliases => "--no-color", :desc => "Prints all output without color"
66
+ class_option :no_animations, :type => :boolean, :desc => "Prints all output without animations"
67
+ class_option :no_landrush, :type => :boolean, :desc => "Disable landrush for DNS"
68
+ class_option :no_port_forward, :type => :boolean, :aliases => "--no-port-forwarding", :desc => "Disable automatic port forwarding"
69
+ class_option :verbose, :type => :boolean, :desc => "Prints out additional logging information"
70
+ class_option :dryrun, :type => :boolean, :aliases => "--dry-run", :desc => "Run a command without actually executing anything"
71
+ class_option :nginx, :type => :boolean, :aliases => "--no-apache", :desc => "Create conf files for nginx instead of apache"
68
72
 
69
73
  desc "--help, -h", "View man page"
70
74
  def help(command = nil)
@@ -73,12 +77,12 @@ module ThemeJuice
73
77
  begin
74
78
  if File.exist? "#{root}/#{man}"
75
79
  if OS.windows?
76
- @io.speak File.read "#{root}/#{man}.txt", :color => :white
80
+ @io.say File.read "#{root}/#{man}.txt", :color => :white
77
81
  else
78
82
  @util.run "man #{root}/#{man}", :verbose => @env.verbose
79
83
  end
80
84
  else
81
- @io.speak "No man page available for '#{command}'", :color => :red
85
+ @io.say "No man page available for '#{command}'", :color => :red
82
86
  end
83
87
  rescue
84
88
  super
@@ -87,7 +91,7 @@ module ThemeJuice
87
91
 
88
92
  desc "--version, -v", "Print current version"
89
93
  def version
90
- @io.speak @version, :color => :green
94
+ @io.say @version, :color => :green
91
95
  end
92
96
 
93
97
  desc "create", "Create new project"
@@ -133,7 +137,7 @@ module ThemeJuice
133
137
  @delete.new(options).unexecute
134
138
  end
135
139
 
136
- desc "deploy", "Manage deployment and migration"
140
+ desc "deploy", "Deploy a project"
137
141
  def deploy
138
142
  @deploy.new(options).execute
139
143
  end
@@ -148,7 +152,7 @@ module ThemeJuice
148
152
  @io.error "Not implemented"
149
153
  end
150
154
 
151
- desc "install", "Run installation for project"
155
+ desc "install", "Run theme installation"
152
156
  def install(*commands)
153
157
  @config.install commands
154
158
  end
@@ -5,8 +5,8 @@ module ThemeJuice
5
5
  class Create < Command
6
6
 
7
7
  THEMES = {
8
- "theme-juice/trellis" => "https://github.com/ezekg/theme-juice-starter.git",
9
- "wordpress/wordpress" => "https://github.com/WordPress/WordPress.git",
8
+ "theme-juice/trellis" => "git@github.com:ezekg/theme-juice-starter.git",
9
+ "wordpress/wordpress" => "git@github.com:WordPress/WordPress.git",
10
10
  "other (specify)" => nil,
11
11
  "none" => false
12
12
  }
@@ -20,15 +20,19 @@ module ThemeJuice
20
20
  tasks << Tasks::CreateConfirm.new
21
21
  tasks << Tasks::Location.new
22
22
  tasks << Tasks::Theme.new
23
- tasks << Tasks::VM.new
23
+ tasks << Tasks::VMBox.new
24
24
  tasks << Tasks::VMPlugins.new
25
25
  tasks << Tasks::VMLocation.new
26
26
  tasks << Tasks::VMCustomfile.new
27
- tasks << Tasks::Hosts.new
28
27
  tasks << Tasks::Database.new
29
- tasks << Tasks::Nginx.new
28
+ if @env.nginx
29
+ tasks << Tasks::Nginx.new
30
+ else
31
+ tasks << Tasks::Apache.new
32
+ end
30
33
  tasks << Tasks::DotEnv.new
31
34
  tasks << Tasks::Landrush.new
35
+ tasks << Tasks::ForwardPorts.new
32
36
  tasks << Tasks::SyncedFolder.new
33
37
  tasks << Tasks::DNS.new
34
38
  tasks << Tasks::WPCLI.new
@@ -51,6 +55,7 @@ module ThemeJuice
51
55
  @project.name = @opts.fetch("name") { name }
52
56
  @project.location = @opts.fetch("location") { location }
53
57
  @project.url = @opts.fetch("url") { url }
58
+ @project.xip = @opts.fetch("xip") { xip }
54
59
  @project.theme = @opts.fetch("theme") { theme }
55
60
  @project.repository = @opts.fetch("repository") { repository }
56
61
  @project.db_host = @opts.fetch("db_host") { db_host }
@@ -64,7 +69,7 @@ module ThemeJuice
64
69
  if @env.yolo
65
70
  name = Faker::Internet.domain_word
66
71
  else
67
- name = @io.prompt "What's the project name? (letters, numbers and dashes only)"
72
+ name = @io.ask "What's the project name? (letters, numbers and dashes only)"
68
73
  end
69
74
 
70
75
  valid_name? name
@@ -94,7 +99,7 @@ module ThemeJuice
94
99
  if @project.use_defaults
95
100
  location = File.expand_path path + @project.name
96
101
  else
97
- location = File.expand_path @io.prompt("Where do you want to setup the project?", :default => path, :path => true)
102
+ location = File.expand_path @io.ask("Where do you want to setup the project?", :default => path, :path => true)
98
103
  end
99
104
 
100
105
  location
@@ -104,7 +109,7 @@ module ThemeJuice
104
109
  if @project.use_defaults
105
110
  url = "#{@project.name}.dev"
106
111
  else
107
- url = @io.prompt "What do you want the development url to be? (this should end in '.dev')", :default => "#{@project.name}.dev"
112
+ url = @io.ask "What do you want the development url to be? (this should end in '.dev')", :default => "#{@project.name}.dev"
108
113
  end
109
114
 
110
115
  valid_url? url
@@ -120,6 +125,12 @@ module ThemeJuice
120
125
  true
121
126
  end
122
127
 
128
+ def xip
129
+ xip = @project.url.gsub /\.dev$/, ""
130
+
131
+ xip
132
+ end
133
+
123
134
  def theme
124
135
  return false if @project.bare
125
136
 
@@ -130,14 +141,16 @@ module ThemeJuice
130
141
 
131
142
  case choice
132
143
  when /(theme-juice)/
133
- @io.success "Awesome choice!"
144
+ @io.say "Awesome choice!", :color => :green, :icon => :success
134
145
  when /(wordpress)/
135
- @io.notice "This is a stock WordPress install, so things such as the '.env' file will not be set up. You'll need to input your database information manually after the setup."
146
+ @io.say "This is a stock WordPress install, so things such as the '.env' file will not be set up. You'll need to input your database information manually after the setup.", {
147
+ :color => :yellow, :icon => :notice }
136
148
  when /(other)/
137
- THEMES[choice] = @io.prompt "What is the repository URL for the starter theme that you would like to clone?"
149
+ THEMES[choice] = @io.ask "What is the repository URL for the starter theme that you would like to clone?"
138
150
  when /(none)/
139
- @io.notice "Next time you need to create a project without a starter theme, you can just run the 'setup' command instead."
140
151
  @project.bare = true
152
+ @io.say "Next time you need to create a project without a starter theme, you can just run the 'setup' command instead.", {
153
+ :color => :yellow, :icon => :notice }
141
154
  end
142
155
 
143
156
  theme = THEMES[choice]
@@ -150,7 +163,7 @@ module ThemeJuice
150
163
  return false if @project.skip_repo || @project.use_defaults
151
164
 
152
165
  if @io.agree? "Would you like to initialize a new Git repository?"
153
- repo = @io.prompt "What is the repository URL?", :indent => 2
166
+ repo = @io.ask "What is the repository URL?", :indent => 2
154
167
  else
155
168
  repo = false
156
169
  end
@@ -172,7 +185,7 @@ module ThemeJuice
172
185
  if @project.skip_db || @project.use_defaults
173
186
  res = default
174
187
  else
175
- res = @io.prompt "Database #{task}", :default => default
188
+ res = @io.ask "Database #{task}", :default => default
176
189
  end
177
190
 
178
191
  res
@@ -183,7 +196,7 @@ module ThemeJuice
183
196
  return false if @project.no_db || @project.no_wp || @project.use_defaults
184
197
 
185
198
  if @io.agree? "Would you like to import an existing database?"
186
- db = @io.prompt "Where is the database file?", {
199
+ db = @io.ask "Where is the database file?", {
187
200
  :indent => 2, :path => true }
188
201
  else
189
202
  db = false