[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Trying to make modifications to a gem...

aldric[removeme]

12/20/2008 11:14:00 PM

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
4 Answers

Ryan Davis

12/21/2008 12:49:00 AM

0


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' ?

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.



aldric[removeme]

12/21/2008 1:13:00 AM

0

Ryan Davis wrote:
> 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' ?
>
> 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 ;-)
This being said, I'm going back to my original question.. :)

--Aldric

Sandor Szücs

1/4/2009 6:50:00 PM

0

Aldric,

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

> 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 =20=

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 =20=

not
allowed to upload the package so it's up to the author.

Hth. regards, Sandor Sz=FCcs
--


Phlip

1/4/2009 10:31:00 PM

0

>> 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!