Skip to content

Commit 4e0dc1a

Browse files
committed
GROOVY-11791: Support unquoted URLs in groovysh (add example in doco)
1 parent cfe5dca commit 4e0dc1a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
123 KB
Loading

subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,12 +992,17 @@ various formats like XML, JSON, YAML, etc. You can use those in your code
992992
if you like, but the `/slurp` command can be a convenience shortcut.
993993
It supports most of the common formats, including JSON, XML, YAML, CSV, TOML and property files.
994994
995-
image:{reldir_groovysh}/assets/img/repl_slurp.png[Usage of the /slurp command, width=75%]
995+
image:{reldir_groovysh}/assets/img/repl_slurp.png[Usage of the /slurp command, width=80%]
996996
997997
As you can see in the usage information at the end of the above image,
998998
you can also provide an encoding and a format. If no format is given,
999999
`UTF_8` is the default. If no format is given, the shell will try to
10001000
determine the format from the extension of the file (if given).
1001+
If no format or file extension is given, the `/slurp` command makes
1002+
a rudimentary attempt to determine the format by looking at the content,
1003+
e.g. the json format is determined in the following example:
1004+
1005+
image:{reldir_groovysh}/assets/img/repl_slurp_url.png[Usage of the /slurp command with a URL, width=75%]
10011006
10021007
Although the details of the exact object returned are an implementation
10031008
detail which may change in the future, the current behavior is as follows:

0 commit comments

Comments
 (0)