hiredis 0.4.4-java → 0.4.5-java

Sign up to get free protection for your applications and to get access to all the features.
data/COPYING CHANGED
@@ -1,10 +1,28 @@
1
- Copyright (c) 2010, Pieter Noordhuis
1
+ Copyright (c) 2010-2012, Pieter Noordhuis
2
+
2
3
  All rights reserved.
3
4
 
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
5
14
 
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
- * Neither the name of Redis nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
15
+ * Neither the name of Redis nor the names of its contributors may be used to
16
+ endorse or promote products derived from this software without specific prior
17
+ written permission.
9
18
 
10
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
23
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -150,7 +150,7 @@ module Hiredis
150
150
  return false if @length < stop
151
151
 
152
152
  @pos = stop
153
- @buffer[start, bytes]
153
+ force_encoding @buffer[start, bytes]
154
154
  end
155
155
 
156
156
  def read_line
@@ -159,7 +159,23 @@ module Hiredis
159
159
  return false unless stop
160
160
 
161
161
  @pos = stop + 2 # include CRLF
162
- @buffer[start, stop - start]
162
+ force_encoding @buffer[start, stop - start]
163
+ end
164
+
165
+ private
166
+
167
+ if "".respond_to?(:force_encoding)
168
+
169
+ def force_encoding(str)
170
+ str.force_encoding(Encoding.default_external)
171
+ end
172
+
173
+ else
174
+
175
+ def force_encoding(str)
176
+ str
177
+ end
178
+
163
179
  end
164
180
  end
165
181
  end
@@ -1,3 +1,3 @@
1
1
  module Hiredis
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hiredis
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.4
5
+ version: 0.4.5
6
6
  platform: java
7
7
  authors:
8
8
  - Pieter Noordhuis
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-19 00:00:00 -08:00
14
- default_executable:
13
+ date: 2012-03-19 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rake-compiler
@@ -45,7 +44,6 @@ files:
45
44
  - lib/hiredis/ruby/reader.rb
46
45
  - COPYING
47
46
  - Rakefile
48
- has_rdoc: true
49
47
  homepage: http://github.com/pietern/hiredis-rb
50
48
  licenses: []
51
49
 
@@ -69,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
67
  requirements: []
70
68
 
71
69
  rubyforge_project:
72
- rubygems_version: 1.6.2
70
+ rubygems_version: 1.8.15
73
71
  signing_key:
74
72
  specification_version: 3
75
73
  summary: Ruby extension that wraps Hiredis (blocking connection and reply parsing)