diff --git a/lib/print_json_response.rb b/lib/print_json_response.rb index 2467ff2..81d45c5 100644 --- a/lib/print_json_response.rb +++ b/lib/print_json_response.rb @@ -108,13 +108,6 @@ def diff results system "diff #{@diff_opts} #{tempfiles.map { |io| io.path}.join ' '}" end - def irb json - require 'irb' - @response = json - puts "JSON response is in @response" - IRB.start - end - def fetch url $stderr.puts "Retrieving #{url}:" if $stdout.tty? @@ -124,6 +117,13 @@ def fetch url json = @path.inject json do |data, item| data[item] end end + def irb json + require 'irb' + @response = json + puts "JSON response is in @response" + IRB.start + end + def run results = @urls.map do |url| fetch url