Sha256: 5ba1c74ad80d5a74880ae40dc36418182c9fb38b637a2bf1e6895cbf17764616

Contents?: true

Size: 817 Bytes

Versions: 28

Compression:

Stored size: 817 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

  class << FileOperator
    def find_all_header_file(path)
      return Dir.glob("#{path}/**/*.h")
    end
    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
  end
  
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
shkeeper-1.0.0 lib/big_keeper/util/file_operator.rb
kookeeper-3.1.2 lib/big_keeper/util/file_operator.rb
kookeeper-3.1.0 lib/big_keeper/util/file_operator.rb
kookeeper-3.0.9 lib/big_keeper/util/file_operator.rb
kookeeper-3.0.8 lib/big_keeper/util/file_operator.rb
kookeeper-3.0.7 lib/big_keeper/util/file_operator.rb
kookeeper-3.0.6 lib/big_keeper/util/file_operator.rb
kookeeper-3.0.5 lib/big_keeper/util/file_operator.rb
kookeeper-3.0.4 lib/big_keeper/util/file_operator.rb
kookeeper-3.0.3 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.11 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.10 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.9 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.8 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.7 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.6 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.5 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.4 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.3 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.2 lib/big_keeper/util/file_operator.rb