remote-terminal 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/TODO +0 -2
- data/VERSION +1 -1
- data/bin/rt +22 -6
- data/bin/rt-config +17 -9
- data/lib/remote-terminal/ssh.rb +6 -1
- data/remote-terminal.gemspec +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
data/TODO
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/bin/rt
CHANGED
@@ -5,11 +5,27 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
5
5
|
require 'remote-terminal'
|
6
6
|
require 'etc'
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
def help
|
9
|
+
puts "usage: rt command
|
10
|
+
|
11
|
+
Example:
|
12
|
+
|
13
|
+
rt ./configure
|
14
|
+
rt make
|
15
|
+
rt make install
|
16
|
+
"
|
17
|
+
end
|
10
18
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
19
|
+
if ARGV.size > 0
|
20
|
+
|
21
|
+
cmd = ARGV.join(' ')
|
22
|
+
local_dir = Dir.pwd
|
23
|
+
|
24
|
+
begin
|
25
|
+
puts RemoteTerminal::CLI.execute(cmd, RemoteTerminal::Rsync.new, RemoteTerminal::SSH.new, local_dir)
|
26
|
+
rescue Exception => e
|
27
|
+
puts e
|
28
|
+
end
|
29
|
+
else
|
30
|
+
help
|
15
31
|
end
|
data/bin/rt-config
CHANGED
@@ -5,14 +5,22 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
5
5
|
require 'remote-terminal'
|
6
6
|
require 'etc'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
local_dir = Dir.pwd
|
8
|
+
def help
|
9
|
+
puts "usage: rt-config remote_machine_address username Projects/my_remote_folder"
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
if ARGV.size == 3
|
13
|
+
addr = ARGV[0]
|
14
|
+
user = ARGV[1]
|
15
|
+
remote_dir = ARGV[2]
|
16
|
+
local_dir = Dir.pwd
|
17
|
+
|
18
|
+
begin
|
19
|
+
RemoteTerminal::CLI.config(addr, user, remote_dir, local_dir)
|
20
|
+
puts "done!"
|
21
|
+
rescue Exception => e
|
22
|
+
puts e
|
23
|
+
end
|
24
|
+
else
|
25
|
+
help
|
18
26
|
end
|
data/lib/remote-terminal/ssh.rb
CHANGED
@@ -2,8 +2,13 @@ module RemoteTerminal
|
|
2
2
|
class SSH
|
3
3
|
def run(server, remote_directory, cmd)
|
4
4
|
IO.popen("ssh #{server} 'cd #{remote_directory} && #{cmd}'") do |f|
|
5
|
-
|
5
|
+
output = f.gets
|
6
|
+
while output
|
7
|
+
puts output
|
8
|
+
output = f.gets
|
9
|
+
end
|
6
10
|
end
|
11
|
+
return ""
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
data/remote-terminal.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote-terminal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -168,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
segments:
|
170
170
|
- 0
|
171
|
-
hash: -
|
171
|
+
hash: -1464245227914965361
|
172
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
173
|
none: false
|
174
174
|
requirements:
|