Class: DRG::Judge

Inherits:
Object
  • Object
show all
Defined in:
lib/drg/judge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, spec) ⇒ Judge

Returns a new instance of Judge.



5
6
7
# File 'lib/drg/judge.rb', line 5

def initialize(file, spec)
  @file, @spec = file, spec
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



3
4
5
# File 'lib/drg/judge.rb', line 3

def file
  @file
end

#specObject (readonly)

Returns the value of attribute spec.



3
4
5
# File 'lib/drg/judge.rb', line 3

def spec
  @spec
end

Instance Method Details

#missing_methodsObject



9
10
11
12
13
14
15
16
17
# File 'lib/drg/judge.rb', line 9

def missing_methods
  describes = DRG::Scanner.new(spec).describes
  DRG::Scanner.new(file).methods.select { |method_name|
    describes.detect { |describe_name|
      # turn Report.name or Report#name into .name and #name
      describe_name[/#{Regexp.escape(method_name.sub(/^\w+(\.|#)/, '\1'))}/i]
    }.nil?
  }
end