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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ce36520d06eb8e3e08383539c50953ca6f82312
4
- data.tar.gz: 35110e9ebef037e19a650c7b8cb6d9751cd3b410
3
+ metadata.gz: f6b812be3f0645a965e2ca03611d713e79689b56
4
+ data.tar.gz: 3055face930b9a71606b580e23ca3d4bf02ea3f8
5
5
  SHA512:
6
- metadata.gz: feb2fec494e4d6923d9bfee025774b66a8f9ba84210880b586f44d98516c0d6f2a9bdb2e25af6544a4a4dc6833c0066847c64caa1be763f41f42c830a2298584
7
- data.tar.gz: fc8ed6e425c0e753ed85acdd1b6d2c97cf3848420c06394fc0ef8091f2fecddb158a74e039cfa56023112cc4c0c034ac1c02139770985749aa86c2456ce57a93
6
+ metadata.gz: d4f1f318ae5440fde5336234c80a961aa71358e48a90ecfb43216782579216ba4905cca9eca24d9ee0247de315bc95db476c29cbdd39e248f01ed787ec4189f6
7
+ data.tar.gz: 3c7217a8a3936a6832eedd86cbf62bb948fa0f22e87a0cd2ba78c91c5989307fd61838ddb6e09a5ae80a3b15445bc827cc8e8610e86d3f45bf3fab906f95760a
@@ -1,3 +1,3 @@
1
1
  module AwsMemfix
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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
- @data = data
5
- @offset = 0
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_memfix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Milovan Zogovic