From Guardfile examples:
watch(%r{^app/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
What do the values of m represent? It seems to be an array of length 2, storing the complete path and relative path…
How is m generated? Is it coming from Guard or Ruby?
m[1]would be the first capture group in the regex match. And from the regex, that is the name of the file ( without the extension.)This is actually explained in the README: