class FLACsmith::CLI::Actions::Rebuild

Handles the rebuild action.

Attributes

builder[R]

Public Class Methods

new(builder: Metadata::Builder, **dependencies) click to toggle source
Calls superclass method
# File lib/flacsmith/cli/actions/rebuild.rb, line 14
def initialize builder: Metadata::Builder, **dependencies
  super(**dependencies)
  @builder = builder
end

Public Instance Methods

call(source_dir) click to toggle source
# File lib/flacsmith/cli/actions/rebuild.rb, line 19
def call source_dir
  logger.info { "Rebuilding metadata for: #{source_dir}..." }
  build source_dir
end

Private Instance Methods

build(root) click to toggle source
# File lib/flacsmith/cli/actions/rebuild.rb, line 28
def build root
  builder.new(Pathname(root))
         .then { |instance| instance.tap(&:call) }
         .paths
         .each { |path| logger.info { "Processed: #{path}" } }
end