Sha256: 6c3774cb9857475cd0d7b28a2e07d8292ed9ba357cadfcb7c4ad1e2a500b00e4

Contents?: true

Size: 815 Bytes

Versions: 13

Compression:

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

13 entries across 13 versions & 2 rubygems

Version Path
kookeeper-3.0.0 lib/big_keeper/util/file_operator.rb
kookeeper-2.0.0 lib/big_keeper/util/file_operator.rb
kookeeper-1.0.0 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.21 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.20 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.19 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.18 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.17 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.16 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.15 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.14 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.13 lib/big_keeper/util/file_operator.rb
bigkeeper-0.9.12 lib/big_keeper/util/file_operator.rb