Sha256: d998a093f88c6f71d0fd0db19b6dbded65da5d6fac8f511c6e1167cead2ccc26

Contents?: true

Size: 430 Bytes

Versions: 1

Compression:

Stored size: 430 Bytes

Contents

module Firewall
  module UrlProtectionsHelper

    class << self
      def protected_urls
        regex = /\d+\s+ACCEPT.*?dpt:80 STRING match  "(.*?)" ALGO/
        rules = IptablesHelper.show_rules.split(/\n/)

        protected_urls = []
        rules.each{ |line|
          match = regex.match(line)
          protected_urls.push(match[1]) unless match.nil?
        }

        return protected_urls
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
firewall-0.0.3 app/helpers/firewall/url_protections_helper.rb