workon 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/workon/actor/base.rb +7 -3
- data/lib/workon/actor/passenger.rb +1 -1
- data/lib/workon/version.rb +1 -1
- metadata +2 -2
data/lib/workon/actor/base.rb
CHANGED
@@ -60,6 +60,10 @@ module Workon
|
|
60
60
|
Kernel.system command
|
61
61
|
end
|
62
62
|
|
63
|
+
def has_command?(command)
|
64
|
+
!`command -v #{command}`.empty?
|
65
|
+
end
|
66
|
+
|
63
67
|
def run(command)
|
64
68
|
puts "Running #{command}"
|
65
69
|
output = %x(#{command}) unless options[:dry_run]
|
@@ -67,9 +71,9 @@ module Workon
|
|
67
71
|
end
|
68
72
|
|
69
73
|
def screen(command)
|
70
|
-
|
74
|
+
$has_tmux ||= has_command? 'tmux'
|
71
75
|
|
72
|
-
|
76
|
+
$has_tmux ? _tmux(command) : _screen(command)
|
73
77
|
end
|
74
78
|
|
75
79
|
def _screen(command, scope = nil)
|
@@ -86,7 +90,7 @@ module Workon
|
|
86
90
|
end
|
87
91
|
|
88
92
|
def initialize_tmux
|
89
|
-
|
93
|
+
$tmux_initialized ||= begin
|
90
94
|
run "tmux new-session -s #{tmux_session} \\; set-option -t #{tmux_session} set-remain-on-exit on \\; detach-client"
|
91
95
|
true
|
92
96
|
end
|
data/lib/workon/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: workon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.11
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Wyatt
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-05 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: Runs actions based on directories
|