motdotla / digitalocean

The easiest and most complete rubygem for DigitalOcean.
http://rubygems.org/gems/digitalocean
MIT License
153 stars 42 forks source link

Beginning of rewriting tests and code to compare against a string instea... #9

Closed motdotla closed 10 years ago

motdotla commented 10 years ago

...d of actually ping the servers. Trust that if the url is written correctly then the method will work

motdotla commented 10 years ago

There's some discrepancies in how url query params are handled in our ruby methods. I'm going to clean those up too:

For example, Domain.create uses standard ruby method arguments:

https://github.com/scottmotte/digitalocean/blob/master/lib/digitalocean/domain.rb#L20

But, SshKey.create uses a hash of attributes passed:

https://github.com/scottmotte/digitalocean/blob/master/lib/digitalocean/ssh_key.rb#L16

I'm leaning towards the hash approach for query parameters and the standard arguments for url params.

motdotla commented 10 years ago

Ok, this is pretty much ready to go.

Significant changes.

All specs now run without needing to ping Digital Ocean.

Still needs at least one 'sanity check' spec that hits the DigitalOcean API.

Most significantly, most of the code is metaprogramming now - taking the definitions from digitalocean.com/api and converting them into ruby methods.

This is going to be 1.0.0 release, but start as a RC for a while.