[#84664] CGI uses file size to distinguish between regular values and files — David Heinemeier Hansson <david@...>

I've been having a ton of problems handling file uploads with CGI.rb

23 messages 2003/11/02
[#84674] Re: CGI uses file size to distinguish between regular values and files — Simon Kitching <simon@...> 2003/11/03

Hi David,

[#84676] Re: CGI uses file size to distinguish between regular values and files — Dmitry Borodaenko <d.borodaenko@...> 2003/11/03

On Mon, Nov 03, 2003 at 02:29:08PM +0900, Simon Kitching wrote:

[#84678] Re: CGI uses file size to distinguish between regular values and files — Austin Ziegler <austin@...> 2003/11/03

On Mon, 3 Nov 2003 20:12:06 +0900, Dmitry Borodaenko wrote:

[#84692] Re: CGI uses file size to distinguish between regular values and files — Dmitry Borodaenko <d.borodaenko@...> 2003/11/03

On Mon, Nov 03, 2003 at 11:40:48PM +0900, Austin Ziegler wrote:

[#84700] Re: CGI uses file size to distinguish between regular values and files — Austin Ziegler <austin@...> 2003/11/03

On Tue, 4 Nov 2003 04:37:19 +0900, Dmitry Borodaenko wrote:

[#84701] Re: CGI uses file size to distinguish between regular values and files — Simon Kitching <simon@...> 2003/11/03

On Tue, 2003-11-04 at 10:29, Austin Ziegler wrote:

[#84703] Re: CGI uses file size to distinguish between regular values and files — Austin Ziegler <austin@...> 2003/11/03

On Tue, 4 Nov 2003 06:51:43 +0900, Simon Kitching wrote:

[#84708] Re: CGI uses file size to distinguish between regular values and files — matz@... (Yukihiro Matsumoto) 2003/11/04

Hi,

[#84735] Managing metadata about attribute types — Simon Kitching <simon@...>

Hi,

52 messages 2003/11/05
[#84740] Re: Managing metadata about attribute types — Austin Ziegler <austin@...> 2003/11/05

On Wed, 5 Nov 2003 09:38:16 +0900, Simon Kitching wrote:

[#84741] Re: Managing metadata about attribute types — Simon Kitching <simon@...> 2003/11/05

On Wed, 2003-11-05 at 17:09, Austin Ziegler wrote:

[#84762] Re: Managing metadata about attribute types — Simon Kitching <simon@...> 2003/11/06

What a vigorous discussion I seem to have triggered :-)

[#84770] Re: Managing metadata about attribute types — dblack@... 2003/11/06

Hi --

[#84780] Re: Managing metadata about attribute types — Ryan Pavlik <rpav@...> 2003/11/06

On Thu, 6 Nov 2003 12:45:39 +0900

[#84858] Re: Managing metadata about attribute types — "John W. Long" <ng@...> 2003/11/08

Ryan,

[#84847] Long-running daemon acquiring giant memory footprint — Jason DiCioccio <jd@...>

I have written a long-running daemon in ruby to handle dynamic DNS updates.

16 messages 2003/11/07

[#84900] Antwort: Re: Power of Interpreted Languages — Robert.Koepferl@...

25 messages 2003/11/10
[#84914] Re: Antwort: Re: Power of Interpreted Languages — Aredridel <aredridel@...> 2003/11/10

> But, would you implement a game with ruby?

[#84917] Re: Antwort: Re: Power of Interpreted Languages — Gregory Millam <walker@...> 2003/11/10

Received: Tue, 11 Nov 2003 01:21:15 +0900

[#84920] Re: Antwort: Re: Power of Interpreted Languages — "Sean O'Dell" <sean@...> 2003/11/10

On Monday 10 November 2003 09:28 am, Gregory Millam wrote:

[#84921] Ruby/Tk Some Basic Questions — "Zach Dennis" <zdennis@...> 2003/11/10

Hi,

[#84930] Re: Ruby/Tk Some Basic Questions — Hidetoshi NAGAI <nagai@...> 2003/11/11

Hi,

[#85097] substring: to the end of the string — KONTRA Gergely <kgergely@...>

Hi!

19 messages 2003/11/14

[#85104] Microsoft's C/C++ compiler freely available — "Nathaniel Talbott" <nathaniel@...>

Thought this might be interesting to those stuck on win32...

23 messages 2003/11/15
[#85106] Re: Microsoft's C/C++ compiler freely available — Daniel Carrera <dcarrera@...> 2003/11/15

Question:

[#85178] overload method in module_eval, how? — Simon Strandgaard <qj5nd7l02@...>

I want to overload a testcase method with debug-enabling wrapper.

13 messages 2003/11/17

[#85218] Access ftp-server through proxy — Kristian Sensen <ks@...>

14 messages 2003/11/17

[#85330] Yet Another Rite Thought: method combination — gabriele renzi <surrender_it@...1.vip.ukl.yahoo.com>

I just looked at matz' slides and I don't have a clear understanding

28 messages 2003/11/17

[#85421] Again, Rite explanation needed (keyword args and new hash syntax) — gabriele renzi <surrender_it@...1.vip.ukl.yahoo.com>

Hi gurus and nubys,

13 messages 2003/11/18

[#85488] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) )<Pine.LNX.4.44.0311171402340.1133-100000@ool-435 5dfae.dyn.optonline.net> — "Weirich, James" <James.Weirich@...>

David Black (dblack@wobblini.net) wrote:

121 messages 2003/11/18
[#85492] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) )<Pine.LNX.4.44.0311171402340.1133-100000@ool-435 5dfae.dyn.optonline.net> — Simon Kitching <simon@...> 2003/11/18

On Wed, 2003-11-19 at 10:30, Weirich, James wrote:

[#85499] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) )<Pine.LNX.4.44.0311171402340.1133-100000@ool-435 5dfae.dyn.optonline.net> — "Sean O'Dell" <sean@...> 2003/11/18

On Tuesday 18 November 2003 02:06 pm, Simon Kitching wrote:

[#85523] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Austin Ziegler <austin@...> 2003/11/19

On Wed, 19 Nov 2003 08:08:25 +0900, Sean O'Dell wrote:

[#85582] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/19

On Tuesday 18 November 2003 10:30 pm, Austin Ziegler wrote:

[#85609] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Austin Ziegler <austin@...> 2003/11/19

On Thu, 20 Nov 2003 02:43:31 +0900, Sean O'Dell wrote:

[#85619] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 12:04 pm, Austin Ziegler wrote:

[#85656] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Austin Ziegler <austin@...> 2003/11/19

On Thu, 20 Nov 2003 05:48:37 +0900, Sean O'Dell wrote:

[#85664] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 03:00 pm, Austin Ziegler wrote:

[#85684] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Austin Ziegler <austin@...> 2003/11/20

On Thu, 20 Nov 2003 08:19:08 +0900, Sean O'Dell wrote:

[#85688] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Simon Kitching <simon@...> 2003/11/20

On Thu, 2003-11-20 at 14:06, Austin Ziegler wrote:

[#85734] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Thien Vuong <tvuong@...> 2003/11/20

[#85748] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Austin Ziegler <austin@...> 2003/11/20

On Thu, 20 Nov 2003 14:52:17 +0900, Thien Vuong wrote:

[#85854] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/20

On Wednesday 19 November 2003 10:47 pm, Austin Ziegler wrote:

[#85858] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — dblack@... 2003/11/20

Hi --

[#85895] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — matz@... (Yukihiro Matsumoto) 2003/11/20

Hi,

[#85906] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — Chad Fowler <chad@...> 2003/11/20

On Fri, 21 Nov 2003, Yukihiro Matsumoto wrote:

[#85908] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/20

On Thursday 20 November 2003 02:40 pm, Chad Fowler wrote:

[#85938] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — matz@... (Yukihiro Matsumoto) 2003/11/21

Hi,

[#85940] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/21

On Thursday 20 November 2003 06:47 pm, Yukihiro Matsumoto wrote:

[#85944] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — matz@... (Yukihiro Matsumoto) 2003/11/21

Hi,

[#85951] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/21

On Thursday 20 November 2003 07:58 pm, Yukihiro Matsumoto wrote:

[#85970] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — matz@... (Yukihiro Matsumoto) 2003/11/21

Hi,

[#85997] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/21

On Friday 21 November 2003 02:20 am, Yukihiro Matsumoto wrote:

[#86046] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — matz@... (Yukihiro Matsumoto) 2003/11/21

Hi,

[#86071] Method wrapper question (was "stereotyping (was ...)) — Gavin Sinclair <gsinclair@...> 2003/11/22

On Saturday, November 22, 2003, 10:53:39 AM, Yukihiro wrote:

[#86085] Re: Method wrapper question (was "stereotyping (was ...)) — ts <decoux@...> 2003/11/22

>>>>> "G" == Gavin Sinclair <gsinclair@soyabean.com.au> writes:

[#86090] Re: Method wrapper question (was "stereotyping (was ...)) — Gavin Sinclair <gsinclair@...> 2003/11/22

On Saturday, November 22, 2003, 11:47:50 PM, ts wrote:

[#86091] Re: Method wrapper question (was "stereotyping (was ...)) — ts <decoux@...> 2003/11/22

>>>>> "G" == Gavin Sinclair <gsinclair@soyabean.com.au> writes:

[#86092] Re: Method wrapper question (was "stereotyping (was ...)) — "Christoph" <chr_mail@...> 2003/11/22

ts wrote:

[#86093] Re: Method wrapper question (was "stereotyping (was ...)) — ts <decoux@...> 2003/11/22

>>>>> "C" == Christoph <chr_mail@gmx.net> writes:

[#86095] Re: Method wrapper question (was "stereotyping (was ...)) — "Christoph" <chr_mail@...> 2003/11/22

ts wrote:

[#85590] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "David A. Black" <dblack@...> 2003/11/19

Hi --

[#85597] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 10:33 am, David A. Black wrote:

[#85599] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — matz@... (Yukihiro Matsumoto) 2003/11/19

Hi,

[#85604] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 11:14 am, Yukihiro Matsumoto wrote:

[#85503] String startswith/endswith in Ruby? — Dave Benjamin <ramen@...>

Hi all,

12 messages 2003/11/18

[#85518] Multi-dimensioned sparse array ? — Charles Hixson <charleshixsn@...>

Does anyone have an implementation of a multi-dimensioned sparse array?

14 messages 2003/11/19
[#85527] Re: Multi-dimensioned sparse array ? — Austin Ziegler <austin@...> 2003/11/19

On Wed, 19 Nov 2003 14:21:19 +0900, Charles Hixson wrote:

[#85526] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) )<Pine.LNX.4.44.0311171402340.1133-100000@ool-4355dfae.dyn.optonline.net> <Pine.LNX.4.44.0311181524130.2236-100000@ool-4355dfae.dyn.optonline.net> — Thien Vuong <tvuong@...>

54 messages 2003/11/19
[#85544] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — dblack@... 2003/11/19

[Apologies to anyone whose threading is getting messed up by the

[#85583] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 03:55 am, dblack@wobblini.net wrote:

[#85588] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — "David A. Black" <dblack@...> 2003/11/19

Hi --

[#85595] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 10:27 am, David A. Black wrote:

[#85598] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — matz@... (Yukihiro Matsumoto) 2003/11/19

Hi,

[#85601] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 11:05 am, Yukihiro Matsumoto wrote:

[#85605] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — Chad Fowler <chad@...> 2003/11/19

On Thu, 20 Nov 2003, Sean O'Dell wrote:

[#85612] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 11:46 am, Chad Fowler wrote:

[#85617] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — Maik Schmidt <contact@...> 2003/11/19

Sean O'Dell wrote:

[#85629] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) — "Sean O'Dell" <sean@...> 2003/11/19

On Wednesday 19 November 2003 12:42 pm, Maik Schmidt wrote:

[#85543] Re: $& write-protected? — ts <decoux@...>

>>>>> "S" == Simon Strandgaard <none> writes:

14 messages 2003/11/19

[#85547] x.f! RCR — Greg McIntyre <greg@...>

It bugs me that some methods have a ! on the end and some don't. It

20 messages 2003/11/19

[#85698] Re: "stereotyping" — Michael Campbell <michael_s_campbell@...>

Sean O'Dell wrote:

19 messages 2003/11/20
[#85701] Re: "stereotyping" — "Sean O'Dell" <sean@...> 2003/11/20

On Wednesday 19 November 2003 07:01 pm, Michael Campbell wrote:

[#85704] Re: "stereotyping" — Michael campbell <michael_s_campbell@...> 2003/11/20

Sean O'Dell wrote:

[#85718] Re: "stereotyping" — Clifford Heath <cjh_nospam@...> 2003/11/20

Michael campbell wrote:

[#85757] Re: "stereotyping" — Julian Fitzell <julian@...4.com> 2003/11/20

Clifford Heath wrote:

[#85913] Re: "stereotyping" — Clifford Heath <cjh_nospam@...> 2003/11/20

Julian Fitzell wrote:

[#85713] Re: [ANN] win32-clipboard 0.1.0 — Daniel Berger <djberg96@...>

Oops - forgot the link:

14 messages 2003/11/20

[#85766] learning the "Ruby way" — mark.wirdnam@... (Mark Wirdnam)

**Hobby-programmer alarm**

24 messages 2003/11/20
[#85863] Re: learning the "Ruby way" — Chad Fowler <chad@...> 2003/11/20

On Thu, 20 Nov 2003, Mark Wirdnam wrote:

[#85821] iterator 0.1 — Simon Strandgaard <qj5nd7l02@...>

homepage:

22 messages 2003/11/20

[#85870] Re: "stereotyping" — Michael Campbell <michael_s_campbell@...>

Sean O'Dell wrote:

17 messages 2003/11/20

[#85886] Partial Euphoric Type Checking — "T. Onoma" <transami@...>

Greetings all Type Checkers!

16 messages 2003/11/20
[#85948] Re: Partial Euphoric Type Checking (now Ducked!) — "T. Onoma" <transami@...> 2003/11/21

quack! quack! I added duck typing capability to my euphoric type checking

[#85952] Re: Partial Euphoric Type Checking (Super Duck!?) — "T. Onoma" <transami@...> 2003/11/21

Now some for some rally crazy cross thought. First a complete interface

[#85957] Re: Partial Euphoric Type Checking (Super Duck!?) — "T. Onoma" <transami@...> 2003/11/21

for some cross rally some thought crazy. ( read: i need a type system for my

[#85981] Re: Partial Euphoric Type Checking (Super Duck!?) — Chris Morris <chrismo@...> 2003/11/21

> you see we have a problem here. it doesn't matter what methods are

[#85987] Re: Partial Euphoric Type Checking (Super Duck!?) — Peter <Peter.Vanbroekhoven@...> 2003/11/21

> > you see we have a problem here. it doesn't matter what methods are

[#85888] New Type Checking System Idea — "Sean O'Dell" <sean@...>

Taking comments into consideration, a totally new approach strikes me

22 messages 2003/11/20

[#85947] RubyConf 2003 Presentations Posted — Ryan Davis <ryand-ruby@...>

In absolute record time (5 days compared to 3 months), rubyconf 2003

11 messages 2003/11/21

[#86007] Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) — "Weirich, James" <James.Weirich@...>

> This is a wonderful idea. Let me restate it to make sure I

13 messages 2003/11/21

[#86127] Ruby classes for MP3 de-/encoding — Dennis Oelkers <dennis@...>

Hello folks,

12 messages 2003/11/22

[#86183] "wrong argument type nil (expected String)" from Dir.chdir — Tim Kynerd <vxbrw58s02@...>

I'm running Ruby 1.6.8.

13 messages 2003/11/23

[#86202] Message "Insecure world writable dir ..." — Harry Ohlsen <harryo@...>

When File.popen() is passed an executable whose path contains a world writable directory, it produces a warning message.

19 messages 2003/11/24

[#86215] Library path relative to current .rb file — zoranlazarevic@... (Zoran Lazarevic)

One of the most irritating (missing) features of Ruby is inability to

12 messages 2003/11/24

[#86265] raise unless RUBY_VERSION[%r/^\s*\d+\.\d+/o].to_f >= 1.8 — "Ara.T.Howard" <ahoward@...>

25 messages 2003/11/24

[#86344] Re: Controlled block variables — "T. Onoma" <transami@...>

On Wednesday 26 November 2003 09:10 am, Guy Decoux wrote:

42 messages 2003/11/26
[#86346] Re: Controlled block variables — ts <decoux@...> 2003/11/26

>>>>> "T" == T Onoma <transami@runbox.com> writes:

[#86347] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/26

On Wednesday 26 November 2003 09:56 am, ts wrote:

[#86369] Re: Controlled block variables — Dan Doel <djd15@...> 2003/11/26

I actually have wondered in the past why there isn't an #eval that takes

[#86390] Re: Controlled block variables — "T. Onoma" <transami@...> 2003/11/26

On Wednesday 26 November 2003 03:57 pm, Dan Doel wrote:

[#86360] turning a string into array of ASCII bytes — David Garamond <lists@...6.isreserved.com>

What is the shortest, most straightforward way (without temporary

17 messages 2003/11/26

[#86391] Method wrapping — Hal Fulton <hal9000@...>

I've come late into the thread on this, and I haven't read all

62 messages 2003/11/26
[#86445] Re: Method wrapping — matz@... (Yukihiro Matsumoto) 2003/11/26

Hi,

[#86457] Re: Method wrapping — Hal Fulton <hal9000@...> 2003/11/27

Yukihiro Matsumoto wrote:

[#86462] Re: Method wrapping — matz@... (Yukihiro Matsumoto) 2003/11/27

Hi,

[#86470] Re: Method wrapping — "T. Onoma" <transami@...> 2003/11/27

On Thursday 27 November 2003 07:07 am, Yukihiro Matsumoto wrote:

[#86493] Re: Method wrapping — "Christoph" <chr_mail@...> 2003/11/27

Yukihiro Matsumoto wrote:

[#86498] Re: Method wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/27

> I have asked the same this question as well and I really wish

[#86508] Re: Method wrapping — "Christoph" <chr_mail@...> 2003/11/27

From: Peter wrote:

[#86512] Re: Method wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/27

> This sound all good and well however this does not change the

[#86550] pre/post question/idea — "David A. Black" <dblack@...>

Hello --

21 messages 2003/11/28

[#86646] Underpinnings of Method Wrapping — "T. Onoma" <transami@...>

Its important that we clearly seperate the issue of "surface" syntax from the

54 messages 2003/11/28
[#86657] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/28

> Thoughts?

[#86692] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/11/29

On Saturday 29 November 2003 12:44 am, Peter wrote:

[#86707] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/29

> I originally had a small paragraph touching on this, but I took it out b/c I

[#86726] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/11/29

On Saturday 29 November 2003 04:26 pm, Peter wrote:

[#86734] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/30

> The join-points are the only thing required to facilitate all of this. So I

[#86747] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/11/30

On Sunday 30 November 2003 01:01 am, Peter wrote:

[#86794] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/30

> How would they know? ;-)

[#86812] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/11/30

On Sunday 30 November 2003 03:57 pm, Peter wrote:

[#86824] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/30

> > I like the proper separation, but why pre and post for extrinsic and def

[#86831] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/11/30

On Sunday 30 November 2003 09:39 pm, Peter wrote:

[#86835] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/11/30

> You're absolutely right. Hmm...Granted this is acting in accordance to an

[#86873] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/01

On Monday 01 December 2003 12:25 am, Peter wrote:

[#86911] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/01

> I was thinking about the terms. To really distinguish these two types of wraps

[#86943] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/02

On Monday 01 December 2003 06:58 pm, Peter wrote:

[#87024] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/02

> OK as in so-so, or OK as in yes? If just so-so we'll find something better. I

[#87034] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/02

Peter:

[#87068] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/03

[snip]

[#87242] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/04

On Wednesday 03 December 2003 03:21 am, Peter wrote:

[#87478] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/07

Here is an intereseting problem that I'm currently facing and which is related

[#87481] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/07

> As always, I may be over looking the obvious. But if anyone has a current

[#87491] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/08

On Sunday 07 December 2003 08:02 pm, Peter wrote:

[#87575] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/09

Hi Tom,

[#87609] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/09

On Tuesday 09 December 2003 01:05 am, Peter wrote:

[#87686] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/10

> QUICK SIDE NOTE: might be nice to have something for all those dang ends. How

[#87688] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/10

On Wednesday 10 December 2003 05:16 am, Peter wrote:

[#87713] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/10

> Mine too! But I was joking :) Well, half way. It would be nice to have a good

[#87731] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/10

On Wednesday 10 December 2003 05:55 pm, Peter wrote:

[#87747] Re: Underpinnings of Method Wrapping — Peter <Peter.Vanbroekhoven@...> 2003/12/11

> Well, I thought of using the underscores to allow one to indent as needed to

[#87761] Re: Underpinnings of Method Wrapping — "T. Onoma" <transami@...> 2003/12/11

On Thursday 11 December 2003 04:04 am, Peter wrote:

[#86655] anything disappearing from Ruby for 2.0? — "David A. Black" <dblack@...>

Hi --

62 messages 2003/11/28
[#86710] Re: anything disappearing from Ruby for 2.0? — matz@... (Yukihiro Matsumoto) 2003/11/29

Hi,

[#86737] Re: anything disappearing from Ruby for 2.0? — Michael Campbell <michael_s_campbell@...> 2003/11/30

Yukihiro Matsumoto wrote:

[#86779] Re: anything disappearing from Ruby for 2.0? — matz@... (Yukihiro Matsumoto) 2003/11/30

Hi,

[#86661] rdoc included in standard distribution? — Chad Fowler <chad@...>

I've seen various plans for this dating back more than a year. Is it

16 messages 2003/11/29

[#86669] Class-level readers and writers — Carl Youngblood <carl@...>

I've been working with the class attribute shortcuts that Hal introduced

36 messages 2003/11/29
[#86675] Re: Class-level readers and writers — "David A. Black" <dblack@...> 2003/11/29

Hi --

[#86722] Re: Class-level readers and writers — Carl Youngblood <carl@...> 2003/11/29

> (Just as a footnote, you can also use "normal" accessor shortcuts at

[#86723] Re: Class-level readers and writers — "David A. Black" <dblack@...> 2003/11/29

Hi --

[#86728] Re: Class-level readers and writers — "Christoph" <chr_mail@...> 2003/11/29

David A. Black wrote:

[#86752] Re: Class-level readers and writers — "T. Onoma" <transami@...> 2003/11/30

On Saturday 29 November 2003 10:59 pm, Christoph wrote:

[#86782] Re: Class-level readers and writers — "David A. Black" <dblack@...> 2003/11/30

Hello --

[#86801] Re: Class-level readers and writers — "T. Onoma" <transami@...> 2003/11/30

On Sunday 30 November 2003 12:11 pm, David A. Black wrote:

[#86807] Re: Class-level readers and writers — "David A. Black" <dblack@...> 2003/11/30

Hi --

[#86808] Re: Class-level readers and writers — ts <decoux@...> 2003/11/30

>>>>> "D" == David A Black <dblack@wobblini.net> writes:

[#86815] Re: Class-level readers and writers — "David A. Black" <dblack@...> 2003/11/30

Hi --

[#86673] New to ruby--trouble with initializing arrays — vanjac12@... (Van Jacques)

I am writing a practice program; the Game of Life. Naturally I am having troubles.

11 messages 2003/11/29

[#86784] Re: anything disappearing from Ruby for 2.0? — "Gavri Savio Fernandez" <Gavri_F@...>

> From: Chris Uppal [mailto:chris.uppal@metagnostic.REMOVE-THIS.org]

21 messages 2003/11/30
[#86800] Re: anything disappearing from Ruby for 2.0? — "Chris Uppal" <chris.uppal@...> 2003/11/30

Gavri Savio Fernandez wrote:

Re: Managing metadata about attribute types

From: Austin Ziegler <austin@...>
Date: 2003-11-05 07:13:37 UTC
List: ruby-talk #84744
On Wed, 5 Nov 2003 13:27:05 +0900, Simon Kitching wrote:
> On Wed, 2003-11-05 at 17:09, Austin Ziegler wrote:
> One of the goals of xmldigester is to be able to instantiate and
> initialise objects from some input xml without making any changes
> to the classes themselves.

> Thus if you already have a library of warehouse management
> classes, I can write some rules that can take an xml description
> of the contents of that warehouse and build appropriately
> configured objects without changing that library. And once the
> parsing is complete, the resulting tree of objects should look no
> different than one created using normal calls to the library API.

You're right, they shouldn't. But if your warehouse management
classes don't do what they can to ensure their data integrity, then
there's a problem with the classes -- not with the XML library. I'm
not trying to be difficult here; just pointing out that I think
you're trying to fix the problem from the wrong end.

> In addition, the approach you suggest is quite labour-intensive;
> for every attribute, a "wrapper" method needs to be written.

Not really. See below for one option. The way that I've implemented
this makes it easy to drop into place.

> I feel Ryan's MetaTags approach is easier to use; a simple string
> format can be used to document the types to which strings from the
> xml input should be converted before assignment to various
> attributes.

Ryan's MetaTags really does not do anything different than I'm
talking about except that it could can it (although I think
StrongTyping does that better). See, you can make a simple
metamethod that wraps this for you and it becomes a relatively
simple change to make it "simple." If you don't want to create a
method for each, define a proc and use the following extension to
attr_accessor. (Does anyone else think that this is a good idea? I
do. I'd love to see it become part of "standard" Ruby.)

  class Module
    alias_method :__attr_accessor, :attr_accessor

    def attr_accessor(block, *symbols)
      if block.kind_of?(Symbol)
        symbols.unshift(block)
        __attr_accessor(*symbols)
      else
        symbols.each do |get|
          var =3D "@#{get}"
          set =3D "#{get}=3D".intern
          self.class_eval do
            define_method(get) { self.instance_variable_get(var) }
            define_method(set) { |*val|
              self.instance_variable_set(var, block.call(*val))
            }
          end
        end
      end
    end
  end

  class Foo
    attr_accessor :item
    attr_accessor proc { |x| x.to_i }, :item_id
    attr_accessor proc { |x| x.to_f }, :cost
  end

  f =3D Foo.new
  f.item    =3D "item"
  f.item_id =3D "37352"
  f.cost    =3D "12.50"
  p f.inspect

(I've actually attached a further enhanced and unit-tested version
of this extension to this message. If anyone wants to add to the
test cases, such as for array parameters, feel free.)

On Wed, 5 Nov 2003 14:06:55 +0900, Simon Kitching wrote:
>> As you can see, any code that that relies on this kind of "type
>> checking" in Ruby is naive. Worse than that, the desire to
>> shoe-horn Ruby into Java-like "strictness" can blind the user
>> into missing the point, and therefore the full benefit, of what
>> Ruby has to offer.
> Yep. I can't see how to offer what I want without some type info,
> though.
> 
> If you look at my original example, how to I know that
>     item.cost =3D '3.50'
> is wrong (the instance will eventually trigger some error), and
>     item.cost =3D '3.50'.to_f
> is the right thing to do?
> 
> With Java it just happens magically and "does the right thing"
> (except in the abstract type case mentioned above). Surely Ruby
> can't be inferior :-).

It isn't inferior, and you don't need type info. Remember -- an
object should validate or transform its own data. Using the method I
described above, it becomes "cheap" to fix the problem as I see it
without imposing a requirement for the use of type strictness that
IMO, is a really bad idea for a Ruby library.

> Yep. Tedious indeed. And as mentioned in my reply to Austin, it is a goal
> to instantiate and initialise objects without requiring any changes to
> their code. Digester manages this fine.

Digest manages this because the objects in Java automatically take
care of their own type. Sort of. The compiler prevents you from
using any type except those that are signaled. If you have not
massaged your own type attributes to make sure that they are
receiving valid data, then there's something wrong with the classes
themselves. NOT with Ruby for not providing type strictness.

In several libraries I've written, I have either rejected types that
I can't handle, or I have transformed types into what I can handle,
or I have operated on the data and thrown an error because it can't
be handled. I prefer being proactive, so I choose the former two
methods most often.

> The problem is : in order to automatically generate the filters, I need
> to know what type of object is required for each attribute. Full circle!

Again, not really. The class you're building has to know what it
expects. It's an inverse of what you'd expect from a statically
typed language, but I have found it easier to understand in the long
run.

> That code in the Person class you show above could only be generated
> because a human "knew" that Integer was an appropriate type to store into
> the age attribute (and String was not). I just want to represent that
> info in the code somehow...

But defining the Person class to convert its "age" parameter into an
Integer does exactly that. Not as meta-data, to be sure, but in the
only way that matters, IMO.

-austin
--
austin ziegler    * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.11.05
                                         * 02.12.59

Attachments (1)

extend.rb (2.2 KB, text/x-ruby)
class Module
  alias_method :__attr_accessor, :attr_accessor

  def __attr_convertor(symbol, convertor)
    var = "@#{symbol}"
    set = "#{symbol}=".intern
    define_method(symbol) { self.instance_variable_get(var) }

    if convertor.kind_of?(Symbol)
      define_method(set) { |*val| val = *val; self.instance_variable_set(var, val.send(convertor)) }
    else
      define_method(set) { |*val| self.instance_variable_set(var, convertor.call(*val)) }
    end
  end
  private :attr_convertor

  def attr_accessor(block, *symbols)
    if block.kind_of?(Symbol)
      symbols.unshift(block)
      __attr_accessor(*symbols)
    elsif block.kind_of?(Hash)
      block.each { |syms, convertor| syms.each { |get| __attr_convertor(get, convertor) } }
    else
      symbols.each { |get| __attr_convertor(get, block) }
    end
  end
end

if __FILE__ == $0
  require 'test/unit'

  class TestConvertors < Test::Unit::TestCase
    def test_normal
      f = nil
      assert_nothing_raised do
        item = Class.new
        item.instance_eval do
          attr_accessor :cost, :item, :name
        end
        f = item.new
        f.item = "3"
        f.name = "  foo  "
        f.cost = "3.52"
      end
      assert_equal("3", f.item)
      assert_equal("  foo  ", f.name)
      assert_equal("3.52", f.cost)
    end

    def test_proc
      f = nil
      assert_nothing_raised do
        item = Class.new
        item.instance_eval do
          attr_accessor proc { |x| x.to_f }, :cost
          attr_accessor proc { |x| x.to_i }, :item
          attr_accessor proc { |x| x.to_s.strip }, :name
        end
        f = item.new
        f.item = "3"
        f.name = "  foo  "
        f.cost = "3.52"
      end
      assert_equal(3, f.item)
      assert_equal("foo", f.name)
      assert_equal(3.52, f.cost)
    end

    def test_hash
      f = nil
      assert_nothing_raised do
        item = Class.new
        item.instance_eval do
          attr_accessor [:cost] => :to_f, [:item] => :to_i, [:name] => proc { |x| x.to_s.strip }
        end
        f = item.new
        f.item = "3"
        f.name = "  foo  "
        f.cost = "3.52"
      end
      assert_equal(3, f.item)
      assert_equal("foo", f.name)
      assert_equal(3.52, f.cost)
    end
  end
end

In This Thread