motdotla / digitalocean

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

Add destroy #25

Closed snyff closed 10 years ago

kfatehi commented 10 years ago
Digitalocean.client_id = ENV['DIGITALOCEAN_CLIENT_ID']
Digitalocean.api_key = ENV['DIGITALOCEAN_API_KEY']

Digitalocean::SshKey.singleton_class.send(:define_method, :destroy, -> (id) {
  url = "https://api.digitalocean.com/v1/ssh_keys/#{id}/destroy/?client_id=#{Digitalocean.client_id}&api_key=#{Digitalocean.api_key}"
  res = Net::HTTP.get(URI(url))
  RecursiveOpenStruct.new(JSON.parse(res))
})
arthurnn commented 10 years ago

26 commit, needs to be in this PR, so we can merge spec + feature together.

thanks

snyff commented 10 years ago

Yeah, I tried with github' web interface, couldn't find it :/

arthurnn commented 10 years ago

You actually cannot do this on github interface. What you need to do, is have both commits in the same branch as the branch that the PR points to. in this case patch-3

snyff commented 10 years ago

Done :) Closing this one now