[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[ANN] Rails 0.9.4: Caching, filters, SQLite3…

David Heinemeier Hansson

1/17/2005 2:23:00 AM

Another incredibly strong release sees the light of day as we move one
step closer to the mythical 1.0. This release tackles one of the five
steps on the roadmap in form of caching as well as adding a bunch of
other cool stuff.

* *Render Caching:* Added an extensive caching module that offers three
levels of granularity (page, action, fragment) and a variety of stores
(file, memory, DRb, MemCached).

* *Conditional filters:* It's now possible to limit the actions that a
given filter will apply to within a controller using either :only or
:except. Like, <code>before_filter :authorize, :only => [ :edit,
:delete ]</code>

* *Associating unsaved objects:* Associations between unsaved objects
makes it much easier to build big graphs that only makes sense to be
saved together.

* *Database compatibility:* SQLite3 is now supported by the sqlite
adapter and MySQL 4.1.1+ is also supported by the included Ruby/MySQL
driver.

* *Numeric bytes and time:* Rails has taken upon itself to extend Ruby
in a few spots, such as adding the possibility for expressions like
<code>45.kilobytes + 2.3.megabytes</code> and <code>45.minutes +
2.hours + 1.fortnight</code>.

Those were the highlights, but Rails 0.9.4 includes no less than 50
changes, fixes, and features. You can read the full story in the
changelogs:

* Active Record: http://ar.rubyonrails.com/files/CHAN...
* Action Pack : http://ap.rubyonrails.com/files/CHAN...
* Rails : http://rails.rubyonrails.com/files/CHAN...

This release shouldn't require any changes to your application if
you're coming from Rails 0.9.3.
--
David Heinemeier Hansson,
http://www.basec... -- Web-based Project Management
http://www.rubyon... -- Web-application framework for Ruby
http://macro... -- TextMate: Code and markup editor (OS X)
http://www.loudthi... -- Broadcasting Brain



5 Answers

Alexander Kellett

1/17/2005 9:47:00 AM

0

On Jan 17, 2005, at 3:23 AM, David Heinemeier Hansson wrote:
> * *Numeric bytes and time:* Rails has taken upon itself to extend Ruby
> in a few spots, such as adding the possibility for expressions like
> <code>45.kilobytes + 2.3.megabytes</code> and <code>45.minutes +
> 2.hours + 1.fortnight</code>.

very neat idea!

i can imagine this being useful elsewhere,
maybe it could be added to the transamis
facets collection?

Alex



T. Onoma

1/17/2005 11:38:00 AM

0

On Monday 17 January 2005 04:47 am, Alexander Kellett wrote:
| On Jan 17, 2005, at 3:23 AM, David Heinemeier Hansson wrote:
| > * *Numeric bytes and time:* Rails has taken upon itself to extend Ruby
| > in a few spots, such as adding the possibility for expressions like
| > <code>45.kilobytes + 2.3.megabytes</code> and <code>45.minutes +
| > 2.hours + 1.fortnight</code>.
|
| very neat idea!
|
| i can imagine this being useful elsewhere,
| maybe it could be added to the transamis
| facets collection?

yes, very neat indeed! thanks for suggestion, i will look into it.


Marcel Molina Jr.

1/17/2005 4:48:00 PM

0

On Mon, Jan 17, 2005 at 06:47:25PM +0900, Alexander Kellett wrote:
> On Jan 17, 2005, at 3:23 AM, David Heinemeier Hansson wrote:
> >* *Numeric bytes and time:* Rails has taken upon itself to extend Ruby
> >in a few spots, such as adding the possibility for expressions like
> ><code>45.kilobytes + 2.3.megabytes</code> and <code>45.minutes +
> >2.hours + 1.fortnight</code>.
>
> very neat idea!

Some of the "credit" here should go to Richard Kilmer who demoed some
code at RubyConf 2004 that showcased him using methods on Numeric for
more readable time code such as the 3.hours + 45.minutes stuff.

Neat indeed. Ruby makes it easy!

marcel
--
Marcel Molina Jr. <marcel@vernix.org>


David Heinemeier Hansson

1/17/2005 6:26:00 PM

0

> Some of the "credit" here should go to Richard Kilmer who demoed some
> code at RubyConf 2004 that showcased him using methods on Numeric for
> more readable time code such as the 3.hours + 45.minutes stuff.

All of the credit should go to Richard ;). This is very much just an
implementation of his great ideas. So is the DSL direction of Rails as
well. Can't wait for RubyConf '05 to be inspired by great ideas of
Richard and others again ;)
--
David Heinemeier Hansson,
http://www.basec... -- Web-based Project Management
http://www.rubyon... -- Web-application framework for Ruby
http://macro... -- TextMate: Code and markup editor (OS X)
http://www.loudthi... -- Broadcasting Brain



leon breedt

1/19/2005 2:30:00 AM

0

On Mon, 17 Jan 2005 11:23:26 +0900, David Heinemeier Hansson
<david@loudthinking.com> wrote:
> * *Numeric bytes and time:* Rails has taken upon itself to extend Ruby
> in a few spots, such as adding the possibility for expressions like
> <code>45.kilobytes + 2.3.megabytes</code> and <code>45.minutes +
> 2.hours + 1.fortnight</code>.
What do you think of adding:

def octet_units(fmt='%.2f')
case
when self < 1.kilobyte
"#{self} bytes"
when self < 1.megabyte
"#{fmt % (self.to_f / 1.kilobyte)} KB"
when self < 1.gigabyte
"#{fmt % (self.to_f / 1.megabyte)} MB"
when self < 1.terabyte
"#{fmt % (self.to_f / 1.gigabyte)} GB"
else
"#{fmt % (self.to_f / 1.terabyte)} TB"
end
end

to the Numeric helpers?

Leon