Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Don`t work with "http://google.co.jp"
Don't work!
Try - domain_name("www.xakep.ru")
Traceback (most recent call last):
1: from main.rb:5:in
<main>' main.rb:2:in
domain_name': undefined method `split' for nil:NilClass (NoMethodError)It got marked as Best Practices, but here the idea is to solve it yourself instead of using libraries...
This is great. I didn't know about URI.parse or that #last could take an argument! Thanks
You really need a better definition of "domain name" for that case. When the entire specification is a set of test cases, everything else is undefined behavior.
I like this one-line solution. I find this olution clever, but not a best practice.
With http://www.zombie-bites.com.cn don't work
Im getting better, I did the same!
Thanks. Reading about it now.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Can someone explain this solution to me? My solution is fine, but could use some refactoring, so I was wondering how this solution works - particularly how the regexp works here. Thanks.
Thanks AJFarmer for the heads up.
Not really, just simpler to read and write.
This comment is hidden because it contains spoiler information about the solution