theme-juice 0.23.0 → 0.24.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 +1 -1
- data/lib/theme-juice/cli.rb +4 -0
- data/lib/theme-juice/config.rb +12 -1
- data/lib/theme-juice/env.rb +14 -0
- data/lib/theme-juice/man/tj +8 -0
- data/lib/theme-juice/man/tj.txt +8 -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: 11b5017a31a2b2fe8a83b3747a0a330ba18c60e6
|
4
|
+
data.tar.gz: c015555bd46bf4fcb0613f4cb63fa11ab120ef5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e1e0f73cee850964784f776ecd91482355f10ab88b96077de5cccf82392e3886d98e0b0cec174bbecca4f98ef29b629b4e4e428fcf085a07c361d2453ddd75f
|
7
|
+
data.tar.gz: 845d8e331e723885e716afe67ce724dd6b69db119f795f95157efcfe132f1a48e56adab4691a50d108561518d493f6f1dac4cc9f4a60591b9ce62da14216e0fe
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Travis](https://img.shields.io/travis/ezekg/theme-juice-cli.svg?style=flat-square)](https://travis-ci.org/ezekg/theme-juice-cli)
|
4
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
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
|
-
[![Gitter](https://
|
6
|
+
[![Gitter](https://img.shields.io/gitter/room/ezekg/theme-juice-cli.svg?style=flat-square)](https://gitter.im/ezekg/theme-juice-cli)
|
7
7
|
|
8
8
|
![Theme Juice CLI](demo.gif)
|
9
9
|
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -28,6 +28,8 @@ module ThemeJuice
|
|
28
28
|
@env.vm_ip = options[:vm_ip]
|
29
29
|
@env.vm_prefix = options[:vm_prefix]
|
30
30
|
@env.from_path = options[:from_path]
|
31
|
+
@env.from_srv = options[:from_srv]
|
32
|
+
@env.inside_vm = options[:inside_vm]
|
31
33
|
@env.yolo = options[:yolo]
|
32
34
|
@env.boring = options[:boring]
|
33
35
|
@env.no_unicode = options[:no_unicode]
|
@@ -61,6 +63,8 @@ module ThemeJuice
|
|
61
63
|
class_option :vm_ip, :type => :string, :default => nil, :desc => ""
|
62
64
|
class_option :vm_prefix, :type => :string, :default => nil, :desc => ""
|
63
65
|
class_option :from_path, :type => :string, :aliases => "--in-path", :default => nil, :desc => ""
|
66
|
+
class_option :from_srv, :type => :string, :aliases => "--in-srv", :default => nil, :desc => ""
|
67
|
+
class_option :inside_vm, :type => :boolean, :aliases => "--in-vm", :desc => ""
|
64
68
|
class_option :yolo, :type => :boolean, :aliases => "--yes", :desc => ""
|
65
69
|
class_option :boring, :type => :boolean, :desc => ""
|
66
70
|
class_option :no_unicode, :type => :boolean, :desc => ""
|
data/lib/theme-juice/config.rb
CHANGED
@@ -13,7 +13,8 @@ module ThemeJuice
|
|
13
13
|
|
14
14
|
commands.fetch("#{cmd}") {
|
15
15
|
@io.error "Command '#{cmd}' not found in config", NotImplementedError }
|
16
|
-
.each { |c|
|
16
|
+
.each { |c| cmds = format_command(c, *args)
|
17
|
+
@env.inside_vm ? run_inside_vm(cmds) : run(cmds) }
|
17
18
|
rescue NoMethodError
|
18
19
|
@io.say "Skipping...", :color => :yellow, :icon => :notice
|
19
20
|
end
|
@@ -43,6 +44,15 @@ module ThemeJuice
|
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
47
|
+
def run_inside_vm(command)
|
48
|
+
project_dir = @env.from_srv || @project.vm_srv
|
49
|
+
|
50
|
+
@util.inside @env.vm_path do
|
51
|
+
@util.run "vagrant ssh -c 'cd #{project_dir} && #{command}'", {
|
52
|
+
:verbose => @env.verbose, :capture => @env.quiet }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
46
56
|
def format_command(cmd, args = [])
|
47
57
|
if multi_arg_regex =~ cmd
|
48
58
|
cmd.gsub! multi_arg_regex, args.join(" ")
|
@@ -61,6 +71,7 @@ module ThemeJuice
|
|
61
71
|
|
62
72
|
def read_config
|
63
73
|
@project.location ||= @env.from_path || Dir.pwd
|
74
|
+
@project.name ||= File.basename @project.location
|
64
75
|
|
65
76
|
YAML.load_file Dir["#{@project.location}/*"].select { |f|
|
66
77
|
config_regex =~ File.basename(f) }.last ||
|
data/lib/theme-juice/env.rb
CHANGED
@@ -9,6 +9,8 @@ module ThemeJuice
|
|
9
9
|
attr_accessor :vm_ip
|
10
10
|
attr_accessor :vm_prefix
|
11
11
|
attr_accessor :from_path
|
12
|
+
attr_accessor :from_srv
|
13
|
+
attr_accessor :inside_vm
|
12
14
|
attr_accessor :yolo
|
13
15
|
attr_accessor :boring
|
14
16
|
attr_accessor :no_unicode
|
@@ -43,6 +45,18 @@ module ThemeJuice
|
|
43
45
|
@vm_prefix = val || ENV.fetch("TJ_VM_PREFIX") { "tj-" }
|
44
46
|
end
|
45
47
|
|
48
|
+
def from_path=(val)
|
49
|
+
@from_path = val || ENV.fetch("TJ_FROM_PATH") { nil }
|
50
|
+
end
|
51
|
+
|
52
|
+
def from_srv=(val)
|
53
|
+
@from_srv = val || ENV.fetch("TJ_FROM_SRV") { nil }
|
54
|
+
end
|
55
|
+
|
56
|
+
def inside_vm=(val)
|
57
|
+
@inside_vm = val || ENV.fetch("TJ_INSIDE_VM") { false }
|
58
|
+
end
|
59
|
+
|
46
60
|
def yolo=(val)
|
47
61
|
@yolo = val || ENV.fetch("TJ_YOLO") { false }
|
48
62
|
end
|
data/lib/theme-juice/man/tj
CHANGED
@@ -32,6 +32,14 @@ Force directory prefix for project in VM*
|
|
32
32
|
Run Juicefile(5) commands from the passed path instead of the from current directory\.
|
33
33
|
.
|
34
34
|
.TP
|
35
|
+
\fB\-\-from\-srv\fR, \fB\-\-in\-srv\fR=\fIpath\fR
|
36
|
+
Run Juicefile(5) commands from the passed srv path instead of the from current directory when using the \fB\-\-inside\-vm\fR flag\.
|
37
|
+
.
|
38
|
+
.TP
|
39
|
+
\fB\-\-inside\-vm\fR, \fB\-\-in\-vm\fR
|
40
|
+
Run Juicefile(5) commands from inside of the virtual machine instead of your host machine\.
|
41
|
+
.
|
42
|
+
.TP
|
35
43
|
\fB\-\-yolo\fR, \fB\-\-yes\fR
|
36
44
|
Say yes to anything and everything, and maybe even get a few surprises
|
37
45
|
.
|
data/lib/theme-juice/man/tj.txt
CHANGED
@@ -25,6 +25,14 @@ GLOBAL OPTIONS
|
|
25
25
|
Run Juicefile(5) commands from the passed path instead of the
|
26
26
|
from current directory.
|
27
27
|
|
28
|
+
--from-srv, --in-srv=path
|
29
|
+
Run Juicefile(5) commands from the passed srv path instead of
|
30
|
+
the from current directory when using the --inside-vm flag.
|
31
|
+
|
32
|
+
--inside-vm, --in-vm
|
33
|
+
Run Juicefile(5) commands from inside of the virtual machine
|
34
|
+
instead of your host machine.
|
35
|
+
|
28
36
|
--yolo, --yes
|
29
37
|
Say yes to anything and everything, and maybe even get a few
|
30
38
|
surprises
|
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.
|
4
|
+
version: 0.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|