Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created March 13, 2013 21:25
Show Gist options
  • Select an option

  • Save AndrewVos/5156445 to your computer and use it in GitHub Desktop.

Select an option

Save AndrewVos/5156445 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
if name = ARGV.first
path = `gem which #{name}`
readme = Dir.glob(File.join(File.dirname(path), "../", "README.{md,markdown}")).first
fail "Failed to find readme for gem '#{name}'" unless File.exist?(readme)
puts File.read(readme)
else
puts "Usage: gem-man gem_name"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment