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 CHANGED
@@ -1,4 +1,4 @@
1
- = Remote Terminal v0.1.1
1
+ = Remote Terminal v0.1.2
2
2
 
3
3
  Remote Terminal uses SSH and RSync to help you to execute commands remotely as if you were running them locally.
4
4
 
data/TODO CHANGED
@@ -1,3 +1 @@
1
1
  TODO
2
-
3
- quando eu removo um arquivo, ele devia ser removido!
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.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
- cmd = ARGV.join(' ')
9
- local_dir = Dir.pwd
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
- begin
12
- puts RemoteTerminal::CLI.execute(cmd, RemoteTerminal::Rsync.new, RemoteTerminal::SSH.new, local_dir)
13
- rescue Exception => e
14
- puts e
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
- addr = ARGV[0]
9
- user = ARGV[1]
10
- remote_dir = ARGV[2]
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
- begin
14
- RemoteTerminal::CLI.config(addr, user, remote_dir, local_dir)
15
- puts "done!"
16
- rescue Exception => e
17
- puts e
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
@@ -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
- return "#{f.readlines.join()}"
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "remote-terminal"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Igor Bonadio"]
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.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: -921137321131667278
171
+ hash: -1464245227914965361
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  none: false
174
174
  requirements: