aerospike 1.0.2 → 1.0.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
  SHA1:
3
- metadata.gz: ecb7abe132e27049f98901edc5993ca316ea7dc5
4
- data.tar.gz: f6e9938a22006bf8872c2e3f0caaeb1fd858da14
3
+ metadata.gz: 12f8781a2331d9c34b1fc9261727737ebcd1cbba
4
+ data.tar.gz: bb73b4c41ad28ddb71e0595a3d5b66c6cb3ca634
5
5
  SHA512:
6
- metadata.gz: 02a72230b8ddfb9b15ca2dea45bad841a3b387d124e98e8d7c20c33cf8f413b51e36fdb0dc76f808cc6a5f0b0e5ab7aefa8a6a86e1675b5cca75dc7cb6db983c
7
- data.tar.gz: c7e581d770f82aec05ca052ba9e69dd15e41499f48478bc2ae325f581df1283d7895f7a9684c8fc5145ec142885409728d914e51d6d88bc968d03f96af672bf6
6
+ metadata.gz: 04d7941776ada54e3c14fa305577e657a526b25393c3df206d783759b3e44075563ae8bec0f49b1ecd27b4278a06be685c6e94bccec54ade7b3cdb89ae8023c5
7
+ data.tar.gz: 762682e172f8d2ef156130ab6ac56fcf0799e4655ddca309aa7cf3bfcefd687632624cf94f0fa1eb73d794339f6ea868b6c7af7e3a92195ff99fe5f68c198c44
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## March 24 2015 (1.0.3)
2
+
3
+ Minor fixes and improvements.
4
+
5
+ * **New Features**:
6
+
7
+ * Symbols are now accepted as key values. Keep in mind that symbols are converted to string automatically, and type information is lost.
8
+
9
+ * **Fixes**:
10
+
11
+ * Wait for a good connection on `socket.connect_nonblock` to prevent infinite loops on read/write operations.
12
+
13
+
1
14
  ## March 14 2015 (1.0.2)
2
15
 
3
16
  Minor improvements.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  An Aerospike library for Ruby.
4
4
 
5
- This library is compatible with Ruby 1.9.3+ and supports Linux, Mac OS X and various other BSDs. Rubinius is supported, but not JRuby - yet. For the moment, query and scan operations are also not supported.
5
+ This library is compatible with Ruby 1.9.3+ and supports Linux, Mac OS X and various other BSDs. Rubinius is supported, but not JRuby - yet.
6
6
 
7
7
 
8
8
  - [Usage](#Usage)
@@ -79,7 +79,7 @@ Supported operating systems:
79
79
  1. Install Ruby 1.9.3+
80
80
  2. Install RubyGems
81
81
  3. Install Bundler: ```gem install bundler```
82
- 4. Install dependencies: ```bundle install```
82
+ 4. Install dependencies: ```bundler install```
83
83
  5. Build and Install the gem locally: ```rake build && rake install```
84
84
  6. Run the benchmark: ```./tools/benchmark/benchmark.rb -u```
85
85
 
@@ -34,14 +34,18 @@ module Aerospike
34
34
 
35
35
  def connect(host, port, timeout)
36
36
  socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
37
- sockaddr = Socket.sockaddr_in(port, host)
37
+ @sockaddr = Socket.sockaddr_in(port, host)
38
38
  begin
39
- socket.connect_nonblock(sockaddr)
40
- rescue Errno::EINPROGRESS
39
+ socket.connect_nonblock(@sockaddr)
40
+ socket
41
+ rescue IO::WaitWritable, Errno::EINPROGRESS
41
42
  # Block until the socket is ready, then try again
42
- IO.select([socket], [socket], [socket], timeout.to_f)
43
- @sockaddr = sockaddr
44
- return socket
43
+ IO.select(nil, [socket], nil, timeout.to_f)
44
+ begin
45
+ socket.connect_nonblock(@sockaddr)
46
+ rescue Errno::EISCONN
47
+ end
48
+ socket
45
49
  end
46
50
  end
47
51
 
@@ -53,6 +53,8 @@ module Aerospike
53
53
  end
54
54
  when String
55
55
  res = StringValue.new(value)
56
+ when Symbol
57
+ res = StringValue.new(value.to_s)
56
58
  when Value
57
59
  res = value
58
60
  when Hash
@@ -185,6 +187,10 @@ module Aerospike
185
187
  @value
186
188
  end
187
189
 
190
+ def to_sym
191
+ @value.to_sym
192
+ end
193
+
188
194
  end # StringValue
189
195
 
190
196
  #######################################
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Aerospike
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aerospike
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Khosrow Afroozeh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-14 00:00:00.000000000 Z
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack