Gistr is a super simple Ruby plugin that extends your Rails or Sinatra application to make use of GitHub’s awesome Gist service (gist.github.com).
Currently this plugin is incredibly simple and only allows you to embed Gists in your views.
Installation:
a) gem sources -a gems.github.com (you only have to do this once) b) sudo gem install mattapayne-gistr
Usage:
Sinatra:
After requiring Sinatra, require ‘gistr’ View helper methods are added to Sinatra’s helpers
Rails:
Add config.gem ‘mattapayne-gistr’, :source => ‘gems.github.com’, :lib => “gistr”
to your environment.rb file.
View Helper methods are added to ActionView
For Views in Both:
<%= gist(12345) -%>