Module: Kwatable

Defined in:
lib/kwatable.rb,
lib/kwatable/main.rb,
lib/kwatable/util.rb,
lib/kwatable/messages.rb,
lib/kwatable/validator.rb,
lib/kwatable/manipulator.rb,
lib/kwatable/template/helper/ruby.rb,
lib/kwatable/template/helper/label.rb,
lib/kwatable/template/helper/table.rb,
lib/kwatable/template/helper/column.rb,
lib/kwatable/template/helper/common.rb

Overview

$Rev: 39 $ $Release: 0.3.0 $ copyright© 2005 kuwata-lab.com all rights reserved.

Defined Under Namespace

Modules: ColumnHelper, CommonHelper, LabelHelper, RubyHelper, TableHelper, Util Classes: CommandOptionError, KwatableError, Main, ManipulationError, Manipulator, Validator

Constant Summary collapse

RELEASE =

release number

("$Release: 0.3.0 $" =~ /[\.\d]+/) && $&
@@template_path =

template path

[]
@@messages =
{}
@@schema =
YAML.load_file(filename)

Class Method Summary collapse

Class Method Details

.msg(key) ⇒ Object



11
12
13
# File 'lib/kwatable/messages.rb', line 11

def self.msg(key)
  return @@messages[key]
end

.schemaObject

schema definition



32
33
34
# File 'lib/kwatable/validator.rb', line 32

def self.schema
  return @@schema
end

.template_pathObject



28
29
30
# File 'lib/kwatable.rb', line 28

def self.template_path
  return @@template_path
end

.validate(tabledef, content = nil) ⇒ Object

validator



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/kwatable/validator.rb', line 37

def self.validate(tabledef, content=nil)
  validator = Validator.new(self.schema)
  errors = validator.validate(tabledef)
  if errors && !errors.empty?
    if content
      parser = Kwalify::YamlParser.new(content)
      parser.parse()
      parser.set_errors_linenum(errors)
    end
  end
  return errors
end