0.0
No commit activity in last 3 years
No release in over 3 years
A simple helper for picking up pastie or gist urls and displaying them properly in a block of text for Ruby and Rails apps
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Pastie Parser

Pastie parser is exactly what is says it parses links for Pasties (http://pastie.org) and Gists (http://gists.github.com) and displays them properly on your web page.

Installation

Nice and simple, in your Gemfile add:

gem 'pastie_parser'

Run the bundle command and you're good to go.

If you're using this gem outside of a rails application or are simply refusing to use Bundler do the following:

gem install pastie_parser

Usage

Once Pastie Parser is installed you'll want to get using it, well this couldn't be simpler just do the following in your code:

<%= raw(PastieParser::Parse.pastie_parser(@article.body)) %>

Now if you have a Pastie or Gist you would like to be displayed in your text simply add the url (from the address bar) to either the Pastie or the Gist (depending on which you prefer to use) to your text and they will magically appear on the page.

What should the URLS look like?

For pastie: http://pastie.org/3288805 For Gist: https://gist.github.com/706753

If when using this gem you find any problems please raise it as an issue on here so I can fix it.

Thanks.