Skip to content

Commit e9c08e6

Browse files
authored
Merge pull request Homebrew#195703 from Homebrew/ruby-heredoc-delimiters
Use Ruby language-specific heredoc delimiters
2 parents f5f49ad + 7f11dbc commit e9c08e6

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

Formula/c/cgrep.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ def install
4848
end
4949

5050
test do
51-
(testpath/"t.rb").write <<~EOS
51+
(testpath/"t.rb").write <<~RUBY
5252
# puts test comment.
5353
puts "test literal."
54-
EOS
54+
RUBY
5555

5656
assert_match ":1", shell_output("#{bin}/cgrep --count --comment test t.rb")
5757
assert_match ":1", shell_output("#{bin}/cgrep --count --literal test t.rb")

Formula/c/cucumber-cpp.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,29 @@ def install
4646

4747
system "gem", "install", "cucumber:9.1.1", "cucumber-wire:7.0.0", "--no-document"
4848

49-
(testpath/"features/test.feature").write <<~EOS
49+
(testpath/"features/test.feature").write <<~CUCUMBER
5050
Feature: Test
5151
Scenario: Just for test
5252
Given A given statement
5353
When A when statement
5454
Then A then statement
55-
EOS
55+
CUCUMBER
5656
(testpath/"features/step_definitions/cucumber.wire").write <<~EOS
5757
host: localhost
5858
port: 3902
5959
EOS
60-
(testpath/"features/support/wire.rb").write <<~EOS
60+
(testpath/"features/support/wire.rb").write <<~RUBY
6161
require 'cucumber/wire'
62-
EOS
63-
(testpath/"test.cpp").write <<~EOS
62+
RUBY
63+
(testpath/"test.cpp").write <<~CPP
6464
#include <cucumber-cpp/generic.hpp>
6565
GIVEN("^A given statement$") {
6666
}
6767
WHEN("^A when statement$") {
6868
}
6969
THEN("^A then statement$") {
7070
}
71-
EOS
71+
CPP
7272

7373
cxx_args = %W[
7474
-std=c++17

Formula/m/mikutter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def install
299299
end
300300

301301
test do
302-
(testpath/".mikutter/plugin/test_plugin/test_plugin.rb").write <<~EOS
302+
(testpath/".mikutter/plugin/test_plugin/test_plugin.rb").write <<~RUBY
303303
# -*- coding: utf-8 -*-
304304
Plugin.create(:test_plugin) do
305305
require 'logger'
@@ -317,7 +317,7 @@ def self.primary_service
317317
nil
318318
end
319319
end
320-
EOS
320+
RUBY
321321
system bin/"mikutter", "plugin_depends",
322322
testpath/".mikutter/plugin/test_plugin/test_plugin.rb"
323323
system bin/"mikutter", "--plugin=test_plugin", "--debug"

Formula/o/ohcount.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ def install
3434
end
3535

3636
test do
37-
(testpath/"test.rb").write <<~EOS
37+
(testpath/"test.rb").write <<~RUBY
3838
# comment
3939
puts
4040
puts
41-
EOS
41+
RUBY
4242
stats = shell_output("#{bin}/ohcount -i test.rb").lines.last
4343
assert_equal ["ruby", "2", "1", "33.3%"], stats.split[0..3]
4444
end

Formula/r/rubyfmt.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ def install
4646
end
4747

4848
test do
49-
(testpath/"test.rb").write <<~EOS
49+
(testpath/"test.rb").write <<~RUBY
5050
def foo; 42; end
51-
EOS
52-
expected = <<~EOS
51+
RUBY
52+
expected = <<~RUBY
5353
def foo
5454
42
5555
end
56-
EOS
56+
RUBY
5757
assert_equal expected, shell_output("#{bin}/rubyfmt -- #{testpath}/test.rb")
5858
end
5959
end

0 commit comments

Comments
 (0)