class TZInfo::TZDataDefinition

:nodoc:
@private
Base class for Zones and Links.

def create_file(output_dir)

and yields to a block to write the content.
Creates necessary directories, the file, writes the class header and footer
def create_file(output_dir)        
  dir = output_dir + File::SEPARATOR + 'definitions' + File::SEPARATOR + @path_elements.join(File::SEPARATOR)      
  FileUtils.mkdir_p(dir)
  
  open_file(File.join(output_dir, 'definitions', @name_elements.join(File::SEPARATOR)) + '.rb', 'w', :external_encoding => 'UTF-8', :universal_newline => true) do |file|
    file.binmode
    
    def file.indent(by)
      if @tz_indent
        @tz_indent += by
      else
        @tz_indent = by
      end
    end
    
    def file.puts(s)
      super("#{' ' * (@tz_indent || 0)}#{s}")
    end
    file.puts('# encoding: UTF-8')
    file.puts('')
    file.puts('module TZInfo')
    file.indent(2)
    file.puts('module Definitions')
    file.indent(2)                
    
    @name_elements.each do |part| 
      file.puts("module #{part}")
      file.indent(2)
    end
    
    file.puts('include TimezoneDefinition')
    file.puts('')
    
    yield file
                    
    @name_elements.each do
      file.indent(-2)  
      file.puts('end')          
    end
    file.indent(-2)
    file.puts('end') # end module Definitions
    file.indent(-2)        
    file.puts('end') # end module TZInfo
  end
end    

def initialize(name)

def initialize(name)
  @name = name
  
  # + and - aren't allowed in class names
  @name_elements = name.gsub(/-/, '__m__').gsub(/\+/, '__p__').split(/\//)
  @path_elements = @name_elements.clone
  @path_elements.pop
end