Skip to content

Instantly share code, notes, and snippets.

@trobrock
Created October 22, 2012 18:11
Show Gist options
  • Save trobrock/3933071 to your computer and use it in GitHub Desktop.
Save trobrock/3933071 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
wanting = ARGV[0]
role = wanting.scan(/[a-z]+/).first.to_sym
number = wanting.scan(/\d+/).first.to_i
ROLES = {}
def role(role, *hosts)
hosts.pop if hosts.last.is_a?(Hash)
ROLES[role] = hosts
end
def method_missing(meth, *args, &block)
end
load "config/deploy/production.rb"
p ROLES[role][number-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment