rubysl-stringio 2.0.0 → 2.1.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: ad4377f000371c4db7fcc555b58556ead4b61005
4
- data.tar.gz: 2928739f7801ab5da1d9aee92165ef42c49ab5fb
3
+ metadata.gz: 268b6d1f8586fbf7293a9d93580530bab9f2ae65
4
+ data.tar.gz: 381bd78df08ab537ff168ec23885a6d98d8cc123
5
5
  SHA512:
6
- metadata.gz: f31db2a4d211f5bd2c576ace419d0a5a79aa2537a3d01c499be3225308043a5b189db2f8c69fb76036bd7f8fc1b6e9808ace694e3f5196336e946d6867d441ac
7
- data.tar.gz: 2f3fcf1b00557c2e78af268b8781adbbd3279c25af76d0d094147f3d25738cb4f28deda3e1a245cd6e994a173f62fe83947b21c16d97ab7747c999cbd8980f47
6
+ metadata.gz: 915538d44304221357e43a604698baa1564a575133f6a6ef0e4795e62e0ec4181050a301f9d075b987b9ed370000c4ab66b8988e694f4be051ae34f9ada83f69
7
+ data.tar.gz: d89699f2838f68b5c882d222fd875d5295436c064933a779f24889e831418c7e102ad07eb8cf416c3f4140b21f419717916f9c03d81a803a7bced864a07a3690
@@ -1,7 +1,11 @@
1
1
  language: ruby
2
2
  env:
3
- - RUBYLIB=lib
4
- script: bundle exec mspec
3
+ - RUBYLIB=lib:.
4
+ script: mspec spec
5
+ branches:
6
+ only:
7
+ - 1.0
8
+ - 2.0
5
9
  rvm:
6
- - 1.9.3
7
- - rbx-nightly-19mode
10
+ - 2.1.0
11
+ - rbx-2
@@ -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
@@ -1,5 +1,5 @@
1
1
  module RubySL
2
2
  module StringIO
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
  spec.add_development_dependency "mspec", "~> 1.5"
24
+ spec.add_development_dependency "rubysl-prettyprint", "~> 2.0"
24
25
  end
@@ -1,5 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../../../spec_helper', __FILE__)
3
2
  require File.expand_path('../fixtures/classes', __FILE__)
4
3
  require File.expand_path('../shared/codepoints', __FILE__)
5
4
 
@@ -1,5 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../../../spec_helper', __FILE__)
3
2
  require File.expand_path('../fixtures/classes', __FILE__)
4
3
  require File.expand_path('../shared/codepoints', __FILE__)
5
4
 
@@ -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#external_encoding" do
@@ -1,5 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../../../spec_helper', __FILE__)
3
2
  require 'stringio'
4
3
  require File.expand_path('../shared/getc', __FILE__)
5
4
 
@@ -227,8 +227,8 @@ ruby_version_is "1.9" do
227
227
  @io.gets('>', obj).should == "this>"
228
228
  end
229
229
 
230
- it "raises a TypeError if both separator and limit are nil" do
231
- lambda { @io.gets nil, nil }.should raise_error(TypeError)
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
@@ -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#internal_encoding" do
@@ -1,6 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require File.expand_path('../../../spec_helper', __FILE__)
4
3
  require File.expand_path('../fixtures/classes', __FILE__)
5
4
 
6
5
  describe "StringIO#putc when passed [String]" do
@@ -1,6 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require File.expand_path('../../../spec_helper', __FILE__)
4
3
  require File.expand_path('../fixtures/classes', __FILE__)
5
4
 
6
5
  describe "StringIO#puts when passed an Array" do
@@ -1,5 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../../../spec_helper', __FILE__)
3
2
  require "stringio"
4
3
  require File.expand_path('../shared/read', __FILE__)
5
4
 
@@ -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
@@ -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
@@ -1,5 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../../../spec_helper', __FILE__)
3
2
  require File.expand_path('../fixtures/classes', __FILE__)
4
3
 
5
4
  ruby_version_is "1.9" do
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.0.0
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: 2013-08-17 00:00:00.000000000 Z
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.0.7
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: