netsoul 1.7.0 → 1.8.0

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
  SHA1:
3
- metadata.gz: b43af38649f019edff2b067bc66257487e243e2f
4
- data.tar.gz: b0633c0e8827bce922e290cc79fc401dd9c081fb
3
+ metadata.gz: 2d274d3247bb4ca9fe3bcd6470ce972df31a202b
4
+ data.tar.gz: 910ed29d27347a72a60810e4ad0ee3f8357baaa3
5
5
  SHA512:
6
- metadata.gz: 8e1bff48bdd2697033abc87d4cde2a0f5748c362fe36a0dc35b27aef055f0ca29a2da13707c85a2c234db10a125a2fc3c8cc8cb023b8b31ddf081f7670b0e702
7
- data.tar.gz: 50973addb57c1e059eaee7617a52f13cbf454d72506d3052dea556df1ffcb8a9032c599726ba9712bd5d64fbc55eabbf1e02482fee79a3f5400d8415cae6f3af
6
+ metadata.gz: 4a84e494c128cbcb213f044ea1bef5210565987995ee4b19b930532a8ebd49229704cae6c89a867bfc24242d1add7e2a81a99b5072e54166bfdaa06609204d87
7
+ data.tar.gz: a8ce1612fe46fd0fd986436c31d6299f83098a75f5ba8f9478121e586f8a844548c49310a620bf3c4297220a37ec2584f5e5d2ba3b1887ce88ab7d63ae9f91ed
data/bin/netsoul-ruby CHANGED
@@ -13,12 +13,10 @@ require 'socket'
13
13
  module Netsoul
14
14
  class Client
15
15
  include Logging
16
-
16
+ attr_reader :started
17
17
  SOCKET_READ_TIMEOUT = 12 * 60
18
18
  SOCKET_WRITE_TIMEOUT = 10
19
19
 
20
- attr_reader :started
21
-
22
20
  def initialize(*args)
23
21
  opts = args.last.is_a?(Hash) ? args.last : {}
24
22
  @config = Config.new(opts)
@@ -37,7 +35,7 @@ module Netsoul
37
35
  else
38
36
  sock_send(Message.standard_auth(@config))
39
37
  end
40
- fail Netsoul::AuthenticationError, 'Authentication failed.'.freeze unless sock_get.split(' ')[1] == '002'
38
+ fail Netsoul::AuthenticationError, 'Authentication failed. See your config file or environment variables'.freeze unless sock_get.split(' ')[1] == '002'
41
39
  end
42
40
  private :auth_method
43
41
 
@@ -111,10 +109,11 @@ OptionParser.new do |opts|
111
109
  end
112
110
  end.parse!
113
111
 
114
- unless ENV.to_a.count { |k, _v| %w(NETSOUL_LOGIN NETSOUL_SOCKS_PASSWORD).include?(k) } == 2 ||
115
- ENV.to_a.count { |k, _v| %w(NETSOUL_LOGIN NETSOUL_UNIX_PASSWORD NETSOUL_AUTH_METHOD).include?(k) } == 3
116
- puts '[ERROR] You have to specify a configuration file or environment variables'
117
- exit
112
+ if options.empty? || options[:user_opts].size == 0
113
+ unless ENV.to_a.count { |k, _v| %w(NETSOUL_LOGIN NETSOUL_SOCKS_PASSWORD NETSOUL_LOGIN NETSOUL_UNIX_PASSWORD NETSOUL_AUTH_METHOD).include?(k) } >= 2
114
+ puts '[ERROR] You have to specify a configuration file or environment variables'
115
+ exit
116
+ end
118
117
  end
119
118
 
120
119
  retry_count = 10
@@ -1,3 +1,3 @@
1
1
  module Netsoul
2
- VERSION = '1.7.0'.freeze
2
+ VERSION = '1.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsoul
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Kakesa