Depreciation help needed!

I’m pretty new to RoR and need some help making my applications 2.0
compliant. I have several applications that I wrote under 1.1.3, but I
don’t have the test folders for them, and “rake test” doesn’t seem to
work. I’m not seeing any depreciation warnings when I start the Webrick
server, but I know that I used find_all when I wrote the applications.
How do I enable the depreciation warnings, and can I run a test to find
all of them?

Christopher B. wrote:

How do I enable the depreciation warnings, and can I run a test to find
all of them?

I think you have to upgrade Rails to 1.2+ to get the deprecation
warnings. Per DHH, if your app throws no warnings under 1.2+ you’re
pretty much good for 2.0.

It looks incomplete, but have a look at this:
http://rubyonrails.com/deprecation

Hope that helps.

Daniel W. wrote:

Christopher B. wrote:

How do I enable the depreciation warnings, and can I run a test to find
all of them?

I think you have to upgrade Rails to 1.2+ to get the deprecation
warnings. Per DHH, if your app throws no warnings under 1.2+ you’re
pretty much good for 2.0.

It looks incomplete, but have a look at this:
http://rubyonrails.com/deprecation

Hope that helps.

Sorry I should have been more clear. I have already upgraded to 1.2.5,
and I know that my applications still are using find_all (I can see it
in the source code). But I’m not sure where to look to find the
depreciation warnings, will it be in the output from Webrick? I’m using
Aptana IDE, and in the Console window that shows output from Webrick I’m
not seeing any warnings (even when I go to a page rendered by an action
that I know uses find_all).

Christopher B. wrote:

Sorry I should have been more clear. I have already upgraded to 1.2.5,
and I know that my applications still are using find_all (I can see it
in the source code). But I’m not sure where to look to find the
depreciation warnings, will it be in the output from Webrick? I’m using
Aptana IDE, and in the Console window that shows output from Webrick I’m
not seeing any warnings (even when I go to a page rendered by an action
that I know uses find_all).

Ah, I see. I think if you use Mongrel instead, you’ll get a much more
detailed log. By log I mean log/development.log. That’s where I’ve seen
many, many deprecation notices.

Mongrel is easy to install:
gem install mongrel

Pick the appropos installation choice.

Then, standing in the root of your app type “mongrel_rails start” and
it’ll boot up. Unlike webrick it doesn’t spit stuff out, but you can
watch the log files with tail (or if you’re on Windows there’s Tail for
Win32).

http://tailforwin32.sourceforge.net/

Christopher B. wrote:

Thanks! I just looked in the log/development.log, and even with just
Webrick it’s full of depreciation warnings. Looks like I have some
work to do before 2.0 comes out. Thanks for the tip about Mongrel too,
I’ll look into that.

You’re welcome. Glad I could help.

Daniel W. wrote:

Ah, I see. I think if you use Mongrel instead, you’ll get a much more
detailed log. By log I mean log/development.log. That’s where I’ve seen
many, many deprecation notices.

Mongrel is easy to install:
gem install mongrel

Pick the appropos installation choice.

Then, standing in the root of your app type “mongrel_rails start” and
it’ll boot up. Unlike webrick it doesn’t spit stuff out, but you can
watch the log files with tail (or if you’re on Windows there’s Tail for
Win32).

http://tailforwin32.sourceforge.net/

Thanks! I just looked in the log/development.log, and even with just
Webrick it’s full of depreciation warnings. Looks like I have some
work to do before 2.0 comes out. Thanks for the tip about Mongrel too,
I’ll look into that.

Btw, when you install mongrel, you can edit your server in Aptana and
have it use Mongrel instead of Webrick. Another handy thing for Aptana
is to incorporate Tail. It is really easy. If you are on a *nix
platform, do this:

Run -> External Tools->External Tools
In the upper left corner, click the white “piece of paper” looking “new”
icon
In the Name field, enter “Tail” without quotes
In the Location field, browse to your tail executable (probably
/bin/tail)
In Arguments, enter “-f ${resource_loc}” without the quotes
Click Apply, then Close
In your navigator, open your log directory and right-click on your
development.log and Tail should be at the bottom. Click it.
You will now have a constant tail running on this log in the console
view.
To keep that view pinned, click the “Pin” icon in the console view. You
can tail multiple logs at the same time.

Enjoy.

I posted some tips on tracking down deprecated code:

http://www.nullislove.com/2007/10/11/rails-version-124/

HTH,
Kevin S.

Daniel W. wrote:

Christopher B. wrote:

Thanks! I just looked in the log/development.log, and even with just
Webrick it’s full of depreciation warnings. Looks like I have some
work to do before 2.0 comes out. Thanks for the tip about Mongrel too,
I’ll look into that.

You’re welcome. Glad I could help.

Well, I’ve been fixing up one application, but it takes a lot of time to
visit each page so that it will generate something in the log. Do you
know if there’s a way to automatically generate warnings for all of my
actions? I’ve never used rake before, but it sounds like it might be
what I want.

Kevin S. wrote:

I posted some tips on tracking down deprecated code:

http://www.nullislove.com/2007/10/11/rails-version-124/

HTH,
Kevin S.

Thanks, that looks very helpful. But this step: “1. Run your
application’s tests to see the deprecation warnings.” How do I do that?
I tried “rake test” but it doesn’t show any depreciation warnings (and I
know there are still problems, because I haven’t fixed pagination yet).

Kevin S. wrote:

You’ll have to write tests before you can run them. :wink:

If you haven’t written any tests then you’ll need to use the other
choices instead.

Best,
Kevin

Ah, ok thanks. Guess I should learn to use rake. I got most of my code
updated. Now I just need to figure out what to do about pagination.

You’ll have to write tests before you can run them. :wink:

If you haven’t written any tests then you’ll need to use the other
choices instead.

Best,
Kevin