aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/test/generators/actions_test.rb2
-rw-r--r--railties/test/generators/scaffold_generator_test.rb4
-rw-r--r--tasks/release.rb4
3 files changed, 5 insertions, 5 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index f421207025..a54a6dbc28 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -403,7 +403,7 @@ class ActionsTest < Rails::Generators::TestCase
content.gsub!(/^ \#.*\n/, "")
content.gsub!(/^\n/, "")
- File.open(route_path, "wb") { |file| file.write(content) }
+ File.write(route_path, content)
routes = <<-F
Rails.application.routes.draw do
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index 29426cd99f..3e631f6021 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -347,7 +347,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
content = File.read(route_path).gsub(/\.routes\.draw do/) do |match|
"#{match} |map|"
end
- File.open(route_path, "wb") { |file| file.write(content) }
+ File.write(route_path, content)
run_generator ["product_line"], behavior: :revoke
@@ -364,7 +364,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
content.gsub!(/^ \#.*\n/, "")
content.gsub!(/^\n/, "")
- File.open(route_path, "wb") { |file| file.write(content) }
+ File.write(route_path, content)
assert_file "config/routes.rb", /\.routes\.draw do\n resources :product_lines\nend\n\z/
run_generator ["product_line"], behavior: :revoke
diff --git a/tasks/release.rb b/tasks/release.rb
index e326021dad..cbda9a3798 100644
--- a/tasks/release.rb
+++ b/tasks/release.rb
@@ -107,7 +107,7 @@ namespace :changelog do
header = "## Rails #{version} (#{Date.today.strftime('%B %d, %Y')}) ##\n\n"
header += "* No changes.\n\n\n" if current_contents =~ /\A##/
contents = header + current_contents
- File.open(fname, "wb") { |f| f.write contents }
+ File.write(fname, contents)
end
end
@@ -118,7 +118,7 @@ namespace :changelog do
fname = File.join fw, "CHANGELOG.md"
contents = File.read(fname).sub(/^(## Rails .*)\n/, replace)
- File.open(fname, "wb") { |f| f.write contents }
+ File.write(fname, contents)
end
end