Sha256: e85f79e0f9c4e176bdeb26dd1804c083180695663920764ed297504329d69772

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

class Rustic::CommandBuilders::Check
  def initialize(config)
    @config = config
  end

  def build
    config = @config.check_config
    [
      "check",
      config&.check_unused ? "--check-unused" : nil,
      read_data_subset(config),
      config&.with_cache ? "--with-cache" : nil
    ].compact
  end

  def read_data_subset(config)
    return nil if config.nil? || config.read_data_subset.nil?
    return "--read-data" if config.read_data_subset == 100

    "--read-data-subset=#{config.read_data_subset}%"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rustic-0.3.0 lib/rustic/command_builders/check.rb