aws_memfix 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws_memfix/version.rb +1 -1
- data/lib/seahorse/stringio.rb +5 -58
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6b812be3f0645a965e2ca03611d713e79689b56
|
4
|
+
data.tar.gz: 3055face930b9a71606b580e23ca3d4bf02ea3f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4f1f318ae5440fde5336234c80a961aa71358e48a90ecfb43216782579216ba4905cca9eca24d9ee0247de315bc95db476c29cbdd39e248f01ed787ec4189f6
|
7
|
+
data.tar.gz: 3c7217a8a3936a6832eedd86cbf62bb948fa0f22e87a0cd2ba78c91c5989307fd61838ddb6e09a5ae80a3b15445bc827cc8e8610e86d3f45bf3fab906f95760a
|
data/lib/aws_memfix/version.rb
CHANGED
data/lib/seahorse/stringio.rb
CHANGED
@@ -1,63 +1,10 @@
|
|
1
|
+
require "delegate"
|
2
|
+
|
1
3
|
module Seahorse
|
2
|
-
class StringIO
|
4
|
+
class StringIO < SimpleDelegator
|
3
5
|
def initialize(data = '')
|
4
|
-
@
|
5
|
-
@
|
6
|
-
end
|
7
|
-
|
8
|
-
def write(data)
|
9
|
-
@data << data
|
10
|
-
@offset += data.bytesize
|
11
|
-
data.bytesize
|
12
|
-
end
|
13
|
-
|
14
|
-
def read(bytes = nil, output_buffer = nil)
|
15
|
-
if bytes
|
16
|
-
data = partial_read(bytes)
|
17
|
-
else
|
18
|
-
data = full_read
|
19
|
-
end
|
20
|
-
output_buffer ? output_buffer.replace(data || '') : data
|
21
|
-
end
|
22
|
-
|
23
|
-
def rewind
|
24
|
-
@offset = 0
|
25
|
-
end
|
26
|
-
|
27
|
-
def truncate(bytes)
|
28
|
-
@data = @data[0,bytes]
|
29
|
-
bytes
|
30
|
-
end
|
31
|
-
|
32
|
-
def size
|
33
|
-
@data.bytesize
|
34
|
-
end
|
35
|
-
|
36
|
-
def eof
|
37
|
-
@offset == @data.bytesize
|
38
|
-
end
|
39
|
-
alias_method :eof?, :eof
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
def partial_read(bytes)
|
44
|
-
if @offset >= @data.bytesize
|
45
|
-
nil
|
46
|
-
else
|
47
|
-
data = @data[@offset,@offset+bytes]
|
48
|
-
bump_offset(bytes)
|
49
|
-
data
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def full_read
|
54
|
-
data = @offset == 0 ? @data : @data[@offset..-1]
|
55
|
-
@offset = @data.bytesize
|
56
|
-
data || ''
|
57
|
-
end
|
58
|
-
|
59
|
-
def bump_offset(bytes)
|
60
|
-
@offset = [@data.bytesize, @offset + bytes].min
|
6
|
+
@io = ::StringIO.new(data)
|
7
|
+
super(@io)
|
61
8
|
end
|
62
9
|
end
|
63
10
|
end
|