Class: Yoda::Store::Actions::ReadProjectFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/yoda/store/actions/read_project_files.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(registry, root_path) ⇒ ReadProjectFiles

Returns a new instance of ReadProjectFiles.



11
12
13
14
# File 'lib/yoda/store/actions/read_project_files.rb', line 11

def initialize(registry, root_path)
  @registry = registry
  @root_path = root_path
end

Instance Attribute Details

#registryRegistry (readonly)

Returns:



6
7
8
# File 'lib/yoda/store/actions/read_project_files.rb', line 6

def registry
  @registry
end

#root_pathString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/yoda/store/actions/read_project_files.rb', line 9

def root_path
  @root_path
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/yoda/store/actions/read_project_files.rb', line 16

def run
  files = project_files
  progress = Instrument::Progress.new(files.length) do |index:, length:|
    Instrument.instance.initialization_progress(phase: :load_project_files, message: "Loading current project files (#{index} / #{length})", index: index, length: length)
  end

  files.each do |file|
    ReadFile.run(registry, file)
    progress.increment
  end
end