Sha256: 16ddd40d88cd4c88593d8d47a7ac0c60089ab8e0c7dc840473221093b89b0808

Contents?: true

Size: 603 Bytes

Versions: 95

Compression:

Stored size: 603 Bytes

Contents

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

  include KuberKit::Import[
    "shell.local_shell"
  ]

  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)
    local_shell.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)
    local_shell.dir_exists?(dir_path)
  end
end

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
kuber_kit-1.3.8 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.7 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.1.8 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.6 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.1.7 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.5 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.4 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.1.6 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.3 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.2 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.1.5 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.1 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.3.0 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.1.4 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.2.7 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.2.6 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.2.5 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.2.4 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.2.2 lib/kuber_kit/tools/file_presence_checker.rb
kuber_kit-1.1.2 lib/kuber_kit/tools/file_presence_checker.rb