Sign in to PrePAN



GitHub: ferki PAUSE ID: FERKI

User's Modules

Rex::Hook::File::Diff Show diff of file changes during a Rex run

The linked gist is the initial draft of a module that allows Rex to show diffs on the terminal upon file changes during task execution. I'm posting it here both for early availability and early feedback.

I think it is a good example of how to extend Rex without changing the core, and publishing on CPAN would be a great way to share.

Additional features could include colored output support, and pluggable diff backends (like Text::Diff::Unified::XS, or even using diff binary, if present).

The name is following this logic: it extends Rex via a Hook for File operations to show the Diff of changes. It could be more specific (e.g. Rex::Hook::File::Diff::Unified), but I feel it's already getting long, so I tried to find a good balance.

Some questions I am wondering about:

  • is there a better fit for the name?
  • would it be possible/easy to merge this into Rex core distribution later (which already has Rex::Hook)?
  • is there a better approach to generate diffs?

Feedback welcome both here and on the gist.

ferki@github 1 comment