Forum: Ruby on Rails Running patched rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Giant C. (Guest)
on 2007-02-07 15:30
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
Alan F. (Guest)
on 2007-02-07 16:11
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
François B. (Guest)
on 2007-02-07 21:28
(Received via mailing list)
Hi !

2007/2/7, Giant C. <removed_email_address@domain.invalid>:
> 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/
Jodi S. (Guest)
on 2007-02-07 21:39
(Received via mailing list)
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
François B. (Guest)
on 2007-02-08 03:31
(Received via mailing list)
Hi !

2007/2/7, Jodi S. <removed_email_address@domain.invalid>:
> 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/
Jodi S. (Guest)
on 2007-02-08 05:39
(Received via mailing list)
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
François B. (Guest)
on 2007-02-08 06:48
(Received via mailing list)
Hi !

2007/2/7, Jodi S. <removed_email_address@domain.invalid>:
> 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/
Jodi S. (Guest)
on 2007-02-08 17:06
(Received via mailing list)
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?
Wybo W. (Guest)
on 2007-02-08 20:50
(Received via mailing list)
> 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:
- History, Informatiekunde (computer linguistics, IR, webtech) and
Philosophy
- Member of the Center for Metahistory Groningen
(http://www.rug.nl/let/cmg)

::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:
- In the world, wavy hair, go figure
(http://nl.logilogi.org/HomE/WyboWiersma)
Giant C. (Guest)
on 2007-02-08 20:52
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
unknown (Guest)
on 2007-02-09 03:07
(Received via mailing list)
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. <removed_email_address@domain.invalid>
François B. (Guest)
on 2007-02-09 15:28
(Received via mailing list)
Hi !

2007/2/8, Jodi S. <removed_email_address@domain.invalid>:
> 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/
This topic is locked and can not be replied to.