Skip to content

Commit 5ca0a5a

Browse files
authored
Merge pull request #197025 from Homebrew/xml-heredocs
Use XML language-specific heredoc delimiters
2 parents dffb017 + d558681 commit 5ca0a5a

23 files changed

+64
-64
lines changed

Formula/a/ant-contrib.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def install
2323
end
2424

2525
test do
26-
(testpath/"build.xml").write <<~EOS
26+
(testpath/"build.xml").write <<~XML
2727
<project name="HomebrewTest" default="init" basedir=".">
2828
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
2929
<target name="init">
@@ -35,7 +35,7 @@ def install
3535
</if>
3636
</target>
3737
</project>
38-
EOS
38+
XML
3939
system Formula["ant"].opt_bin/"ant"
4040
end
4141
end

Formula/a/ant.rb

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

4848
test do
49-
(testpath/"build.xml").write <<~EOS
49+
(testpath/"build.xml").write <<~XML
5050
<project name="HomebrewTest" basedir=".">
5151
<property name="src" location="src"/>
5252
<property name="build" location="build"/>
@@ -57,16 +57,16 @@ def install
5757
<javac srcdir="${src}" destdir="${build}"/>
5858
</target>
5959
</project>
60-
EOS
60+
XML
6161

62-
(testpath/"src/main/java/org/homebrew/AntTest.java").write <<~EOS
62+
(testpath/"src/main/java/org/homebrew/AntTest.java").write <<~JAVA
6363
package org.homebrew;
6464
public class AntTest {
6565
public static void main(String[] args) {
6666
System.out.println("Testing Ant with Homebrew!");
6767
}
6868
}
69-
EOS
69+
JAVA
7070

7171
system bin/"ant", "compile"
7272
end

Formula/a/[email protected]

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def install
3030
end
3131

3232
test do
33-
(testpath/"build.xml").write <<~EOS
33+
(testpath/"build.xml").write <<~XML
3434
<project name="HomebrewTest" basedir=".">
3535
<property name="src" location="src"/>
3636
<property name="build" location="build"/>
@@ -41,16 +41,16 @@ def install
4141
<javac srcdir="${src}" destdir="${build}"/>
4242
</target>
4343
</project>
44-
EOS
44+
XML
4545

46-
(testpath/"src/main/java/org/homebrew/AntTest.java").write <<~EOS
46+
(testpath/"src/main/java/org/homebrew/AntTest.java").write <<~JAVA
4747
package org.homebrew;
4848
public class AntTest {
4949
public static void main(String[] args) {
5050
System.out.println("Testing Ant with Homebrew!");
5151
}
5252
}
53-
EOS
53+
JAVA
5454

5555
system bin/"ant", "compile"
5656
end

Formula/a/appstream.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ def install
7272
end
7373

7474
test do
75-
(testpath/"appdata.xml").write <<~EOS
75+
(testpath/"appdata.xml").write <<~XML
7676
<?xml version="1.0" encoding="UTF-8"?>
7777
<component type="desktop-application">
7878
<id>org.test.test-app</id>
7979
<name>Test App</name>
8080
</component>
81-
EOS
81+
XML
8282
(testpath/"test.c").write <<~C
8383
#include "appstream.h"
8484

Formula/b/bnd.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def install
2929
test_version = "1.0.0"
3030
test_version_next = "1.0.1"
3131
test_file_name = "#{test_bsn}-#{test_version}.jar"
32-
(testpath/"index.xml").write <<~EOS
32+
(testpath/"index.xml").write <<~XML
3333
<?xml version="1.0" encoding="utf-8"?>
3434
<repository increment="0" name="Untitled" xmlns="http://www.osgi.org/xmlns/repository/v1.0.0">
3535
<resource>
@@ -44,7 +44,7 @@ def install
4444
</capability>
4545
</resource>
4646
</repository>
47-
EOS
47+
XML
4848

4949
(testpath/"launch.bndrun").write <<~EOS
5050
-standalone: ${.}/index.xml

Formula/d/dbxml.rb

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

5454
test do
55-
(testpath/"simple.xml").write <<~EOS
55+
(testpath/"simple.xml").write <<~XML
5656
<breakfast_menu>
5757
<food>
5858
<name>Belgian Waffles</name>
@@ -63,7 +63,7 @@ def install
6363
<calories>950</calories>
6464
</food>
6565
</breakfast_menu>
66-
EOS
66+
XML
6767

6868
(testpath/"dbxml.script").write <<~EOS
6969
createContainer ""

Formula/d/docbook2x.rb

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

7777
test do
7878
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
79-
(testpath/"brew.1.xml").write <<~EOS
79+
(testpath/"brew.1.xml").write <<~XML
8080
<?xml version="1.0" encoding="ISO-8859-1"?>
8181
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
8282
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
@@ -90,7 +90,7 @@ def install
9090
<refpurpose>The missing package manager for macOS</refpurpose>
9191
</refnamediv>
9292
</refentry>
93-
EOS
93+
XML
9494
system bin/"docbook2man", testpath/"brew.1.xml"
9595
assert_predicate testpath/"brew.1", :exist?, "Failed to create man page!"
9696
end

Formula/g/glib.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def post_install
160160

161161
assert_match "This file is generated by glib-mkenum", shell_output(bin/"glib-mkenums")
162162

163-
(testpath/"net.Corp.MyApp.Frobber.xml").write <<~EOS
163+
(testpath/"net.Corp.MyApp.Frobber.xml").write <<~XML
164164
<node>
165165
<interface name="net.Corp.MyApp.Frobber">
166166
<method name="HelloWorld">
@@ -177,7 +177,7 @@ def post_install
177177
<property name="Verbose" type="b" access="readwrite"/>
178178
</interface>
179179
</node>
180-
EOS
180+
XML
181181

182182
system bin/"gdbus-codegen", "--generate-c-code", "myapp-generated",
183183
"--c-namespace", "MyApp",

Formula/g/gnustep-base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ def install
8181
end
8282

8383
test do
84-
(testpath/"test.xml").write <<~EOS
84+
(testpath/"test.xml").write <<~XML
8585
<?xml version="1.0" encoding="UTF-8"?>
8686
<test>
8787
<text>I'm an XML document.</text>
8888
</test>
89-
EOS
89+
XML
9090

9191
assert_match "Validation failed: no DTD found", shell_output("#{bin}/xmlparse test.xml 2>&1")
9292
end

Formula/i/imposm3.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ def install
3030
end
3131

3232
test do
33-
(testpath/"sample.osm.xml").write <<~EOS
33+
(testpath/"sample.osm.xml").write <<~XML
3434
<?xml version='1.0' encoding='UTF-8'?>
3535
<osm version="0.6">
3636
<bounds minlat="51.498" minlon="7.579" maxlat="51.499" maxlon="7.58"/>
3737
</osm>
38-
EOS
38+
XML
3939

40-
(testpath/"mapping.yml").write <<~EOS
40+
(testpath/"mapping.yml").write <<~YAML
4141
tables:
4242
admin:
4343
columns:
@@ -57,7 +57,7 @@ def install
5757
boundary:
5858
- administrative
5959
type: polygon
60-
EOS
60+
YAML
6161

6262
assert_match version.to_s, shell_output("#{bin}/imposm version").chomp
6363

0 commit comments

Comments
 (0)