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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d852238a2f118a976b83215d898bcbfd8f9441a
4
- data.tar.gz: 1ed2f637f2203880711385de5cc6e1280a9b04ae
3
+ metadata.gz: 11b5017a31a2b2fe8a83b3747a0a330ba18c60e6
4
+ data.tar.gz: c015555bd46bf4fcb0613f4cb63fa11ab120ef5a
5
5
  SHA512:
6
- metadata.gz: d20a11190ed54f8d814071a33825c2dc01672052082756669c3bcc5e17cb14c630c6ffabccfe4a5e71cb985dc4c6320d051aa4e542caa57ce2a5ba98e5b9fdc2
7
- data.tar.gz: 00151b454e3eefef988b32a7956b4764ed88c777940ae567c1e7f8f836ab9e9ecf220eae8f15ffc795a83a68a8d2e41e7851bd1d0521d1a8786c285a2133a499
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://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ezekg/theme-juice-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
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
 
@@ -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 => ""
@@ -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| run format_command(c, *args) }
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 ||
@@ -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
@@ -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
  .
@@ -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
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.23.0"
4
+ VERSION = "0.24.0"
5
5
  end
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.23.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-08 00:00:00.000000000 Z
11
+ date: 2016-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor