Trying to make modifications to a gem

I'm toying around with a gem. How can I easily make changes and test
them? What I've done is copy the directory with the gem files inside to
another folder within the 'gems' subdirectory and made my changes in
there (renamed it from gemname-0.3 to gemname-0.4). I was hoping it
would be enough but it isn't.
Do I have to re-package it as a gem and reinstall the gem every time I
make a change ? Is there an easy solution?
Just in case it matters, the gem is written in ruby, it's a bunch of
'Ruby files that are all 'required' by the main gem file.
Maybe what I need is 'Ruby gems for dummies' ?

Thanks,

--Aldric

it'd be a lot nicer for everyone (assuming your changes are for good, not for evil) if you submitted your changes back to the author.

···

On Dec 20, 2008, at 15:06 , Aldric Giacomoni wrote:

I'm toying around with a gem. How can I easily make changes and test
them? What I've done is copy the directory with the gem files inside to
another folder within the 'gems' subdirectory and made my changes in
there (renamed it from gemname-0.3 to gemname-0.4). I was hoping it
would be enough but it isn't.
Do I have to re-package it as a gem and reinstall the gem every time I
make a change ? Is there an easy solution?
Just in case it matters, the gem is written in ruby, it's a bunch of
'Ruby files that are all 'required' by the main gem file.
Maybe what I need is 'Ruby gems for dummies' ?

Aldric,

I'm toying around with a gem. How can I easily make changes and test
them?

often a rubygem has a structure like:

mygem/Rakefile
mygem/bin
mygem/lib
mygem/test

If you are in the folder mygem, then try `rake -T' to get a list what rake
can do for you.
Normally there are "rake test" or "rake spec" for testing.
If you change the code then run the test suite and send patchfiles to
the author.

Do I have to re-package it as a gem and reinstall the gem every time I
make a change ?

In my opinion it's up to the author to package the gem. Also you are not
allowed to upload the package so it's up to the author.

Hth. regards, Sandor Szücs

···

On 21.12.2008, at 00:06, Aldric Giacomoni wrote:
--

Ryan Davis wrote:

I'm toying around with a gem. How can I easily make changes and test
them? What I've done is copy the directory with the gem files inside
to
another folder within the 'gems' subdirectory and made my changes in
there (renamed it from gemname-0.3 to gemname-0.4). I was hoping it
would be enough but it isn't.
Do I have to re-package it as a gem and reinstall the gem every time I
make a change ? Is there an easy solution?
Just in case it matters, the gem is written in ruby, it's a bunch of
'Ruby files that are all 'required' by the main gem file.
Maybe what I need is 'Ruby gems for dummies' ?

it'd be a lot nicer for everyone (assuming your changes are for good,
not for evil) if you submitted your changes back to the author.

I will - I am talking with the author via e-mail - but this is also my
first attempt at making a big class and changing a gem.. So I want to
know how to test it. I'm only been using Ruby for 2 months or so and
don't know much about gem-making and gem-modifying.. I'd probably die of
shame if I told the author "Hey, I made changes to your gems, here's
what I did" and then it's all broken because the code is retarded. I'd
like to submit something that works :wink:
This being said, I'm going back to my original question.. :slight_smile:

--Aldric

···

On Dec 20, 2008, at 15:06 , Aldric Giacomoni wrote:

Do I have to re-package it as a gem and reinstall the gem every time I
make a change ?

In my opinion it's up to the author to package the gem. Also you are not
allowed to upload the package so it's up to the author.

Monkey patch the gem. Happens all the time.

And put unit tests on your patch, and other gem qualities, so when you upgrade it you might get an early warning if your patch broke.

And submit the patch to the gem author!