Class: Ahnnotate::Function::Niam

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/ahnnotate/function/niam.rb

Instance Method Summary collapse

Methods included from Command

included, #initialize, #vfs

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ahnnotate/function/niam.rb', line 6

def call
  @config["annotate"].each do |facet_name, config|
    if !config["enabled"]
      next
    end

    schema_stripper = StripSchema.new(comment: "#")

    vfs.each_in(config["path"], config["extension"]) do |path, content|
      content_with_stripped_schema = schema_stripper.call(content)

      if content_with_stripped_schema.size < content.size
        vfs[path] = content_with_stripped_schema
      end
    end
  end
end