3

I'm starting a project where I will work with the base Gollum wiki gem, and add some features to it. I was wondering what is the best way to do this.

Do I need to build and install the gem everytime I need to test it? Is there a way to edit the source code of the gem and test it on-the-fly? I'm only a beginner at this, so sorry if this is a silly question!

user1025725
  • 147
  • 1
  • 2
  • 8

2 Answers2

2
  • Clone the git into your userspace;
  • Checkout the source code somewhere into your Projects directory;
  • Put in your main projects Gemfile the following:

(instead of :git => ...)

#                  V  VERSION IS HERE
gem 'gollum', '~> XXX', :path => '/home/Projects/gollum'

Run bundle update in your main project directory each time you changed smth in gollum. Don’t forget to commit changes to github into your gollum fork and point gem instruction to it into Gemfile before uploading.

Hope it helps.

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
0

There a couple different things you can do in this situation if you are using bundler. First, you could simply edit the gem locally. Running bundle show gollum will show you the directory in which the gem is installed and you can simply edit it and the changes will appear in your application. In the end, you will need to either fork the gem and use your own version in your Gemfile. Documentation on using a custom git repository can be found here: http://bundler.io/git.html

Also in that documentation is how to set up a local git repository. If you plan on having a separate gollum repository and pushing it our, you will probably want to work with a local copy. Rather than simply pointing to a separate directory on the filesystem, it is useful to use bundler's "Local Git Repos" feature, which is also documented in the link above.

Either way, once you are ready to push out your code, you will want to point your code to the remote repository so you can actually deploy it.

sonnym
  • 76
  • 2