Class: GenomerPluginValidate

Inherits:
Genomer::Plugin
  • Object
show all
Defined in:
lib/genomer-plugin-validate.rb

Defined Under Namespace

Modules: Group, Validator

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.help_messageObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/genomer-plugin-validate.rb', line 20

def self.help_message
  msg = "    USAGE: genomer validate <GROUP>\n    \n    Available validation groups:\n  EOS\n  msg << Group.groups.map do |(k,v)|\n    str =  '  '\n    str << k.ljust(15)\n    str << v.description\n  end * \"\\n\"\nend\n".unindent

Instance Method Details

#runObject

Raises:

  • (Genomer::Error)


8
9
10
11
12
13
14
15
16
17
18
# File 'lib/genomer-plugin-validate.rb', line 8

def run
  name = arguments.shift
  return self.class.help_message if name.nil?

  group = Group.groups[name]
  raise Genomer::Error, "Unknown validation group '#{name}'" if group.nil?

  group.validators.map{|i| Validator.validators[i]}.map do |v|
    v.new(arguments,flags).run
  end.flatten * "\n"
end