Main
Main copied to clipboard
Centification of tail
Consider the case of a function
private static String runScript(final String pathname) throws IOException {
final ProcessBuilder builder = new ProcessBuilder("/bin/bash");
builder.command(script, pathname);
builder.redirectErrorStream(true);
final Process process = builder.start();
final InputStream stdout = process.getInputStream();
final BufferedReader reader = new BufferedReader(new InputStreamReader(stdout));
String line;
for (final StringBuffer $ = new StringBuffer();; $.append(line))
if ((line = reader.readLine()) == null)
return $ + "";
}
looking at it tail, we see that it appropriate for centification. The name line doesn't really matter, so we want a centification tipper to convert it into
private static String runScript(final String pathname) throws IOException {
final ProcessBuilder builder = new ProcessBuilder("/bin/bash");
builder.command(script, pathname);
builder.redirectErrorStream(true);
final Process process = builder.start();
final InputStream stdout = process.getInputStream();
final BufferedReader reader = new BufferedReader(new InputStreamReader(stdout));
String ¢;
for (final StringBuffer $ = new StringBuffer();; $.append(¢))
if ((¢ = reader.readLine()) == null)
return $ + "";
}
Of course a #255 can do more now...
@dormaayan
Can you work on this?
@yossigil , Sure I'll do that !
And, if you are at it, you will probably need to fix certification bugs when a cent is defined at a more global context.