sesh 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/exe/return_to_sesh +0 -0
- data/lib/sesh/tmux_control.rb +24 -7
- data/lib/sesh/version.rb +1 -1
- data/sesh.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 606d7765a67aab4f949da18b6892991d91c64340
|
4
|
+
data.tar.gz: 6a3bdfce44d732a03276dbc76026795dc5611465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9b2a52b1404207b5888ec94183bc35161a630136590a99eb061b58b01c6012756e15a3279fd752dac83daab2f72d8d696e5e7dfe94ffa0c6e2504580a77b1bc
|
7
|
+
data.tar.gz: 81fe0e9c936be0d1195d20a0c592f409e5d125d0a16f68d7116531d935644310514f3c17ae24940b707130f714ca9b01b5e5cdab39ea756ea2a495c1420c979c
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sesh (0.4.
|
4
|
+
sesh (0.4.2)
|
5
5
|
awesome_print (~> 1.6)
|
6
6
|
colorize (~> 0.7.7)
|
7
7
|
deep_merge (~> 1.0)
|
8
|
+
open4 (~> 1.3.4)
|
8
9
|
tmuxinator (~> 0.6.9)
|
9
10
|
|
10
11
|
GEM
|
@@ -15,6 +16,7 @@ GEM
|
|
15
16
|
deep_merge (1.0.1)
|
16
17
|
diff-lcs (1.2.5)
|
17
18
|
erubis (2.7.0)
|
19
|
+
open4 (1.3.4)
|
18
20
|
rake (10.4.2)
|
19
21
|
rspec (3.3.0)
|
20
22
|
rspec-core (~> 3.3.0)
|
data/exe/return_to_sesh
CHANGED
File without changes
|
data/lib/sesh/tmux_control.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'sesh'
|
2
|
+
require 'open4'
|
2
3
|
# require 'tmuxinator'
|
3
4
|
# require 'yaml'
|
4
5
|
|
@@ -190,17 +191,33 @@ module Sesh
|
|
190
191
|
# puts "Inferred location: #{inferred_location}"
|
191
192
|
if options[:pane].nil?
|
192
193
|
# puts inferred_location.inspect
|
193
|
-
if inferred_location[:project]
|
194
|
-
|
194
|
+
if inferred_location[:project] != @project
|
195
|
+
interrupt_and_send_command_to_project! options[:command]
|
196
|
+
return 0
|
197
|
+
else do_shell_operation_here! options[:command] end
|
195
198
|
else
|
196
|
-
if inferred_location
|
197
|
-
system options[:command]
|
198
|
-
return $?.exitstatus
|
199
|
-
else
|
199
|
+
if inferred_location != { project: @project, pane: options[:pane] }
|
200
200
|
interrupt_and_send_command_to_pane! options[:pane], options[:command]
|
201
201
|
return 0
|
202
|
-
end
|
202
|
+
else do_shell_operation_here! options[:command] end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
def do_shell_operation_here!(cmd)
|
206
|
+
# system cmd
|
207
|
+
# STDOUT.sync = true
|
208
|
+
# stdin, stdout, stderr, wait_thr = Open3.popen3(*cmd.split(' '))
|
209
|
+
# stdin.close
|
210
|
+
# stdout.close
|
211
|
+
output = ''
|
212
|
+
status = Open4::popen4(cmd) do |pid, stdin, stdout, stderr|
|
213
|
+
stdin.close
|
214
|
+
puts o = stdout.read.strip; output << o
|
215
|
+
puts o = stderr.read.strip; output << o
|
203
216
|
end
|
217
|
+
puts "Full output: #{output}"
|
218
|
+
puts "Status: #{status.inspect}"
|
219
|
+
status.exitstatus
|
220
|
+
# $?.exitstatus
|
204
221
|
end
|
205
222
|
|
206
223
|
# Getter methods for passthru to SshControl class
|
data/lib/sesh/version.rb
CHANGED
data/sesh.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sesh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MacKinley Smith
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.7.7
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: open4
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.3.4
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.3.4
|
111
125
|
description: Remote background sessions powered by tmux and tmuxinator.
|
112
126
|
email: smithmackinley@gmail.com
|
113
127
|
executables:
|