Reputation: 19151
Recently I started using a gem called blackbook. The gem has a few issues that I would like to fix. I cloned the git repo and installed the gem locally, hoping I could mess with the source code. When I edit the source code nothing happens, so now I am thinking that I must rebuild the gem every time I make a change.
My question is this: Should I be able to edit the source code of the gem and see results immediately, or should I use the source code as a plugin to my rails app, and then rebuild the gem only when I have made significant progress?
Thank you,
Tony
Upvotes: 3
Views: 1345
Reputation: 31
I use this rake task to make keeping my gem up to date while working on it. It uses a version number stored in a file at the root named 'VERSION'
desc "Build and install homer gem"
task :update do
version = File.open('VERSION') { |f| f.read }.to_s
`gem build homer.gemspec`
`gem install ./homer-#{version}.gem`
end
and in the gem spec:
s.version = File.open('VERSION') { |f| f.read }.to_s
Upvotes: 2
Reputation: 21950
You can mess with the source code of the installed gem to change the behavior of what you have installed. But unless you are playing path games this won't affect the gem itself even if you rebuild.
What I generally do is this:
Also, if you are using git hub they should automatically rebuild the gem for you every time you push a commit with an updated gemspec (e.g., you've changed the version number).
Upvotes: 1