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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c5e6c37204227134e265ab48c21310472669c87926acae5fb93a0491dbb21d9
4
- data.tar.gz: 1fa5fb76476d3ace4d553ccf95e527287bb50bd07c702aee797ecdc8e72ee911
3
+ metadata.gz: 8fdf5b7f14e5e5682ef44f437055e9507433191e96905f90317c7e29b3e2a803
4
+ data.tar.gz: 8e6768fecab47ee6e73c39968df7eb9c5d03e5833e7ccc2b5744e2c629f7237b
5
5
  SHA512:
6
- metadata.gz: acbdc0077733ad0d05d28ef2cbfe0337e6a17aca46c8c134414912127208332282531847c0b5e254ce43e2d715416f15f6733aadc32ff0e14f264a82e9cc878f
7
- data.tar.gz: f56253d62a442943dd28db7c151afa99856b86fa1eaf293e11fffa6e62881ebd7561233f0aaa92351e40b5a79ea13321c8d73e7c3de8aaa306a50d6ccf0ef226
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.to_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
@@ -1,3 +1,3 @@
1
1
  module Ssport
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/ssport.rb CHANGED
@@ -46,9 +46,7 @@ module Ssport
46
46
 
47
47
  if options[:server]
48
48
  ssh options
49
- end
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaich