Sha256: d325fd1370e8a73a5b259684d7260623ed24aef8996453c3f197b3d240f80af1
Contents?: true
Size: 1.3 KB
Versions: 1
Compression:
Stored size: 1.3 KB
Contents
module Ahnnotate module Facet module Models class Main def initialize(config, tables, vfs) @config = config @tables = tables @vfs = vfs end def call formatter = Function::Format.new(comment: "#") model_nodes.each do |model_node| table = @tables[model_node.table_name] if table.nil? next end @vfs[model_node.path] = formatter.call(table, @vfs[model_node.path]) end end def model_nodes @model_nodes ||= begin model_path = @config["annotate", "models", "path"] model_files = @vfs.each_in(model_path) processor = Processor.new models = model_files.map do |path, contents| module_nodes = processor.call(contents) module_nodes.each { |node| node.path = path } module_nodes end models .flatten .yield_self(&ResolveClassRelationships.new) .yield_self(&ResolveActiveRecordModels.new) .select(&:is_a_kind_of_activerecord_base?) .reject(&:abstract_class?) end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ahnnotate-0.2.0 | lib/ahnnotate/facet/models/main.rb |