ssport 0.1.7 → 0.1.8
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 +3 -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: 8fdf5b7f14e5e5682ef44f437055e9507433191e96905f90317c7e29b3e2a803
|
4
|
+
data.tar.gz: 8e6768fecab47ee6e73c39968df7eb9c5d03e5833e7ccc2b5744e2c629f7237b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c25866808b1c3a3804169fc91cc11ee26d1d0aa6cc0907b4fadeee5da37e74c582f8e8dc86404bf8b3c7d8f75242088bb38fd7a4a6bbd83c3eeed3da35ceb2e
|
7
|
+
data.tar.gz: 982ce12f208bc8712aaf3177615fca6007de945a4ac708fff74203eb3e50a3ca87bbeb4e885126840b5f3e53062d6dae0b15e9eabd849a5c8df2408a4c0b85fc
|
data/lib/ssport/config.rb
CHANGED
@@ -21,12 +21,12 @@ class Config
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def parseConfig
|
24
|
-
p "---------bengin parse #{@config_file} ------------"
|
24
|
+
p "---------bengin parse #{@config_file} ------------".colorize(:yellow)
|
25
25
|
if File.exist? @config_file
|
26
26
|
file_content = File.read @config_file
|
27
|
-
p "-------------old config---------------"
|
28
|
-
p file_content
|
29
27
|
@config_json = JSON.parse file_content
|
28
|
+
p "-------------old config---------------".colorize(:yellow)
|
29
|
+
p JSON.pretty_generate(@config_json)
|
30
30
|
else
|
31
31
|
p "Config 文件不存在".colorize(:red)
|
32
32
|
end
|
@@ -43,8 +43,8 @@ class Config
|
|
43
43
|
changeField @@SERVER_PORT , :port
|
44
44
|
changeField @@PASSWORD , :password
|
45
45
|
changeField @@METHOD , :method
|
46
|
-
final_config = @config_json
|
47
|
-
p "-------------new config---------------"
|
46
|
+
final_config = JSON.pretty_generate(@config_json)
|
47
|
+
p "-------------new config---------------".colorize(:yellow)
|
48
48
|
p final_config
|
49
49
|
File.write @config_file , final_config
|
50
50
|
end
|
data/lib/ssport/version.rb
CHANGED
data/lib/ssport.rb
CHANGED
@@ -46,9 +46,7 @@ module Ssport
|
|
46
46
|
|
47
47
|
if options[:server]
|
48
48
|
ssh options
|
49
|
-
|
50
|
-
|
51
|
-
if options[:config]
|
49
|
+
elsif options[:config]
|
52
50
|
config = Config.new(options)
|
53
51
|
config.run
|
54
52
|
end
|
@@ -70,9 +68,9 @@ module Ssport
|
|
70
68
|
output = ssh.exec!(script)
|
71
69
|
end
|
72
70
|
|
73
|
-
p '----------------Remote---------------'
|
71
|
+
p '----------------Remote---------------'.colorize(:yellow)
|
74
72
|
puts output
|
75
|
-
p '-------------------------------------'
|
73
|
+
p '-------------------------------------'.colorize(:yellow)
|
76
74
|
|
77
75
|
end
|
78
76
|
|