Class: Spectro::Compiler

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Singleton
Defined in:
lib/spectro/compiler.rb

Overview

Spectro:Compiler is in charge of spectroan the projects and parse its files, updating the project Spectro index and dumping information about the missing implementations (specs without an associated lambda)

Instance Method Summary collapse

Instance Method Details

#compileSpectro::Compiler

Filters the project files keeping those making use of Spectro. It them parses those files, check for missing implementations and creates an .spectro/undefined.yml with the specs of them.


24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/spectro/compiler.rb', line 24

def compile 
  undefined_yaml = YAML::Store.new(".spectro/undefined.yml")
  undefined_yaml.transaction do
    targets().map do |path|
      missing_specs = missing_specs_from_file(path)

      next if missing_specs.empty?
       
      undefined_yaml[path] = missing_specs
    end
  end
 
  return self
end