<commit_before># encoding: ASCII
describe :io_gets_ascii, :shared => true do
  describe "with ASCII separator" do
    before :each do
      @file = File.open(tmp("gets_specs"), "wb") do |file|
        file.print("this is a test\xFFit is only a test\ndoes it work?")
      end
    end

    after :each do
      File.unlink(tmp("gets_specs"))
    end

    ruby_version_is ""..."1.9" do
      it "returns the separator's number representation" do
        file = File.open(tmp("gets_specs"), "rb")
        gets = file.gets("\xFF")

        gets.should == "this is a test\377"
      end
    end

    ruby_version_is "1.9" do
      it "returns the separator's character representation" do
        file = File.open(tmp("gets_specs"), "rb")
        gets = file.gets("\xFF")

        gets.should == "this is a test\xFF"
      end
    end
  end
end<commit_msg>little refactor of IO#gets with ASCII separator<commit_after># encoding: ASCII
describe :io_gets_ascii, :shared => true do
  describe "with ASCII separator" do
    before :each do
      File.open(tmp("gets_specs"), "wb") do |file|
        file.print("this is a test\xFFit is only a test\ndoes it work?")
      end

      file = File.open(tmp("gets_specs"), "rb")
      @gets = file.gets("\xFF")
    end

    after :each do
      File.unlink(tmp("gets_specs"))
    end

    ruby_version_is ""..."1.9" do
      it "returns the separator's number representation" do
        @gets.should == "this is a test\377"
      end
    end

    ruby_version_is "1.9" do
      it "returns the separator's character representation" do
        @gets.should == "this is a test\xFF"
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1218769043266301, 'fraction_numerical': 0.008531383302864107, 'mean_word_length': 2.4641350210970465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5497279', 'n_tokens_mistral': 563, 'n_tokens_neox': 519, 'n_words': 167}