Skip to content

Instantly share code, notes, and snippets.

@jasonnoble
Forked from spilth/install_dash_gem_docs.rb
Last active December 26, 2021 03:42
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jasonnoble/db2317bf81421708a6766d4d9618c9c8 to your computer and use it in GitHub Desktop.
Save jasonnoble/db2317bf81421708a6766d4d9618c9c8 to your computer and use it in GitHub Desktop.
Installs the Dash docs for all the Ruby Gems in your Gemfile
#!/usr/bin/env ruby
#
# Prerequisites:
# gem install bundler
# bundle install
dependencies = `bundle show | grep '*' | awk '{print $2, $3}' | sed -e 's/(//' -e 's/)//'`.split("\n")
dependencies.each do |dependency|
(gem_name, version) = dependency.split
next if gem_name =~ /rails-assets/
puts "Installing docs for #{gem_name} #{version} "
system "open 'dash-install://repo_name=Ruby Docsets&entry_name=#{gem_name}&version=#{version}'"
end
@rclavel
Copy link

rclavel commented Apr 26, 2018

Very useful, thanks :)
I have added a sleep 3 after each system call, otherwise it stops after one or two installs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment