Skip to content

Instantly share code, notes, and snippets.

@epitron
Created April 18, 2011 18:06
Show Gist options
  • Save epitron/925824 to your computer and use it in GitHub Desktop.
Save epitron/925824 to your computer and use it in GitHub Desktop.
command "require", "Require gem(s)" do |*gems|
gems = gems.join(' ').gsub(',', '').split(/\s+/)
gems.each do |gem|
begin
if require gem
output.puts "#{gem.yellow} loaded"
else
output.puts "#{gem.white} already loaded"
end
rescue LoadError => e
output.puts "#{gem.red} not found"
# TODO: Prompt to install the gem!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment