rubysl-stringio 2.0.0 → 2.1.0
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 +4 -4
- data/.travis.yml +8 -4
- data/MRI_LICENSE +56 -0
- data/lib/rubysl/stringio/stringio.rb +2 -1
- data/lib/rubysl/stringio/version.rb +1 -1
- data/rubysl-stringio.gemspec +1 -0
- data/spec/codepoints_spec.rb +0 -1
- data/spec/each_codepoint_spec.rb +0 -1
- data/spec/external_encoding_spec.rb +0 -1
- data/spec/getc_spec.rb +0 -1
- data/spec/gets_spec.rb +2 -2
- data/spec/internal_encoding_spec.rb +0 -1
- data/spec/putc_spec.rb +0 -1
- data/spec/puts_spec.rb +0 -1
- data/spec/read_spec.rb +0 -1
- data/spec/set_encoding_spec.rb +5 -1
- data/spec/shared/read.rb +8 -8
- data/spec/ungetbyte_spec.rb +0 -1
- metadata +29 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268b6d1f8586fbf7293a9d93580530bab9f2ae65
|
4
|
+
data.tar.gz: 381bd78df08ab537ff168ec23885a6d98d8cc123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 915538d44304221357e43a604698baa1564a575133f6a6ef0e4795e62e0ec4181050a301f9d075b987b9ed370000c4ab66b8988e694f4be051ae34f9ada83f69
|
7
|
+
data.tar.gz: d89699f2838f68b5c882d222fd875d5295436c064933a779f24889e831418c7e102ad07eb8cf416c3f4140b21f419717916f9c03d81a803a7bced864a07a3690
|
data/.travis.yml
CHANGED
data/MRI_LICENSE
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c) give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
@@ -95,6 +95,7 @@ class StringIO
|
|
95
95
|
encoding = external || Encoding.default_external
|
96
96
|
@__data__.encoding = encoding
|
97
97
|
@__data__.string.force_encoding(encoding)
|
98
|
+
self
|
98
99
|
end
|
99
100
|
|
100
101
|
def external_encoding
|
@@ -676,7 +677,7 @@ class StringIO
|
|
676
677
|
|
677
678
|
def getline(arg_error, sep, limit)
|
678
679
|
if limit != Undefined
|
679
|
-
limit = Rubinius::Type.coerce_to limit, Fixnum, :to_int
|
680
|
+
limit = Rubinius::Type.coerce_to limit, Fixnum, :to_int if limit
|
680
681
|
sep = Rubinius::Type.coerce_to sep, String, :to_str if sep
|
681
682
|
else
|
682
683
|
limit = nil
|
data/rubysl-stringio.gemspec
CHANGED
data/spec/codepoints_spec.rb
CHANGED
data/spec/each_codepoint_spec.rb
CHANGED
data/spec/getc_spec.rb
CHANGED
data/spec/gets_spec.rb
CHANGED
@@ -227,8 +227,8 @@ ruby_version_is "1.9" do
|
|
227
227
|
@io.gets('>', obj).should == "this>"
|
228
228
|
end
|
229
229
|
|
230
|
-
it "
|
231
|
-
|
230
|
+
it "returns a String when both separator and limit are nil" do
|
231
|
+
@io.gets(nil, nil).should == "this>is>an>example"
|
232
232
|
end
|
233
233
|
end
|
234
234
|
end
|
data/spec/putc_spec.rb
CHANGED
data/spec/puts_spec.rb
CHANGED
data/spec/read_spec.rb
CHANGED
data/spec/set_encoding_spec.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'stringio'
|
2
|
-
require File.expand_path('../../../spec_helper', __FILE__)
|
3
2
|
|
4
3
|
ruby_version_is "1.9.2" do
|
5
4
|
describe "StringIO#set_encoding" do
|
@@ -30,5 +29,10 @@ ruby_version_is "1.9.2" do
|
|
30
29
|
io.set_encoding nil
|
31
30
|
io.string.encoding.should == Encoding::UTF_8
|
32
31
|
end
|
32
|
+
|
33
|
+
it "returns self" do
|
34
|
+
io = StringIO.new
|
35
|
+
io.set_encoding(Encoding::UTF_8).should equal(io)
|
36
|
+
end
|
33
37
|
end
|
34
38
|
end
|
data/spec/shared/read.rb
CHANGED
@@ -15,7 +15,7 @@ describe :stringio_read, :shared => true do
|
|
15
15
|
|
16
16
|
ruby_version_is "1.9" do
|
17
17
|
it "truncates buffer when limit is nil and no data reamins" do
|
18
|
-
@io.send(@method)
|
18
|
+
@io.send(@method, nil)
|
19
19
|
@io.send(@method, nil, buffer = "abc").should == ""
|
20
20
|
buffer.should == ""
|
21
21
|
end
|
@@ -111,21 +111,21 @@ describe :stringio_read_no_arguments, :shared => true do
|
|
111
111
|
end
|
112
112
|
|
113
113
|
it "reads the whole content starting from the current position" do
|
114
|
-
@io.send(@method).should == "example"
|
114
|
+
@io.send(@method, 10).should == "example"
|
115
115
|
|
116
116
|
@io.pos = 3
|
117
|
-
@io.send(@method).should == "mple"
|
117
|
+
@io.send(@method, 10).should == "mple"
|
118
118
|
end
|
119
119
|
|
120
120
|
it "updates the current position" do
|
121
|
-
@io.send(@method)
|
121
|
+
@io.send(@method, 10)
|
122
122
|
@io.pos.should eql(7)
|
123
123
|
end
|
124
124
|
|
125
125
|
ruby_bug "readmine#156", "1.8.7" do
|
126
126
|
it "returns an empty String when no data remains" do
|
127
|
-
@io.send(@method).should == "example"
|
128
|
-
@io.send(@method).should == ""
|
127
|
+
@io.send(@method, 7).should == "example"
|
128
|
+
@io.send(@method, nil).should == ""
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
@@ -177,10 +177,10 @@ end
|
|
177
177
|
describe :stringio_read_not_readable, :shared => true do
|
178
178
|
it "raises an IOError" do
|
179
179
|
io = StringIO.new("test", "w")
|
180
|
-
lambda { io.send(@method) }.should raise_error(IOError)
|
180
|
+
lambda { io.send(@method, 2) }.should raise_error(IOError)
|
181
181
|
|
182
182
|
io = StringIO.new("test")
|
183
183
|
io.close_read
|
184
|
-
lambda { io.send(@method) }.should raise_error(IOError)
|
184
|
+
lambda { io.send(@method, 2) }.should raise_error(IOError)
|
185
185
|
end
|
186
186
|
end
|
data/spec/ungetbyte_spec.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysl-stringio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Shirai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.5'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubysl-prettyprint
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
55
69
|
description: Ruby standard library stringio.
|
56
70
|
email:
|
57
71
|
- brixen@gmail.com
|
@@ -59,10 +73,11 @@ executables: []
|
|
59
73
|
extensions: []
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
|
-
- .gitignore
|
63
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
64
78
|
- Gemfile
|
65
79
|
- LICENSE
|
80
|
+
- MRI_LICENSE
|
66
81
|
- README.md
|
67
82
|
- Rakefile
|
68
83
|
- lib/rubysl/stringio.rb
|
@@ -158,17 +173,17 @@ require_paths:
|
|
158
173
|
- lib
|
159
174
|
required_ruby_version: !ruby/object:Gem::Requirement
|
160
175
|
requirements:
|
161
|
-
- - ~>
|
176
|
+
- - "~>"
|
162
177
|
- !ruby/object:Gem::Version
|
163
178
|
version: '2.0'
|
164
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
180
|
requirements:
|
166
|
-
- -
|
181
|
+
- - ">="
|
167
182
|
- !ruby/object:Gem::Version
|
168
183
|
version: '0'
|
169
184
|
requirements: []
|
170
185
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.5.1
|
172
187
|
signing_key:
|
173
188
|
specification_version: 4
|
174
189
|
summary: Ruby standard library stringio.
|
@@ -251,3 +266,4 @@ test_files:
|
|
251
266
|
- spec/ungetc_spec.rb
|
252
267
|
- spec/write_nonblock_spec.rb
|
253
268
|
- spec/write_spec.rb
|
269
|
+
has_rdoc:
|