I like it, but you get a warning with -w...

-----Original Message-----
From: Leo [mailto:minilith / gmail.com]=20
Sent: 08 April 2009 16:43
To: ruby-talk ML
Subject: Re: performing an action only the first time a function called

> $directXSDKBootstrapped =3D false
>
> def bootstrapDirectXSDK
> =A0 if !$directXSDKBootstrapped
> =A0 =A0 bootstrapBuildToolsDirectory("DirectX/#{DIRECTX_VERSION}")
> =A0 =A0 $directXSDKBootstrapped =3D true
> =A0 =A0 $directXSDKBootstrapped.freeze
> =A0 end
> end

You could redefine bootstrapDirectXSDK:

$directXSDKBootstrapped =3D false

def bootstrapDirectXSDK
    bootstrapBuildToolsDirectory("DirectX/#{DIRECTX_VERSION}")
    $directXSDKBootstrapped =3D true
    $directXSDKBootstrapped.freeze
    def bootstrapDirectXSDK
    end
end