public static ResourceRef stringToResourceRef(String resource, String scriptText) throws IOException {
		ResourceRef result;
		String urlHash = Util.getStableID(scriptText);
		Path cache = Settings.getCacheDir(Cache.CacheClass.stdins).resolve(urlHash);
		cache.toFile().mkdirs();
		String basename = urlHash;
		String suffix = ".jsh";
		if (hasMainMethod(scriptText)) {
			suffix = ".java";
			basename = getMainClass(scriptText).orElse(basename);
		}
		Path scriptFile = cache.resolve(basename + suffix);
		Util.writeString(scriptFile, scriptText);
		result = ResourceRef.forResolvedResource(resource, scriptFile);
		return result;
	}
A <code>ResourceResolver</code> that, when given "-" as a resource string,
will try to create a copy in the cache with a proper file name and return a
reference to that file.
src/main/java/dev/jbang/source/resolvers/LiteralScriptResourceResolver.java