Sha256: 552e2f34a67b1430a6ad543efa24139e7a5c31f4539672aba5c9ec66e2a5f7ab

Contents?: true

Size: 430 Bytes

Versions: 1

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

require_relative 'git_ls/parser'

# Entry point for gem.
# Usage:
#   GitLS.files -> Array of strings as files.
#   This will be identical output to git ls-files
module GitLS
  class Error < StandardError; end

  class << self
    def files(path = ::Dir.pwd)
      path = ::File.join(path, '.git/index') if ::File.directory?(path)
      ::GitLS::Parser.new(::File.new(path)).files
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git_ls-0.1.0 lib/git_ls.rb