Skip to content

Instantly share code, notes, and snippets.

@jjhop
Created August 10, 2023 00:32
Show Gist options
  • Save jjhop/927a1ab4526d64d7beb455b2691c53d6 to your computer and use it in GitHub Desktop.
Save jjhop/927a1ab4526d64d7beb455b2691c53d6 to your computer and use it in GitHub Desktop.
Set<String> calledMethods = new Hashset<>()
new File(baseDir,"haiku.txt").withReader { reader ->
while (reader.readLine()) {
if (line.contains(') >>>>')) {
String[] splittedLine = line.split('>>>>', 2)
String l = splittedLine[0]
String rest = l.substring(l.indexOf('#'))
calledMethods.add(rest)
}
}
}
new File(baseDir,'haiku.txt').withWriter('utf-8') { writer ->
calledMethods.toList().sort().each { it ->
writer.write(it)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment