Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a TLD subfolder when using mkwhois #3

merged 1 commit into from Dec 3, 2015
Changes from all commits
File filter

Filter by extension

Filter by extension

Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion utils/mkwhois.rb
Expand Up @@ -13,9 +13,10 @@
n = ARGV.shift || raise("Missing file name")

r = Whois.lookup(d)
tld = r.server.allocation[1..-1] do |part|
target = File.expand_path("../../spec/fixtures/responses/#{}/#{n}.txt", __FILE__)
target = File.expand_path("../../spec/fixtures/responses/#{}/#{tld}/#{n}.txt", __FILE__)
FileUtils.mkdir_p(File.dirname(target)), "w+") { |f| f.write(part.body) }
puts "#{target}"
Expand Down