ignite-client 0.1.1 → 0.2.0

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: a81b15f9a00bf89eb585f8065bd6e660ecb19e21e1b75a63b5e41df7302806dd
4
- data.tar.gz: 2894eb97340f58a8f8f40aa67a1aa3f7e3d6a2932b565339e551ec6b1b593204
3
+ metadata.gz: c0f2e2c94dd64afd629126983ad380351e4767942843a28c4a3f15af6bbc6755
4
+ data.tar.gz: 2de384d855a732143eac79d52185893348bc74a7821c82c9f9c3c65fcd63199c
5
5
  SHA512:
6
- metadata.gz: 8813cce5db934323a6d32a922f85a2ab10b3acd0738d8b6899230ab261bedf2f95058bb6d40ae426581c75de635702a5bee42bef9ed7ac2ca54e7ab6c357f8f4
7
- data.tar.gz: 3f5798dace62b573e02b7c6b11859e1d607f4ae85a859b9bde29169b5e1b55f0d59000dad14940be4763636b3b721d53ae1e330353163cf099c968dd0e193596
6
+ metadata.gz: e80c50e7d5867fad7c167d193026e94ffe6e5cf92e13b7f1e514982f77d63e70ed6db59b9188299a0f98ef7d95a3710dc7726e03065c8ab538b65e2517a77a9e
7
+ data.tar.gz: b3e604e8fa394dfac72ac040700afc97858d03d1b91faf3c9c6f5c7c620554efdc4d033a87dd80fb6ce9e6af84a86815b34d37a41a531c2a727b7b1c0ca40a46
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.2.0 (2023-05-11)
2
+
3
+ - Dropped support for Ruby < 3
4
+
5
+ ## 0.1.2 (2021-09-20)
6
+
7
+ - Added connect timeout
8
+
1
9
  ## 0.1.1 (2021-02-04)
2
10
 
3
11
  - Added support for array types
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  Add this line to your application’s Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'ignite-client'
12
+ gem "ignite-client"
13
13
  ```
14
14
 
15
15
  ## Getting Started
@@ -95,6 +95,12 @@ Specify the host and port
95
95
  Ignite::Client.new(host: "localhost", port: 10800)
96
96
  ```
97
97
 
98
+ Specify the connect timeout
99
+
100
+ ```ruby
101
+ Ignite::Client.new(connect_timeout: 3)
102
+ ```
103
+
98
104
  ## Authentication
99
105
 
100
106
  For [authentication](https://ignite.apache.org/docs/latest/security/authentication), use:
data/lib/ignite/client.rb CHANGED
@@ -1,9 +1,13 @@
1
- require "ignite"
1
+ require_relative "../ignite"
2
2
 
3
3
  module Ignite
4
4
  class Client
5
- def initialize(host: "localhost", port: 10800, username: nil, password: nil, use_ssl: nil, ssl_params: {})
6
- @socket = TCPSocket.new(host, port)
5
+ def initialize(host: "localhost", port: 10800, username: nil, password: nil, use_ssl: nil, ssl_params: {}, connect_timeout: nil)
6
+ begin
7
+ @socket = Socket.tcp(host, port, connect_timeout: connect_timeout, resolv_timeout: connect_timeout)
8
+ rescue Errno::ETIMEDOUT
9
+ raise TimeoutError, "Connection timed out"
10
+ end
7
11
 
8
12
  use_ssl = use_ssl.nil? ? (username || password) : use_ssl
9
13
  if use_ssl
@@ -1,3 +1,3 @@
1
1
  module Ignite
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/ignite.rb CHANGED
@@ -5,15 +5,16 @@ require "openssl"
5
5
  require "socket"
6
6
 
7
7
  # modules
8
- require "ignite/cache"
9
- require "ignite/op_codes"
10
- require "ignite/pack_formats"
11
- require "ignite/request"
12
- require "ignite/response"
13
- require "ignite/type_codes"
14
- require "ignite/version"
8
+ require_relative "ignite/cache"
9
+ require_relative "ignite/op_codes"
10
+ require_relative "ignite/pack_formats"
11
+ require_relative "ignite/request"
12
+ require_relative "ignite/response"
13
+ require_relative "ignite/type_codes"
14
+ require_relative "ignite/version"
15
15
 
16
16
  module Ignite
17
17
  class Error < StandardError; end
18
18
  class HandshakeError < Error; end
19
+ class TimeoutError < Error; end
19
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ignite-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-05 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -40,14 +40,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '2.6'
43
+ version: '3'
44
44
  required_rubygems_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  requirements: []
50
- rubygems_version: 3.2.3
50
+ rubygems_version: 3.4.10
51
51
  signing_key:
52
52
  specification_version: 4
53
53
  summary: Ruby client for Apache Ignite