class BigKeeper::FileOperator

Operator for got

Public Class Methods

definitely_exists?(path) click to toggle source
# File lib/big_keeper/util/file_operator.rb, line 4
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
find_all_code_file(path) click to toggle source
# File lib/big_keeper/util/file_operator.rb, line 26
def find_all_code_file(path)
  header_file_list = Dir.glob("#{path}/**/*.[h]")
  m_file_list = Dir.glob("#{path}/**/*.[m]")
  return header_file_list+m_file_list
end
find_all_header_file(path) click to toggle source
# File lib/big_keeper/util/file_operator.rb, line 23
def find_all_header_file(path)
  return Dir.glob("#{path}/**/*.h")
end

Public Instance Methods

current_username() click to toggle source
# File lib/big_keeper/util/file_operator.rb, line 15
def current_username
  current_name = `whoami`
  current_name.chomp
end
find_all(path, name) click to toggle source
# File lib/big_keeper/util/file_operator.rb, line 11
def find_all(path, name)
  Dir.glob("#{path}/*/#{name}")
end