diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a420466cc..88e3bf21c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,9 +42,7 @@ jobs: run: bundle exec rake env: RUBYOPT: --enable-frozen_string_literal - continue-on-error: ${{ matrix.ruby == 'truffleruby-head' }} - if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }} run: bundle exec rake rdoc - if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }} run: bundle exec rake rubocop - diff --git a/Rakefile b/Rakefile index f47890b40b..508938c938 100644 --- a/Rakefile +++ b/Rakefile @@ -65,7 +65,7 @@ parsed_files = PARSER_FILES.map do |parser_file| racc = Gem.bin_path 'racc', 'racc' rb_file = parser_file.gsub(/\.ry\z/, ".rb") ruby "#{racc} -l -E -o #{rb_file} #{parser_file}" - open(rb_file, 'r+') do |f| + File.open(rb_file, 'r+') do |f| newtext = "# frozen_string_literal: true\n#{f.read}" f.rewind f.write newtext diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb index 853d7dad22..5168932430 100644 --- a/test/rdoc/test_rdoc_rdoc.rb +++ b/test/rdoc/test_rdoc_rdoc.rb @@ -165,12 +165,7 @@ def test_normalized_file_list_with_dot_doc b = Dir.glob(b).first c = Dir.glob(c).first - dot_doc = File.expand_path('.document') - FileUtils.touch dot_doc - open(dot_doc, 'w') do |f| - f.puts 'a.rb' - f.puts 'b.rb' - end + File.write('.document', "a.rb\n""b.rb\n") expected_files << a expected_files << b @@ -196,12 +191,7 @@ def test_normalized_file_list_with_dot_doc_overridden_by_exclude_option b = Dir.glob(b).first c = Dir.glob(c).first - dot_doc = File.expand_path('.document') - FileUtils.touch dot_doc - open(dot_doc, 'w') do |f| - f.puts 'a.rb' - f.puts 'b.rb' - end + File.write('.document', "a.rb\n""b.rb\n") expected_files << a @rdoc.options.exclude = Regexp.new(['b.rb'].join('|'))