Skip to content

Commit af2c472

Browse files
authored
Merge pull request #197023 from Homebrew/lua-heredocs
Use Lua language-specific heredoc delimiters
2 parents f43b565 + e57fdb4 commit af2c472

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed

Formula/a/authoscope.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ def install
4040
end
4141

4242
test do
43-
(testpath/"true.lua").write <<~EOS
43+
(testpath/"true.lua").write <<~LUA
4444
descr = "always true"
4545
4646
function verify(user, password)
4747
return true
4848
end
49-
EOS
49+
LUA
5050
system bin/"authoscope", "run", "-vvx", testpath/"true.lua", "foo"
5151
end
5252
end

Formula/b/bam.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def install
3838
}
3939
C
4040

41-
(testpath/"bam.lua").write <<~EOS
41+
(testpath/"bam.lua").write <<~LUA
4242
settings = NewSettings()
4343
objs = Compile(settings, Collect("*.c"))
4444
exe = Link(settings, "hello", objs)
45-
EOS
45+
LUA
4646

4747
system bin/"bam", "-v"
4848
assert_equal "hello", shell_output("./hello").chomp

Formula/k/kyoto-tycoon.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def install
5353
end
5454

5555
test do
56-
(testpath/"test.lua").write <<~EOS
56+
(testpath/"test.lua").write <<~LUA
5757
kt = __kyototycoon__
5858
db = kt.db
5959
-- echo back the input data as the output data
@@ -63,7 +63,7 @@ def install
6363
end
6464
return kt.RVSUCCESS
6565
end
66-
EOS
66+
LUA
6767
port = free_port
6868

6969
fork do

Formula/l/luaradio.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def install
3131

3232
test do
3333
(testpath/"hello").write("Hello, world!")
34-
(testpath/"test.lua").write <<~EOS
34+
(testpath/"test.lua").write <<~LUA
3535
local radio = require('radio')
3636
3737
local PrintBytes = radio.block.factory("PrintBytes")
@@ -52,7 +52,7 @@ def install
5252
5353
top:connect(source, sink)
5454
top:run()
55-
EOS
55+
LUA
5656

5757
assert_equal "Hello, world!", shell_output("#{bin}/luaradio test.lua")
5858
end

Formula/l/luarocks.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ def install
6868

6969
case luaversion
7070
when "5.1"
71-
(testpath/"lfs_#{luaversion}test.lua").write <<~EOS
71+
(testpath/"lfs_#{luaversion}test.lua").write <<~LUA
7272
require("lfs")
7373
lfs.mkdir("blank_space")
74-
EOS
74+
LUA
7575

7676
system luaexec, "lfs_#{luaversion}test.lua"
7777
assert_predicate testpath/"blank_space", :directory?,
7878
"Luafilesystem failed to create the expected directory"
7979
else
80-
(testpath/"lfs_#{luaversion}test.lua").write <<~EOS
80+
(testpath/"lfs_#{luaversion}test.lua").write <<~LUA
8181
require("lfs")
8282
print(lfs.currentdir())
83-
EOS
83+
LUA
8484

8585
assert_match testpath.to_s, shell_output("#{luaexec} lfs_#{luaversion}test.lua")
8686
end

Formula/l/luv.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def install
5555
end
5656

5757
test do
58-
(testpath/"test.lua").write <<~EOS
58+
(testpath/"test.lua").write <<~LUA
5959
local uv = require('luv')
6060
local timer = uv.new_timer()
6161
timer:start(1000, 0, function()
@@ -64,7 +64,7 @@ def install
6464
end)
6565
print("Sleeping");
6666
uv.run()
67-
EOS
67+
LUA
6868

6969
expected = <<~EOS
7070
Sleeping

Formula/o/osrm-backend.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def install
8484
node2 = 'visible="true" version="1" changeset="323878" timestamp="2008-05-03T13:39:23Z"'
8585
node3 = 'visible="true" version="1" changeset="323878" timestamp="2008-05-03T13:39:23Z"'
8686

87-
(testpath/"test.osm").write <<~EOS
87+
(testpath/"test.osm").write <<~XML
8888
<?xml version="1.0" encoding="UTF-8"?>
8989
<osm version="0.6">
9090
<bounds minlat="54.0889580" minlon="12.2487570" maxlat="54.0913900" maxlon="12.2524800"/>
@@ -97,14 +97,14 @@ def install
9797
<tag k="highway" v="unclassified"/>
9898
</way>
9999
</osm>
100-
EOS
100+
XML
101101

102-
(testpath/"tiny-profile.lua").write <<~EOS
102+
(testpath/"tiny-profile.lua").write <<~LUA
103103
function way_function (way, result)
104104
result.forward_mode = mode.driving
105105
result.forward_speed = 1
106106
end
107-
EOS
107+
LUA
108108

109109
safe_system bin/"osrm-extract", "test.osm", "--profile", "tiny-profile.lua"
110110
safe_system bin/"osrm-contract", "test.osrm"

Formula/s/sn0int.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ def install
3535
end
3636

3737
test do
38-
(testpath/"true.lua").write <<~EOS
38+
(testpath/"true.lua").write <<~LUA
3939
-- Description: basic selftest
4040
-- Version: 0.1.0
4141
-- License: GPL-3.0
4242
4343
function run()
4444
-- nothing to do here
4545
end
46-
EOS
46+
LUA
4747
system bin/"sn0int", "run", "-vvxf", testpath/"true.lua"
4848
end
4949
end

Formula/t/tarantool.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def post_install
7373
end
7474

7575
test do
76-
(testpath/"test.lua").write <<~EOS
76+
(testpath/"test.lua").write <<~LUA
7777
box.cfg{}
7878
local s = box.schema.create_space("test")
7979
s:create_index("primary")
@@ -84,7 +84,7 @@ def post_install
8484
os.exit(-1)
8585
end
8686
os.exit(0)
87-
EOS
87+
LUA
8888
system bin/"tarantool", "#{testpath}/test.lua"
8989
end
9090
end

Formula/t/tundra.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def install
5353
["linux", "gcc"]
5454
end
5555

56-
(testpath/"tundra.lua").write <<~EOS
56+
(testpath/"tundra.lua").write <<~LUA
5757
Build {
5858
Units = function()
5959
local test = Program {
@@ -70,7 +70,7 @@ def install
7070
},
7171
},
7272
}
73-
EOS
73+
LUA
7474
system bin/"tundra2"
7575
system "./t2-output/#{os}-#{cc}-debug-default/test"
7676
end

0 commit comments

Comments
 (0)