We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have created a class returning the file and the first changed line based on git. I want to launch the test of the file at only this line.
class GitModifiedMatcher class MyMatchData def initialize(result) @result = result end def to_a @result.values end def [](name) @result[name] end end def match(file) diff = `git diff --no-ext-diff --unified=0 --exit-code -a --no-prefix #{file}` modified_lines = diff.to_enum(:scan, /^@@ -\d+,?.* [+](\d+),?.* @@.*/).map { Regexp.last_match(1) } MyMatchData.new(file: file, lines: modified_lines.first) end end
So in my Guardfile I am able to do something like this (notice the m[:file] and m[:line]) :
m[:file]
m[:line]
guard :minitest, all_on_start: false do watch(GitModifiedMatcher.new) { |m| "#{m[:file]} --line #{m[:line]}" } end
I could not find a way to make it. Anyone can help ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have created a class returning the file and the first changed line based on git. I want to launch the test of the file at only this line.
So in my Guardfile I am able to do something like this (notice the
m[:file]
andm[:line]
) :I could not find a way to make it. Anyone can help ?
The text was updated successfully, but these errors were encountered: