Sha256: 7745c2cc6eebfcb3b93a5827f9b5dbc79cb9a1dabfc5c13384233675aa03673b

Contents?: true

Size: 518 Bytes

Versions: 3

Compression:

Stored size: 518 Bytes

Contents

module BigKeeper
  # Operator for got
  class FileOperator
    def self.definitely_exists? path
      folder = File.dirname path
      filename = File.basename path
      # Unlike Ruby IO, ls, and find -f, this technique will fail to locate the file if the case is wrong:
      not %x( find "#{folder}" -name "#{filename}" ).empty?
    end

    def find_all(path, name)
      Dir.glob("#{path}/*/#{name}")
    end

    def current_username
      current_name = `whoami`
      current_name.chomp
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bigkeeper-0.8.3 lib/big_keeper/util/file_operator.rb
bigkeeper-0.8.2 lib/big_keeper/util/file_operator.rb
bigkeeper-0.8.1 lib/big_keeper/util/file_operator.rb