ssport 0.1.1 → 0.1.3
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.
- checksums.yaml +4 -4
- data/lib/ssport/config.rb +5 -5
- data/lib/ssport/version.rb +1 -1
- data/lib/ssport.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c26669fce788b0d4f7fd0b6eda6af07d75cc60d0c60ae944ae1e08ece0cb52f
|
4
|
+
data.tar.gz: 400a60a1c85379e527b76a07ed066bf60e89c74ddd9754f7125bb0eb396d6894
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e218179276c5036ba9e24def31b87d50ac8b53234c7f1a5fc5cb527041633c80a6ea88ee501540764433bdf977b280e9b375b0c83c8decea5e0814e95eef5d87
|
7
|
+
data.tar.gz: 276b7dbe04b2bdba4b611086bb7223ec6cc55d4890eb23a175cccba70d5460fa1b81f6ebaa47ba16fb11f207a2db44ec270a4d2ade3705530b25ada56fc420fa
|
data/lib/ssport/config.rb
CHANGED
@@ -7,18 +7,18 @@ class Config
|
|
7
7
|
def initialize(options)
|
8
8
|
@options = options
|
9
9
|
@config_file = options[:config]
|
10
|
-
if !@config_file
|
11
|
-
raise "config file not set"
|
12
|
-
end
|
13
10
|
end
|
14
11
|
|
15
12
|
def run
|
13
|
+
if !@config_file
|
14
|
+
raise "config file not set"
|
15
|
+
end
|
16
16
|
parseConfig
|
17
17
|
applyChange
|
18
18
|
end
|
19
19
|
|
20
20
|
def parseConfig
|
21
|
-
if File.exist? config_file
|
21
|
+
if File.exist? @config_file
|
22
22
|
file_content = File.read @config_file
|
23
23
|
@config_json = JSON.parse file_content
|
24
24
|
else
|
@@ -33,7 +33,7 @@ class Config
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def applyChange
|
36
|
+
def applyChange
|
37
37
|
changeField @@SERVER_PORT , :port
|
38
38
|
changeField @@PASSWORD , :password
|
39
39
|
changeField @@METHOD , :method
|
data/lib/ssport/version.rb
CHANGED
data/lib/ssport.rb
CHANGED
@@ -48,9 +48,11 @@ module Ssport
|
|
48
48
|
if options[:server]
|
49
49
|
ssh options
|
50
50
|
end
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
|
52
|
+
if options[:config]
|
53
|
+
config = Config.new(options)
|
54
|
+
config.run
|
55
|
+
end
|
54
56
|
|
55
57
|
end
|
56
58
|
|
@@ -61,8 +63,8 @@ module Ssport
|
|
61
63
|
script = %Q{
|
62
64
|
if ! [ -x "$(command -v ssport)" ]; then
|
63
65
|
gem install ssport
|
64
|
-
|
65
|
-
ssport -b #{options[:port]}
|
66
|
+
fi
|
67
|
+
ssport -b #{options[:port]} -c #{options[:config]}
|
66
68
|
}
|
67
69
|
output = ssh.exec!(script)
|
68
70
|
puts output
|