ssport 0.1.6 → 0.1.7
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 +7 -2
- data/lib/ssport/version.rb +1 -1
- data/lib/ssport.rb +0 -1
- 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: 2c5e6c37204227134e265ab48c21310472669c87926acae5fb93a0491dbb21d9
|
4
|
+
data.tar.gz: 1fa5fb76476d3ace4d553ccf95e527287bb50bd07c702aee797ecdc8e72ee911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acbdc0077733ad0d05d28ef2cbfe0337e6a17aca46c8c134414912127208332282531847c0b5e254ce43e2d715416f15f6733aadc32ff0e14f264a82e9cc878f
|
7
|
+
data.tar.gz: f56253d62a442943dd28db7c151afa99856b86fa1eaf293e11fffa6e62881ebd7561233f0aaa92351e40b5a79ea13321c8d73e7c3de8aaa306a50d6ccf0ef226
|
data/lib/ssport/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "colorize"
|
2
|
+
require "json"
|
2
3
|
|
3
4
|
class Config
|
4
5
|
|
@@ -23,6 +24,8 @@ class Config
|
|
23
24
|
p "---------bengin parse #{@config_file} ------------"
|
24
25
|
if File.exist? @config_file
|
25
26
|
file_content = File.read @config_file
|
27
|
+
p "-------------old config---------------"
|
28
|
+
p file_content
|
26
29
|
@config_json = JSON.parse file_content
|
27
30
|
else
|
28
31
|
p "Config 文件不存在".colorize(:red)
|
@@ -31,7 +34,6 @@ class Config
|
|
31
34
|
|
32
35
|
def changeField(config_key, option_key)
|
33
36
|
option_value = @options[option_key]
|
34
|
-
p "---------bengin change #{config_key} : #{option_value} ------------"
|
35
37
|
if option_value
|
36
38
|
@config_json[config_key] = option_value
|
37
39
|
end
|
@@ -41,7 +43,10 @@ class Config
|
|
41
43
|
changeField @@SERVER_PORT , :port
|
42
44
|
changeField @@PASSWORD , :password
|
43
45
|
changeField @@METHOD , :method
|
44
|
-
|
46
|
+
final_config = @config_json.to_json
|
47
|
+
p "-------------new config---------------"
|
48
|
+
p final_config
|
49
|
+
File.write @config_file , final_config
|
45
50
|
end
|
46
51
|
|
47
52
|
|
data/lib/ssport/version.rb
CHANGED
data/lib/ssport.rb
CHANGED