2009/5/12 RichardOnRails <RichardDummyMailbox58407 / uscomputergurus.com>:
> I'm running Ruby over WindowsXP-Pro/SP2.  ¨Βχαξτεδ Ζιμε®κοιτο υσ> backslash.
>
> I tried:
>
> class WFile < File
>  ¨Βεζ κοιξ¨ας籬 αςη²>  ¨Βυπες®κοιξ¨αςη±ας粩®ησυβ¨―ά――¬ §άά§
That line should look like one of these variants:

super.gsub(/\//, '\\')
super(arg1, arg2).gsub(/\//, '\\')

However, since join is a class method you would want to define it as
class method in WFile.

irb(main):001:0> class WFile < File
irb(main):002:1> def self.join(*a) super.gsub(%r{/}, '\\\\') end
irb(main):003:1> end
=> nil
irb(main):004:0> WFile.join "foo", "bar", "baz"
=> "foo\\bar\\baz"
irb(main):005:0>

>  ¨Βξδ
> end
>
> but WFile.join(s1,s2) didn't work.  ¨Βρυεστιοξ ισ χθωΏ
>
> BTW,  ¨Β δοξ§χαξτ το σταςος εξτειξτο δεβατε αβουτθχισδον
> nor aesthetics of this approach.
>
> Also,  ¨Β ηοτθΖιμε®χκοιξ το χοςλ ¨υσιξη τθγοδε βεμοχ©σο Ι§> happy.  ¨Β κυστ χαξτ το μεαςχθνω ζιςσιδεα ισ ζμαχεδ>
> class File # Join with a backslash rather than a forward slash
>  ¨Βεζ Ζιμε®χκοιξ¨ας籬 αςη²>  ¨Βοιξ¨αςη±ας粩®ησυβ¨―ά――¬ §άά§>  ¨Βξδ
> end

Another however: since you are defining a single method only the
question is whether it warrants a comlete class.  Why not just define
wjoin in class File or simply override File's definition, e.g.

def File.join(*a)
  a.join '\\'
end

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/