ryanprayogo
ryanprayogo

Reputation: 11817

How to use a modified third-party library in a Rails project?

Some background:

Currently, I'm using the Coderay gem (v 0.9.7) in a Rails project that I'm working on.

I downloaded the source code for that version and applied a patch for a functionality that the Coderay team is planning to release in later version.

Questions are:

  1. How do I use this modified code in my project?

  2. I'm using Heroku for the live site. How do I use the modified code in the live site since now I'm not using the official gem?

Upvotes: 3

Views: 217

Answers (1)

jdl
jdl

Reputation: 17790

You have a couple of options.

1. Custom gem

You could stick your modified gem source up on github, and then tell Bundler to use your code.

In Gemfile:

gem 'coderay', :git => 'git://github.com/ryanprayogo/coderay.git'

(Or whatever the actual path ends up being.)

2. Evil twin

The other option would be to do an Evil Twin in your vendor directory. It's something like a pattern for hacks that you want to keep separate from your library code.

http://errtheblog.com/posts/67-evil-twin-plugin

Upvotes: 5

Related Questions