class TaskJuggler::VimSyntax

This class is a generator for vim (www.vim.org) TaskJuggler syntax highlighting files.

Public Class Methods

new() click to toggle source

Create a generator object.

# File lib/taskjuggler/VimSyntax.rb, line 23
def initialize
  # Create a syntax reference for all current keywords.
  @reference = SyntaxReference.new(nil, true)

  @properties = []
  @attributes = []
  @optionBlocks = []

  @reference.keywords.each_value do |kw|
    if kw.isProperty?
      @properties << kw
    else
      @attributes << kw
    end
    if !kw.optionalAttributes.empty?
      @optionBlocks << kw
    end
  end

  @file = nil
end

Public Instance Methods

generate(file) click to toggle source

Generate the vim syntax file into file.

# File lib/taskjuggler/VimSyntax.rb, line 46
def generate(file)
  @file = File.open(file, 'w')

  header
  setLocal
  keywords
  matches
  regions
  highlights

  @file.close
end