Parser for .ug domains #35

Closed
wants to merge 5 commits into
from

Projects

None yet

2 participants

Hi Simone,

feel free to pull this (very basic) parser for .ug domains from me.

Thanks a lot for your work!

Moritz

Owner
weppos commented Sep 8, 2010

Hi Moritz,

I reviewed your parser and it looks very good!
There are a few changes I would ask you to apply before merging the patch into the master branch:

  1. created_on should return a Time instance. Please use
    DateTime.strptime($1, '%d/%m/%Y %H:%M:%S %Z').to_time
    to cast the value and update the test accordingly.

  2. Since this is not a full parser, please change the header from

    #
    # = whois.co.ug parser
    #
    # Parser for the whois.co.ug server.
    #
    

    to

    #
    # = whois.co.ug parser
    #
    # Parser for the whois.co.ug server.
    #
    # NOTE: This parser is just a stub and provides only a few basic methods
    # to check for domain availability and get domain status.
    # Please consider to contribute implementing missing methods.
    # See WhoisNicIt parser for an explanation of all available methods
    # and examples.
    #
    

Thanks for your contribution!

Hey Simone,

thanks for the quick response! I used DateTime in this particular case because the time is in the EAT zone. The to_time method only considers UTC time objects. I didn't find a quick way to do the conversoin without pulling in tzinfo or the like. Any suggestions?

I'll incorporate the note in a minute!

Moritz

Owner
weppos commented Sep 8, 2010

Unfortunately this is a known issue.

Currently, parsers are not timezone-aware. In fact, most registries don't include timezone information and Ruby 1.8 is not very good at converting DateTime to Time and viceversa.

I'm still trying to understand whether:

  • add tzinfo (optional or required) dependency
  • drop support for Ruby < 1.9

This is something we certainly need to address, but in the meantime I prefer to consistently return a Time instance as long as we don't find a working solution for all the parsers with the price of loosing TimeZone information.

Of course, I'm open to suggestions.

I don't really know how to handle this elegantly as well. Another option would be to pull in ActiveSupport and rely on its abstraction over the various solutions. Then again, I'm not really fond of how timezones are handled by it. This is really a can of worms! :-)

Owner
weppos commented Sep 8, 2010

I will look into that ASAP. In the meantime, I'm going to merge your changes.
Thank you very much, Moritz.

Owner
weppos commented Sep 8, 2010

Parser for .ug domains (closed by eef4e6c138700eb966f80b22d2d251c71355e5ac)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment