Running patched rails

Hi,

Does anyone have any tips for running a patched version of rails? I am
currently running rails 1.2.2 and would like to keep up to date with any
future releases. I also want to run with the following patch:

http://dev.rubyonrails.org/ticket/5748

I am unsure how to manage this. Is this something SVN or rake can
handle?

Any tips/pointers would be very much appreciated.

Thanks,
GiantCranes

Giant C. wrote:

Hi,

Does anyone have any tips for running a patched version of rails? I am
currently running rails 1.2.2 and would like to keep up to date with any
future releases. I also want to run with the following patch:

http://dev.rubyonrails.org/ticket/5748

I am unsure how to manage this. Is this something SVN or rake can
handle?

Any tips/pointers would be very much appreciated.

Thanks,
GiantCranes

running ‘rake rails:freeze:edge’ will give you a fresh copy of edge
rails any time you like. You can then apply any patches to the
vendor/rails directory.

Alan

Hi !

2007/2/7, Giant C. [email protected]:

I am unsure how to manage this. Is this something SVN or rake can
handle?

You have a few options. svk, piston are good for that. Personally, I
use piston (which I wrote for this express purpose):
http://piston.rubyforge.org/

I also pistoned all my plugins, which makes updates much faster as a
side-effect.

Bye !

François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/

On 7-Feb-07, at 2:13 PM, Francois B. wrote:

I also pistoned all my plugins, which makes updates much faster as a
side-effect.

Bye !

François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/

a hearty second for piston - I’ve just pistoned rails for a customer
release. Very nice when you want to modify without svn commit access

  • when patches comes slowly, etc.

François, I only have one need that I can’t seem to figure out - I
wanted to recently make a rails patch from a pistoned install - could
you build in support for piston to diff across repositories? Or any
other ways (other than a separate svn co, and an OS diff)?

Cheers,
Jodi
General Partner
The nNovation Group inc.
www.nnovation.ca/blog

On 7-Feb-07, at 8:30 PM, Francois B. wrote:

Not a bad idea. Piston is going to look more and more like SVK…

Bye !

By upstream, I suppose you’re referring to the original repo?

If so, then I want to piston import, make local changes, commit my
changes to my repos, then diff versus the original (upstream) repo.

does this make sense?

Jodi

Hi !

2007/2/7, Jodi S. [email protected]:

François, I only have one need that I can’t seem to figure out - I
wanted to recently make a rails patch from a pistoned install - could
you build in support for piston to diff across repositories? Or any
other ways (other than a separate svn co, and an OS diff)?

You mean, like piston diff that makes a diff of things you did as
opposed to what the upstream repository did ?

Not a bad idea. Piston is going to look more and more like SVK…

Bye !

François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/

Hi !

2007/2/7, Jodi S. [email protected]:

By upstream, I suppose you’re referring to the original repo?

Yes.

If so, then I want to piston import, make local changes, commit my
changes to my repos, then diff versus the original (upstream) repo.

does this make sense?

You can already do so, except it’s not automated.

svn diff -r X:Y gets the changes between two revisions. If you know
the revisions at which you imported / updated, you can do diffs and
know exactly what you changed.

Hope that helps !

François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/

On 7-Feb-07, at 11:47 PM, Francois B. wrote:

does this make sense?

You can already do so, except it’s not automated.

svn diff -r X:Y gets the changes between two revisions. If you know
the revisions at which you imported / updated, you can do diffs and
know exactly what you changed.

Hope that helps !

Thanx François.

I’ve had problems with piston convert, ended up piston importing
instead, then proplists don’t look right and diffs don’t work
(everything ellse does).

do you have a mailing list, or can I email my questions directly?

Hi,

Does anyone have any tips for running a patched version of rails? I am
currently running rails 1.2.2 and would like to keep up to date with any
future releases. I also want to run with the following patch:

http://dev.rubyonrails.org/ticket/5748

I am unsure how to manage this. Is this something SVN or rake can
handle?

If the patch is not too complex you can also apply it as a monkey-
patch. This is quite simple, just create a ruby-file inside lib with
a class in there of the same name, and inside the same modules as
the rails-class. Then add changed versions of all the functions you
want changed.

Require this file at the end of your environment.rb, and you’re done.

I myself make use of this method quite extensively, but of course you
shouldn’t over-do it and of course try to get improvements and fixes
that everyone would enjoy into the rails-trunk.

Wybo

::student:

::Free Software and Open Source Developer:

  • http://www.LogiLogi.org, Cumulative, shared commenting, publication
    and
    idea sharing: Where insight comes together…
  • ComLinToo, a computational linguistics toolset written in Perl
  • Lake (LogiLogi.org Make), a make-replacement using makefiles in pure
    C++

::Being:

Wybo W. wrote:

Hi,

Does anyone have any tips for running a patched version of rails? I am
currently running rails 1.2.2 and would like to keep up to date with any
future releases. I also want to run with the following patch:

http://dev.rubyonrails.org/ticket/5748

I am unsure how to manage this. Is this something SVN or rake can
handle?

If the patch is not too complex you can also apply it as a monkey-
patch. This is quite simple, just create a ruby-file inside lib with
a class in there of the same name, and inside the same modules as
the rails-class. Then add changed versions of all the functions you
want changed.

Require this file at the end of your environment.rb, and you’re done.

I myself make use of this method quite extensively, but of course you
shouldn’t over-do it and of course try to get improvements and fixes
that everyone would enjoy into the rails-trunk.

Wybo

Thanks for the suggestion Wybo, I have been battling with edge rails all
day.

I’ll try your solution

Along the same lines, I recently did something similar. This might
not be the best solution, however I created a patches.rb file that
gets loaded by environment, an example in there:

Monkey Patches

Fixes a bug in rails 1.2.2 where Arrays are being improperly handled

in query parameters

It should only be converted to a ‘/’ joined string if it’s a :path

element
if Gem::GemPathSearcher.new.find(‘rails’).version.to_s == ‘1.2.2’
class ActionController::Routing::RouteSet
def options_as_params(options)
options_as_params = options[:controller] ? { :action => “index” }
:
{}
options.each do |k, value|
options_as_params[k] = (value.class == Array && k.to_s !=
‘path’) ? value : value.to_param
end
options_as_params
end
end
end

This way I won’t override anything if they fix it in the next release,
and if it still isn’t fixed, I can just update the version check.

Anyways, hope that helps some.
.adam sanderson

On Feb 8, 10:52 am, Giant C. [email protected]

Hi !

2007/2/8, Jodi S. [email protected]:

I’ve had problems with piston convert, ended up piston importing
instead, then proplists don’t look right and diffs don’t work
(everything ellse does).

do you have a mailing list, or can I email my questions directly?

No, there are no mailing lists yet. You can send me mail directly,
although I’m going away on a trip for a week.

Bye !

François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/