Sha256: b67a6655a1a4411cc279d3c868c273c2eb261c9d4a66362d4453535d77daa9f1

Contents?: true

Size: 522 Bytes

Versions: 9

Compression:

Stored size: 522 Bytes

Contents

class KuberKit::Tools::FilePresenceChecker
  FileNotFound = Class.new(KuberKit::Error)

  def check_file!(file_path)
    unless file_exists?(file_path)
      raise FileNotFound, "File not found at path: #{file_path}"
    end
    true
  end

  def file_exists?(file_path)
    File.exists?(file_path)
  end

  def check_dir!(dir_path)
    unless dir_exists?(dir_path)
      raise FileNotFound, "Directory not found at path: #{dir_path}"
    end
    true
  end

  def dir_exists?(dir_path)
    Dir.exists?(dir_path)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kuber_kit-0.1.8 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.7 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.6 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.5 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.4 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.3 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.2 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.1 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-0.1.0 lib/kuber_kit/tools/file_presence_checker.rb