This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 4e0dc1a180 GROOVY-11791: Support unquoted URLs in groovysh (add
example in doco)
4e0dc1a180 is described below
commit 4e0dc1a180e2d37464ff17bd3375a08a1607e3d6
Author: Paul King <[email protected]>
AuthorDate: Fri Oct 24 22:36:43 2025 +1000
GROOVY-11791: Support unquoted URLs in groovysh (add example in doco)
---
.../src/spec/doc/assets/img/repl_slurp_url.png | Bin 0 -> 126291 bytes
subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc | 7 ++++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git
a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_slurp_url.png
b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_slurp_url.png
new file mode 100644
index 0000000000..749ab7a864
Binary files /dev/null and
b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_slurp_url.png differ
diff --git a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
index 081dbbe6dc..2437510f34 100644
--- a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
+++ b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
@@ -992,12 +992,17 @@ various formats like XML, JSON, YAML, etc. You can use
those in your code
if you like, but the `/slurp` command can be a convenience shortcut.
It supports most of the common formats, including JSON, XML, YAML, CSV, TOML
and property files.
-image:{reldir_groovysh}/assets/img/repl_slurp.png[Usage of the /slurp command,
width=75%]
+image:{reldir_groovysh}/assets/img/repl_slurp.png[Usage of the /slurp command,
width=80%]
As you can see in the usage information at the end of the above image,
you can also provide an encoding and a format. If no format is given,
`UTF_8` is the default. If no format is given, the shell will try to
determine the format from the extension of the file (if given).
+If no format or file extension is given, the `/slurp` command makes
+a rudimentary attempt to determine the format by looking at the content,
+e.g. the json format is determined in the following example:
+
+image:{reldir_groovysh}/assets/img/repl_slurp_url.png[Usage of the /slurp
command with a URL, width=75%]
Although the details of the exact object returned are an implementation
detail which may change in the future, the current behavior is as follows: