API changes in 1.8.0

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.

Brian Candler wrote:

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 :frowning:
V.-

···

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

Brian Candler wrote:

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

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

···

On Sun, Jul 27, 2003 at 07:26:18PM +0900, Brian Candler wrote:

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:

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

hth,
Kero.

···

On Sun, 27 Jul 2003 19:26:18 +0900, Brian Candler wrote:

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.

Damphyr wrote:

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 :frowning:
Too quicke of the mark - not unreachable, just very slow.

http://www.rubygarden.org/ruby?ChangesToProgrammingRuby for the changes
in PickAxe, and I guess you could add you point here:

because I haven’t found a mention of this change anywhere (didn’t look
to hard to tell you the truth)
V.-

···

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

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

Cheers,

Brian.

···

On Mon, Jul 28, 2003 at 12:25:39AM +0900, Dave Thomas wrote:

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.

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. :\

Maybe things have changed since you did that, because it’s pretty clever
about it now: cgi[‘param’] returns an object which is a subclass of String,
and it has , first and last methods. If you call any of those methods it
just returns the object itself and generates a warning.

Of course, if you need to accept multiple values for a particular form
attribute then it will break; but existing scripts which say cgi[‘param’][0]
do actually work.

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.

I didn’t see anything posted either.

Regards,

Brian.

···

On Wed, Jul 30, 2003 at 11:07:03AM +0900, Mark J. Reed wrote:

On Sun, Jul 27, 2003 at 07:26:18PM +0900, Brian Candler wrote:

Also:

···

On Sun, 27 Jul 2003 20:42:13 +0900, Damphyr wrote:

Damphyr wrote:

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 :frowning:
Too quicke of the mark - not unreachable, just very slow.

http://www.rubygarden.org/ruby?ChangesToProgrammingRuby for the changes
in PickAxe, and I guess you could add you point here:

http://www.rubygarden.org/ruby?ProgrammingRubyTwo/NetworkAndWebLibraries
because I haven’t found a mention of this change anywhere (didn’t look
to hard to tell you the truth)


Simon Strandgaard

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.

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

Guy Decoux

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.

···

On Wed, Jul 30, 2003 at 07:10:08PM +0900, ts wrote:

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.

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