rconrb 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2d90b6a2bacdf1d213da0356764b3e911cd0c5caf8a6516fcc8562cc88aec1a
4
- data.tar.gz: 77f7e0038e8a2aa2eb05265c07adae7b4b05ced177fa86fc226f7aa6b6ef4933
3
+ metadata.gz: 4affb0f2781b388626b4a8e82d8e9c50d6d60e00a316c79f6e5b950585f5b9f5
4
+ data.tar.gz: 5e55593717e8a49dc2de96bd4e6dde4d71a118908939139a9c156f3250919a40
5
5
  SHA512:
6
- metadata.gz: 2e54c3a135b6ab6df953bc05e893a30e495f4a9f20415edd3c6a4eb65c1c32887f2a8178bef0c259578584f708e9955a9445ec9376d5364ab1cb92c8c0fbf518
7
- data.tar.gz: f13555248995c93017d61eba73685ed2999c37c5833c68ec59bcc51e30601e5f78f0b811d696f419076b1cd2c77ea6c17e9ef8cc69de73553bb3a323327d4ccc
6
+ metadata.gz: c7bf6b02287c195cb66eff5d17a563316ed07518a0a6ea0c319ad1e4a7efe1439a7064cc4b30a95028ed065ababfb691cabfa145843358e40e1c3c6955c4b463
7
+ data.tar.gz: cdc2a7a39c20373dc6c8670d6cefc13f5513cdb755e764c6bbefed40ea4bdc508dce605ecac4a33fb4e1c9b083f4ac05a8e11108471529238a0196a13f4ab8a1
data/.circleci/config.yml CHANGED
@@ -1,13 +1,17 @@
1
- version: 2
1
+ version: 2.1
2
+
2
3
  jobs:
3
- build:
4
- parallelism: 1
4
+ test:
5
+ parameters:
6
+ ruby-version:
7
+ type: string
5
8
  docker:
6
- - image: circleci/ruby:2.6.0-stretch
9
+ - image: cimg/ruby:<< parameters.ruby-version >>
7
10
  environment:
8
11
  BUNDLE_JOBS: 1
9
12
  BUNDLE_RETRY: 3
10
13
  BUNDLE_PATH: vendor/bundle
14
+
11
15
  steps:
12
16
  - checkout
13
17
 
@@ -23,3 +27,11 @@ jobs:
23
27
  --out test_results/rspec.xml \
24
28
  --format progress \
25
29
  $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
30
+
31
+ workflows:
32
+ build_and_test:
33
+ jobs:
34
+ - test:
35
+ matrix:
36
+ parameters:
37
+ ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
@@ -50,6 +50,14 @@ module Rcon
50
50
  end
51
51
  end
52
52
 
53
+ # used for communicating that the server closed the connection
54
+ class ServerClosedSocketError < StandardError
55
+ # @return [String]
56
+ def message
57
+ "the server closed the connection. Do you have too many concurrent connections open?"
58
+ end
59
+ end
60
+
53
61
  # used for communicating that we timed out trying to read from the socket
54
62
  class SocketReadTimeoutError < StandardError
55
63
  # @return [String]
data/lib/rcon/packet.rb CHANGED
@@ -40,11 +40,17 @@ module Rcon
40
40
  # @raise [Error::SocketReadTimeoutError] if timeout occurs while waiting to read from socket
41
41
  def self.read_from_socket_wrapper(socket_wrapper)
42
42
  if socket_wrapper.ready_to_read?
43
- size = socket_wrapper.recv(INT_BYTE_SIZE).unpack(INTEGER_PACK_DIRECTIVE).first
43
+ size = socket_wrapper.recv(INT_BYTE_SIZE)&.unpack(INTEGER_PACK_DIRECTIVE)&.first
44
+ if size.nil?
45
+ raise Error::ServerClosedSocketError
46
+ end
44
47
  id_and_type_length = 2 * INT_BYTE_SIZE
45
48
  body_length = size - id_and_type_length - (2 * TRAILER_BYTE_SIZE) # ignore trailing nulls
46
49
 
47
50
  payload = socket_wrapper.recv(size)
51
+ if payload.nil?
52
+ raise Error::ServerClosedSocketError
53
+ end
48
54
  id, type_int = payload[0...id_and_type_length].unpack("#{INTEGER_PACK_DIRECTIVE}*")
49
55
  body = payload[id_and_type_length..].unpack("#{STR_PACK_DIRECTIVE}#{body_length}").first
50
56
  type = RESPONSE_PACKET_TYPE.key(type_int) || raise(Error::InvalidResponsePacketTypeCodeError.new(type_int))
data/lib/rcon/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Rcon
2
2
  # current version number
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
data/rconrb.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["Anthony Felix Hernandez"]
7
7
  spec.email = ["ant@antfeedr.com"]
8
8
 
9
- spec.summary = %q{An flexible RCON client written in Ruby, based on the Source RCON protocol.}
9
+ spec.summary = %q{A flexible RCON client written in Ruby, based on the Source RCON protocol.}
10
10
  spec.homepage = "https://github.com/hernanat/rconrb"
11
11
  spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
12
12
 
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.require_paths = ["lib"]
27
27
 
28
28
  spec.add_development_dependency "pry"
29
- spec.add_development_dependency "yard", "~> 0.9.9"
29
+ spec.add_development_dependency "yard", "~> 0.9"
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rconrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Felix Hernandez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-06 00:00:00.000000000 Z
11
+ date: 2024-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -30,15 +30,15 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.9
33
+ version: '0.9'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.9.9
41
- description:
40
+ version: '0.9'
41
+ description:
42
42
  email:
43
43
  - ant@antfeedr.com
44
44
  executables: []
@@ -68,7 +68,7 @@ metadata:
68
68
  homepage_uri: https://github.com/hernanat/rconrb
69
69
  source_code_uri: https://github.com/hernanat/rconrb
70
70
  documentation_uri: https://rubydoc.info/github/hernanat/rconrb
71
- post_install_message:
71
+ post_install_message:
72
72
  rdoc_options: []
73
73
  require_paths:
74
74
  - lib
@@ -83,8 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.1.2
87
- signing_key:
86
+ rubygems_version: 3.5.14
87
+ signing_key:
88
88
  specification_version: 4
89
- summary: An flexible RCON client written in Ruby, based on the Source RCON protocol.
89
+ summary: A flexible RCON client written in Ruby, based on the Source RCON protocol.
90
90
  test_files: []