theme-juice 0.18.5 → 0.18.6
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 -3
- data/lib/theme-juice/cli.rb +14 -1
- data/lib/theme-juice/config.rb +15 -0
- data/lib/theme-juice/env.rb +6 -1
- data/lib/theme-juice/io.rb +1 -0
- data/lib/theme-juice/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20fb1072fb87d92ca6088731303386be71ea34d0
|
4
|
+
data.tar.gz: 9812efb989d67e994a6456b0fb5772ba9de64759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bacbb56a11d89ed8ad32e5c95e7db828074e481ea37fa36fdad726d303d639fca3b1c46902d8cd842da0e91c25c53efd2cd5c3d43ef612cc854d122daf6e4ec5
|
7
|
+
data.tar.gz: 63118bfbfd098eae7ae8beb143904c17bebb940df0953f1004f1bfbffea8a605c61b03df74a4bd2efc44c0cb5c6bd28dab8f670f0a1a9c58dc1e8f78d11409c5
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ Want to pull the database from your production server to your development instal
|
|
31
31
|
How about pushing your development database and your local uploads folder? Run `tj remote production db:push && tj remote production uploads:push` and you're done. [You can even send notifications to your teams Slack channel if you want to!](https://github.com/ezekg/theme-juice-cli#can-i-integrate-my-deployments-with-slack)
|
32
32
|
|
33
33
|
## Requirements
|
34
|
-
**`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.** If you plan on using `tj` for deployments, you should also ensure that your `remote` servers have [WP-CLI](http://wp-cli.org/
|
34
|
+
**`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.** If you plan on using `tj` for deployments, you should also ensure that your `remote` servers have [WP-CLI](http://wp-cli.org/) installed in order for `tj` to be able to handle database migration.
|
35
35
|
|
36
36
|
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.
|
37
37
|
|
@@ -120,7 +120,7 @@ Or, you can also check out [themejuice.it](http://themejuice.it) for a pretty we
|
|
120
120
|
1. [Troubleshooting](#troubleshooting)
|
121
121
|
|
122
122
|
### Is Windows supported?
|
123
|
-
Yes! But, since Windows doesn't support UTF-8 characters inside of the terminal, and is picky about
|
123
|
+
Yes! But, since Windows doesn't support UTF-8 characters inside of the terminal, and is picky about ANSI color codes, you'll probably have to run `tj` with a couple flags.
|
124
124
|
|
125
125
|
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.
|
126
126
|
|
@@ -279,7 +279,7 @@ Check out [capistrano-slackify](https://github.com/onthebeach/capistrano-slackif
|
|
279
279
|
1. [Why are my `.dev` domains resolving to `127.0.53.53`?!](#why-are-my-dev-domains-resolving-to-12705353)
|
280
280
|
|
281
281
|
### Help! It won't let me `git clone` anything!
|
282
|
-
If you're hitting issues related to `git clone`, either cloning the VM or a starter template, then you most likely don't have [SSH-keys for GitHub set up correctly](https://help.github.com/articles/error-permission-denied-publickey/). Either go through that article and assure that you can use Git with the `git
|
282
|
+
If you're hitting issues related to `git clone`, either cloning the VM or a starter template, then you most likely don't have [SSH-keys for GitHub set up correctly](https://help.github.com/articles/error-permission-denied-publickey/). Either go through that article and assure that you can use Git with the `git@` (`ssh://git@`) protocol, or else you can manually run `tj` with the appropriate flags corresponding to the problem-repository, swapping out `git@github.com:` for `https://github.com/`. For example:
|
283
283
|
|
284
284
|
```
|
285
285
|
tj create --template https://github.com/starter-template/repository.git --vm-box https://github.com/vm-box/repository.git
|
@@ -287,6 +287,12 @@ tj create --template https://github.com/starter-template/repository.git --vm-box
|
|
287
287
|
|
288
288
|
The flag duo above replaces the URLs for the starter template and VM box repositories so that they use `https` instead of the `git` protocol.
|
289
289
|
|
290
|
+
Or, you can globally update `git` to **always** swap out `git@github.com:` with `https://github.com/` by modifying your `git config` with this command:
|
291
|
+
|
292
|
+
```
|
293
|
+
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
294
|
+
```
|
295
|
+
|
290
296
|
### What the heck is an `invalid multibyte char (US-ASCII)`?!
|
291
297
|
For one reason or another, your terminal probably doesn't support UTF-8, so it's throwing a fit. Use the `--no-unicode` flag to disable the unicode characters. If the problem still persists, try running it with the `--boring` flag. That should disable all unicode characters and coloring.
|
292
298
|
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -36,6 +36,7 @@ module ThemeJuice
|
|
36
36
|
@env.no_port_forward = options[:no_port_forward]
|
37
37
|
@env.verbose = options[:verbose]
|
38
38
|
@env.quiet = options[:quiet]
|
39
|
+
@env.robot = options[:robot]
|
39
40
|
@env.trace = options[:trace]
|
40
41
|
@env.dryrun = options[:dryrun]
|
41
42
|
@env.nginx = options[:nginx]
|
@@ -64,6 +65,7 @@ module ThemeJuice
|
|
64
65
|
class_option :no_port_forward, :type => :boolean, :aliases => "--no-port-forwarding", :desc => ""
|
65
66
|
class_option :verbose, :type => :boolean, :desc => ""
|
66
67
|
class_option :quiet, :type => :boolean, :aliases => "--shh", :desc => ""
|
68
|
+
class_option :robot, :type => :boolean, :desc => ""
|
67
69
|
class_option :trace, :type => :boolean, :desc => ""
|
68
70
|
class_option :dryrun, :type => :boolean, :aliases => "--dry-run", :desc => ""
|
69
71
|
class_option :nginx, :type => :boolean, :aliases => "--no-apache", :desc => ""
|
@@ -169,10 +171,21 @@ module ThemeJuice
|
|
169
171
|
|
170
172
|
# For dynamic methods defined within the config
|
171
173
|
def method_missing(method, *args, &block)
|
174
|
+
|
175
|
+
# Force Thor to parse options
|
176
|
+
parser = Thor::Options.new self.class.class_options
|
177
|
+
@options = parser.parse args
|
178
|
+
|
179
|
+
# Init env (again) with parsed options
|
180
|
+
init_env
|
181
|
+
|
182
|
+
err = -> { @io.error "Could not find command '#{method}'" }
|
183
|
+
err.call unless @config.exist?
|
184
|
+
|
172
185
|
if @config.commands.has_key? "#{method}"
|
173
186
|
@config.command method.to_sym, args
|
174
187
|
else
|
175
|
-
|
188
|
+
err.call
|
176
189
|
end
|
177
190
|
end
|
178
191
|
end
|
data/lib/theme-juice/config.rb
CHANGED
@@ -28,6 +28,10 @@ module ThemeJuice
|
|
28
28
|
@io.error("Deployment settings not found in config", NotImplementedError)
|
29
29
|
end
|
30
30
|
|
31
|
+
def exist?
|
32
|
+
!capture { config }.nil?
|
33
|
+
end
|
34
|
+
|
31
35
|
private
|
32
36
|
|
33
37
|
def run(command)
|
@@ -79,6 +83,17 @@ module ThemeJuice
|
|
79
83
|
%r{(%arg#{i}%)|(%argument#{i}%)}
|
80
84
|
end
|
81
85
|
|
86
|
+
def capture
|
87
|
+
begin
|
88
|
+
old = $stdout
|
89
|
+
$stdout = StringIO.new
|
90
|
+
yield
|
91
|
+
# $stdout.string
|
92
|
+
ensure
|
93
|
+
$stdout = old
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
82
97
|
extend self
|
83
98
|
end
|
84
99
|
end
|
data/lib/theme-juice/env.rb
CHANGED
@@ -17,6 +17,7 @@ module ThemeJuice
|
|
17
17
|
attr_accessor :no_port_forward
|
18
18
|
attr_accessor :verbose
|
19
19
|
attr_accessor :quiet
|
20
|
+
attr_accessor :robot
|
20
21
|
attr_accessor :trace
|
21
22
|
attr_accessor :dryrun
|
22
23
|
attr_accessor :nginx
|
@@ -44,8 +45,12 @@ module ThemeJuice
|
|
44
45
|
@yolo = val || ENV.fetch("TJ_YOLO") { false }
|
45
46
|
end
|
46
47
|
|
48
|
+
def robot=(val)
|
49
|
+
@robot = val || ENV.fetch("TJ_ROBOT") { false }
|
50
|
+
end
|
51
|
+
|
47
52
|
def boring=(val)
|
48
|
-
@boring = val || ENV.fetch("TJ_BORING") { false }
|
53
|
+
@boring = val || ENV.fetch("TJ_BORING") { robot || false }
|
49
54
|
end
|
50
55
|
|
51
56
|
def no_unicode=(val)
|
data/lib/theme-juice/io.rb
CHANGED
data/lib/theme-juice/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme-juice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|