API changes in 1.8.0

B

Brian Candler

Has anyone written a summary of API changes between 1.6.8 and 1.8.0? If not,
I think that would be a *really* helpful idea.

I have just discovered that the [] method of CGI has changed:

before: mycgi['foo'] => array of items, like mycgi.params['foo']
now: mycgi['foo'] => single item, mycgi.params['foo'][0]

There is a warning given, and I guess this is an improvement since I write
cgi['foo'][0] all over the place at the moment, but it would be nice to have
a list of things to look out for.

Regards,

Brian.
 
D

Damphyr

Brian said:
Has anyone written a summary of API changes between 1.6.8 and 1.8.0? If not,
I think that would be a *really* helpful idea.

I have just discovered that the [] method of CGI has changed:

before: mycgi['foo'] => array of items, like mycgi.params['foo']
now: mycgi['foo'] => single item, mycgi.params['foo'][0]

There is a warning given, and I guess this is an improvement since I write
cgi['foo'][0] all over the place at the moment, but it would be nice to have
a list of things to look out for.

Regards,

Brian.
Isn't there a page in the Wiki to document such changes (or was that the
v2 of the pickAxe book page). Can't tell for sure, the Garden is not
reachable :(
V.-


____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.
 
M

Mark J. Reed

Has anyone written a summary of API changes between 1.6.8 and 1.8.0? If not,
I think that would be a *really* helpful idea.

I have just discovered that the [] method of CGI has changed:

I also made this discovery, when I upgraded mod_ruby to 1.8 and thereby
broke my entire website. Parts of which stayed down for two weeks
because I'd missed them in my fix pass. :\

I admit that having cgi['param'] return one value is more convenient
for most scripts, but it would have been nice to announce that change
somewhere. Was there a post on this group about it that I missed?
It's a major compatibility breaker.

-Mark
 
D

Dave Thomas

Brian said:
Has anyone written a summary of API changes between 1.6.8 and 1.8.0? If not,
I think that would be a *really* helpful idea.

I'm working on that for the built-in stuff: I've got 142 changes so far
to built-in classes and modules. I'm still thinking about how to express
this best: right now it's done as a flag in the source for the PickAxe.

Cheers


Dave
 
B

Brian Candler

I'm working on that for the built-in stuff: I've got 142 changes so far
to built-in classes and modules. I'm still thinking about how to express
this best: right now it's done as a flag in the source for the PickAxe.

Sounds very useful. Might be worth flagging changes as 'additional
features', '(potentially incompatible) changes' etc

Cheers,

Brian.
 
K

Kero van Gelder

Has anyone written a summary of API changes between 1.6.8 and 1.8.0? If not,
I think that would be a *really* helpful idea.

ruby-shim, search RAA for it.
But I have no idea how complete it is (Tk changes, for instance).

hth,
Kero.
 
B

Brian Candler

I admit that having cgi['param'] return one value is more convenient
for most scripts, but it would have been nice to announce that change
somewhere. Was there a post on this group about it that I missed?
It's a major compatibility breaker.

B> I didn't see anything posted either.

Thread "Pre-RCR... nil.empty?"

http://www.ruby-talk.org/43795

yes, it's related

http://www.ruby-talk.org/44044

Ah, both before my time.

Having said that, I still don't see how string.empty? is related. It is
valid to have "mycgi?foo=&bar=" (empty strings) and it is valid to have foo
and bar not present (nil), and they are different conditions.

Those conditions would be reported as, respectively,

cgi.params['foo'] => ['']
cgi.params['foo'] => []

And under the new API I believe you should get

cgi['foo'] => ''
cgi['foo'] => nil

so they are still not the same thing.

Regards,

Brian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top