Skip to content

Idea: file.before command with match: kwarg #121

Description

@schneems

Right now file.append can take in a line number, but this is brittle. Instead if would be nice if we could match on a placeholder comment and have rundoc figure out the line for us like:

:::>> file.before("src/main/java/com/heroku/java/GettingStartedApplication.java", match: "// Add new endpoints here")
@GetMapping("/convert")
String convert(Map<String, Object> model) {
    RelativisticModel.select();
    var energy = Amount.valueOf("12 GeV");

    model.put("result", "E=mc^2: " + energy + " = " + energy.to(SI.KILOGRAM));
    return "convert";
}

Can expand file.append to take the same kwarg.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions