Class: VFS::FileCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/yaml-vfs/file_collector.rb

Overview

vfs gen

Instance Method Summary collapse

Constructor Details

#initialize(entrys) ⇒ FileCollector

Returns a new instance of FileCollector.



74
75
76
77
# File 'lib/yaml-vfs/file_collector.rb', line 74

def initialize(entrys)
  @entrys = entrys || []
  @vfs_writer = YAMLVFSWriter.new
end

Instance Method Details

#write_mapping(name) ⇒ Object



79
80
81
82
83
84
85
86
87
# File 'lib/yaml-vfs/file_collector.rb', line 79

def write_mapping(name)
  stream = add_write_file
  path = Pathname(name).expand_path
  unless VFS_FILES_EXTENSIONS.include?(File.extname(path))
    path.mkpath unless path.exist?
    path = path.join('all-product-headers.yaml')
  end
  update_changed_file(path, stream)
end