Method: HookApp#browse_linked

Defined in:
lib/hook/hookapp.rb

#browse_linked(url) ⇒ Object

Select from a menu of available hooks and open using macOS open.



344
345
346
347
348
349
350
351
352
353
354
# File 'lib/hook/hookapp.rb', line 344

def browse_linked(url)
  marks = get_hooks(url)
  if marks.empty?
    warn "No hooks found for #{url}"
  else
    res = select_hook(marks)
    unless res.empty?
      res.each { |mark| mark[:path] ? act_on(mark[:path]) : `open '#{mark[:url]}'` }
    end
  end
end