Skip to content

Commit

Permalink
Merge pull request #4 from lgromanowski/fix_for_passing_data_to_gocmdpev
Browse files Browse the repository at this point in the history
Fix for passing data to gocmdpev
  • Loading branch information
bradurani authored Oct 12, 2018
2 parents 4b0886b + 1240e21 commit 1c8b473
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/eyeballs/inspector.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'tempfile'

module Eyeballs
class Inspector

Expand Down Expand Up @@ -51,7 +53,15 @@ def log_json(options: OPTIONS)

def gocmdpev
to_hash_array.each do |h|
system("echo '#{h.to_json}' | gocmdpev")
begin
tmp = Tempfile.new('pg-eyeballs')
tmp.write(h.to_json)
tmp.close
system("cat #{tmp.path} | gocmdpev")
ensure
tmp.close
tmp.unlink
end
end
nil
end
Expand Down

0 comments on commit 1c8b473

Please sign in to comment.