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

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

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

You could redefine bootstrapDirectXSDK:

$directXSDKBootstrapped = false

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