lib/hook/hookapp.rb
# Delete all hooked files/urls from target file
Delete all hooked files/urls from target file
Delete all hooked files / urls from target file
def delete_all_hooks(url, force: false)
    unless force
      STDERR.print "Are you sure you want to delete ALL hooks from #{url} (y/N)? "
      res = STDIN.gets.strip
    end
    if res =~ /^y/i || force
      get_hooks(url).each do |hook|
        `osascript <<'APPLESCRIPT'
          tell application "Hook"
            set _mark1 to make bookmark with data "#{hook[:url]}"
            set _mark2 to make bookmark with data "#{url}"
            unhook _mark1 and _mark2
            return true
          end tell
        APPLESCRIPT`
      end
      "Removed all hooks from #{url}"
    end
  end
def delete_all_hooks ( url , force : false ) unless force STDERR . print "Are you sure you want to delete ALL hooks from #{url} (y/N)? " res = STDIN . gets . strip end if res =~ / ^y /i || force get_hooks ( url ) . each do | hook | ` osascript <<'APPLESCRIPT'
          tell application "Hook"
            set _mark1 to make bookmark with data " #{ hook [ :url ] } "
            set _mark2 to make bookmark with data " #{ url } "
            unhook _mark1 and _mark2
            return true
          end tell
        APPLESCRIPT ` end "Removed all hooks from #{url}" end end
Delete all hooked files/urls from target file
Delete all hooked files / urls from target file
url
<not_specific>
force
<not_specific>