Sha256: 78a39c8fbd8b370b466592cc428636ce41939f59832d13829037f74d775dc837

Contents?: true

Size: 462 Bytes

Versions: 123

Compression:

Stored size: 462 Bytes

Contents

require 'uri'
require 'set'

class OutboundHosts
  def self.list    
    uris = Set.new

    Dir['lib/**/*.rb'].each do |file|
      content = File.read(file)

      content.each_line do |line|
        next if line =~ /homepage_url/
    
        if line =~ /("|')(https:\/\/.*)("|')/
          uri = URI.parse($2)
          uris << [uri.host, uri.port]
        end
      end
    end

    uris.each do |uri|
      puts "#{uri.first} #{uri.last}"
    end
  end
end

Version data entries

123 entries across 123 versions & 20 rubygems

Version Path
activemerchant-1.33.0 lib/support/outbound_hosts.rb
activemerchant-1.32.1 lib/support/outbound_hosts.rb
activemerchant-1.32.0 lib/support/outbound_hosts.rb
activemerchant-1.31.1 lib/support/outbound_hosts.rb
activemerchant-1.31.0 lib/support/outbound_hosts.rb
activemerchant-1.30.0 lib/support/outbound_hosts.rb
jelaniharris-activemerchant-1.29.2 lib/support/outbound_hosts.rb
activemerchant-1.29.3 lib/support/outbound_hosts.rb
activemerchant-1.29.2 lib/support/outbound_hosts.rb
activemerchant-1.29.1 lib/support/outbound_hosts.rb
jelaniharris-activemerchant-1.29.1 lib/support/outbound_hosts.rb
activemerchant-1.29.0 lib/support/outbound_hosts.rb
activemerchant-nsp-1.27.0 lib/support/outbound_hosts.rb
activemerchant-1.28.0 lib/support/outbound_hosts.rb
yetanothernguyen-activemerchant-1.21.2 lib/support/outbound_hosts.rb
activemerchant-1.27.0 lib/support/outbound_hosts.rb
yetanothernguyen-activemerchant-1.21.1 lib/support/outbound_hosts.rb
activemerchant-1.26.0 lib/support/outbound_hosts.rb
activemerchant-1.25.0 lib/support/outbound_hosts.rb
jelaniharris-activemerchant-1.24.1 lib/support/outbound_hosts.rb