jorp 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/jorp.gemspec +1 -1
- data/lib/jorp.rb +9 -13
- metadata +2 -2
data/jorp.gemspec
CHANGED
data/lib/jorp.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'bundler/setup'
|
4
|
+
# Bundler.setup
|
5
|
+
|
4
6
|
require 'optparse'
|
5
7
|
require 'jorp/sudo_adaptor'
|
6
8
|
require 'jorp/basic_adaptor'
|
7
9
|
require 'jorp/remote_adaptor'
|
8
10
|
|
11
|
+
|
12
|
+
|
9
13
|
module Jorp
|
10
14
|
|
11
15
|
DEFAULT_OPTIONS = {
|
@@ -43,20 +47,12 @@ module Jorp
|
|
43
47
|
@options[:path] = args[0]
|
44
48
|
end
|
45
49
|
|
46
|
-
def run
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
else
|
51
|
-
@adaptor = BasicAdaptor.new(@options[:path])
|
52
|
-
end
|
50
|
+
def run
|
51
|
+
puts "Using remote host: \"#{@options[:hostname]}\""
|
52
|
+
if @options[:sudo]
|
53
|
+
@adaptor = RemoteAdaptor.new(@options[:hostname], @options[:path], @options[:username])
|
53
54
|
else
|
54
|
-
|
55
|
-
if @options[:sudo]
|
56
|
-
@adaptor = RemoteAdaptor.new(@options[:hostname], @options[:path], @options[:username])
|
57
|
-
else
|
58
|
-
@adaptor = RemoteAdaptor.new(@options[:hostname], @options[:path], @options[:username])
|
59
|
-
end
|
55
|
+
@adaptor = RemoteAdaptor.new(@options[:hostname], @options[:path], @options[:username])
|
60
56
|
end
|
61
57
|
@adaptor.connect
|
62
58
|
system("#{@options[:editor]} \"#{@adaptor.proxy_path}\"")
|