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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a0610c5790b1f33b38c635c882fb3cd441fee0a6c73fe08a57737cc4f762255
4
- data.tar.gz: ef32f21283eecf84c9333fd9dcd56b00fbad677ac3dceb83a0f8dce00056768b
3
+ metadata.gz: 4c26669fce788b0d4f7fd0b6eda6af07d75cc60d0c60ae944ae1e08ece0cb52f
4
+ data.tar.gz: 400a60a1c85379e527b76a07ed066bf60e89c74ddd9754f7125bb0eb396d6894
5
5
  SHA512:
6
- metadata.gz: a2a1515d7d692dd0d0e36241535f0f9ae8177f7c8e1373b11a80a0d48aed28a2f764f7006582ee558925711eea4e79e5e488835e7eee0df484e092d46e92b419
7
- data.tar.gz: a1811c5175787c1276e405501c9d05be13c7f5ab7c8553bfb4b0a4153305d24b5335b5e26ad8892c5e32dec96988b01ba03e2c8af796268ceae14cec591476fc
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(config_json)
36
+ def applyChange
37
37
  changeField @@SERVER_PORT , :port
38
38
  changeField @@PASSWORD , :password
39
39
  changeField @@METHOD , :method
@@ -1,3 +1,3 @@
1
1
  module Ssport
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
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
- config = Config(options)
53
- config.run
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
- if
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
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.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaich