That's my question. And I think I found it: If I do class Article include REXML ... ... end
I get the error with strptime.
If I use REXML::Document and don't include, then everything is fine. So REXML does something to Date.
> I run ruby 1.8.2 (2004-12-25) [i386-mswin32]
Since I cannot duplicate the problem in irb with a simple include, here's the code that duplicates this, maybe someone can see what's wrong.
Cheers,
V.-
12:17:39 [ruby]: ruby -r date -e 'p Date.object_id; require
"rexml/document"; p Date.object_id; class X; include REXML; p
Date.object_id; end'
135087764
135087764
135679456
12:17:51 [ruby]:
12:17:39 [ruby]: ruby -r date -e 'p Date.object_id; require "rexml/document"; p Date.object_id; class X; include REXML; p Date.object_id; end' 135087764 135087764 135679456 12:17:51 [ruby]:
Notice the different last id?
Well, I figuredd that out and I run my code without the include, but the question remains, what does REXML do to Date?
'Should not include REXML when using Date' is not something that one expects, is it?
Anyway, can I call Date instead of REXML::Date?
Cheers,
V.-
12:17:39 [ruby]: ruby -r date -e 'p Date.object_id; require
"rexml/document"; p Date.object_id; class X; include REXML; p
Date.object_id; end' 135087764 135087764 135679456 12:17:51 [ruby]:
Notice the different last id?
Well, I figuredd that out and I run my code without the include, but
the question remains, what does REXML do to Date?
IMHO REXML is not intended for inclusion it's just a namespace module. If
you import it you get all sorts of stuff inside that module into your
class. By importing it you create the effect that the namespace was
introduced to avoid.
'Should not include REXML when using Date' is not something that one
expects, is it?
Anyway, can I call Date instead of REXML::Date?
::Date
14:23:55 [ruby]: ruby -r date -e 'p Date.object_id; require
"rexml/document"; p Date.object_id; class X; include REXML; p
Date.object_id; p ::Date.ob
ject_id; end'
135087828
135087828
135677044
135087828