I am trying to create a program using ruby and guard to watch .rb files in a directory for changes, then on change I would like to run a set of Rspec specs and capture the results of the specs.
I have it set up to watch the appropriate files, run the specs, and output the spec results as a json string into the guard terminal. How can I capture that json string to analyze in another ruby file?
Guardfile:
guard :rspec, :cli => "--format json" do
watch(%r{^*\.rb}) { "spec" }
end
command < the_file. - FluffyJack