Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4dd5076e0b6d
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 11458ebf2294
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 6, 2016

  1. Revert "make sure we test for new transcoding options"

    This reverts commit 679a247.
    chuckremes committed Jul 6, 2016
    Copy the full SHA
    76959b7 View commit details
  2. Copy the full SHA
    11458eb View commit details
Showing with 2 additions and 16 deletions.
  1. +2 −2 core/io.rb
  2. +0 −14 spec/ruby/core/string/encode_spec.rb
4 changes: 2 additions & 2 deletions core/io.rb
Original file line number Diff line number Diff line change
@@ -1232,7 +1232,7 @@ def self.write(file, string, *args)
end

open_args = opts[:open_args] || [mode, :encoding => (external || "ASCII-8BIT")]
open_args.merge!(encoding_options)
open_args[1].merge!(encoding_options) if open_args[1].kind_of?(Hash)
File.open(file, *open_args) do |f|
f.seek(offset) if offset
f.write(string)
@@ -3393,7 +3393,7 @@ def write(data)
data.encode!(external_encoding)
end
end
data.encode!(@encoding_options) unless @encoding_options.empty?
data.encode!(@encoding_options) unless (@encoding_options || {}).empty?

# if @sync
@fd.write(data)
14 changes: 0 additions & 14 deletions spec/ruby/core/string/encode_spec.rb
Original file line number Diff line number Diff line change
@@ -60,20 +60,6 @@

"\rfoo".encode(:universal_newline => true).should == "\nfoo"
end

it "crlf_newline replaces lf with crlf" do
#"\r\nfoo".encode(crlf_newline: true).should == "\r\r\nfoo"

"\nfoo".encode(crlf_newline: true).should == "\r\nfoo"

"\rfoo".encode(crlf_newline: true).should == "\rfoo"
end

it "cr_newline replaces cr with lf" do
#"\r\nfoo".encode(cr_newline: true).should == "\r\rfoo"

"\nfoo".encode(cr_newline: true).should == "\rfoo"
end
end

describe "when passed to, from" do