Skip to content
This repository

Add Zeus support, smartly decide to use bundler or zeus #35

Merged
merged 2 commits into from about 1 year ago

3 participants

Wael M. Nasreddine Jonathan Roes Mike Skalnik
Wael M. Nasreddine

Hi guys,

This pull request is very similar to #28, I've been using it since last week and I haven't experienced any problems with it.

The main difference between this and #28, is that we detect if zeus is running by the presence of .zeus.sock in the project folder.

There's one new setting g:vroom_use_zeus, if it's equal to 0, Zeus will not be used at all regardless of the presence of .zeus.sock

Jonathan Roes
jroes commented March 21, 2013

:thumbsup: works for me.

Mike Skalnik
Owner

I think this looks good. I know @charlietanksley & I kinda feel like we should be holding back on adding more options, but if we're overhauling the options parser in 2.0 then I think we can go forward with merging stuff like this.

@charlietanksley Thoughts?

Jonathan Roes
jroes commented March 22, 2013

Also, Spring got worked in. It's only fair! :)

Wael M. Nasreddine

@skalnik can you merge it if it looks good for you? I have demand for it in Janus.

Mike Skalnik skalnik merged commit de676a4 into from April 09, 2013
Mike Skalnik skalnik closed this April 09, 2013
Wael M. Nasreddine eMxyzptlk deleted the branch April 09, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
37  autoload/vroom.vim
@@ -64,6 +64,10 @@ if !exists("g:vroom_rspec_version")
64 64
   let g:vroom_rspec_version = '2.x'
65 65
 endif
66 66
 
  67
+if !exists("g:vroom_use_zeus")
  68
+  let g:vroom_use_zeus = 1
  69
+endif
  70
+
67 71
 " }}}
68 72
 " Main functions {{{
69 73
 
@@ -170,7 +174,11 @@ function s:PrepareToRunTests(filename)
170 174
   endif
171 175
   call s:WriteOrWriteAll()
172 176
   call s:SetTestRunnerPrefix(a:filename)
173  
-  call s:SetColorFlag()
  177
+  if s:usingZeus()
  178
+    let s:color_flag = ""
  179
+  else
  180
+    call s:SetColorFlag()
  181
+  endif
174 182
 endfunction
175 183
 
176 184
 " Internal: Runs a command though vim or vmux
@@ -220,11 +228,38 @@ endfunction
220 228
 " Internal: Set s:test_runner_prefix variable
221 229
 function s:SetTestRunnerPrefix(filename)
222 230
   let s:test_runner_prefix = ''
  231
+  call s:IsUsingZeus()
223 232
   call s:IsUsingBundleExec(a:filename)
224 233
   call s:IsUsingBinstubs()
225 234
   call s:IsUsingSpring()
226 235
 endfunction
227 236
 
  237
+" Internal: Check for .zeus.sock and use zeus instead of bundler
  238
+function s:IsUsingZeus()
  239
+  if s:usingZeus()
  240
+    if !exists("s:vroom_use_bundle_exec_original")
  241
+      let s:vroom_use_bundle_exec_original = g:vroom_use_bundle_exec
  242
+    endif
  243
+    let g:vroom_use_bundle_exec = 0
  244
+
  245
+    let s:test_runner_prefix = "zeus "
  246
+  else
  247
+    if exists("s:vroom_use_bundle_exec_original")
  248
+      let g:vroom_use_bundle_exec = s:vroom_use_bundle_exec_original
  249
+    endif
  250
+  endif
  251
+endfunction
  252
+
  253
+" Internal: Using Zeus ?
  254
+function s:usingZeus()
  255
+  if g:vroom_use_zeus && glob(".zeus.sock") != ""
  256
+    return 1
  257
+  else
  258
+    return 0
  259
+  endif
  260
+endfunction
  261
+
  262
+
228 263
 " Internal: Check for a Gemfile if we are using `bundle exec`
229 264
 function s:IsUsingBundleExec(filename)
230 265
   if g:vroom_use_bundle_exec
8  doc/vroom.txt
@@ -39,7 +39,7 @@ COMMANDS                                                       *vroom-commands*
39 39
 :VroomRunNearestTest                                      *VroomRunNearestTest*
40 40
                         Runs the nearest test in the current file if it's a
41 41
                         test. Otherwise, runs the last test that was run.
42  
-                        
  42
+
43 43
                         NOTICE:
44 44
                         Both of these commands can take pass a dictionary of
45 45
                         arguments to this function.  The two recognized keys
@@ -133,6 +133,12 @@ g:vroom_rspec_version                                     *vroom_rspec_version*
133 133
                         (e.g. color). Use "1.x" or "2.x".
134 134
                         Default: '2.x'
135 135
 
  136
+g:vroom_use_zeus                                      *vroom_use_zeus*
  137
+                        This lets you specify to use zeus instead of bundler,
  138
+                        if zeus is not running, it will fallback to using
  139
+                        bundler.
  140
+                        Default: 1
  141
+
136 142
 ===============================================================================
137 143
 LICENSE                                                         *vroom-license*
138 144
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.