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
merged 1 commit into from Dec 3, 2015
Jump to file or symbol
Failed to load files and symbols.
+2 −1
Diff settings

Always

Just for now

Copy path View file
@@ -13,9 +13,10 @@
n = ARGV.shift || raise("Missing file name")

r = Whois.lookup(d)
tld = r.server.allocation[1..-1]

r.parts.each do |part|
target = File.expand_path("../../spec/fixtures/responses/#{part.host}/#{n}.txt", __FILE__)
target = File.expand_path("../../spec/fixtures/responses/#{part.host}/#{tld}/#{n}.txt", __FILE__)
FileUtils.mkdir_p(File.dirname(target))
File.open(target, "w+") { |f| f.write(part.body) }
puts "#{target}"
ProTip! Use n and p to navigate between commits in a pull request.