Sha256: 0aa7f562d0c0d4a90cd1bb3ce0bc5425e6590707a83b27afba59a46c5e24f599

Contents?: true

Size: 434 Bytes

Versions: 6

Compression:

Stored size: 434 Bytes

Contents

require "batcave/namespace"

module BatCave::Support::Git
  def project_root
    return @project_root if instance_variable_defined?(:@project_root)
    root = %x{git rev-parse --show-toplevel}.chomp
    if $?.exitstatus != 0
      raise "'git rev-parse --show-toplevel' failed. No project root found. Is this in a git clone?"
    end
    @project_root = root
    return root
  end # def project_root
end # class BatCave::Support::Git

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
batcave-0.0.11 lib/batcave/support/git.rb
batcave-0.0.9 lib/batcave/support/git.rb
batcave-0.0.7 lib/batcave/support/git.rb
batcave-0.0.6 lib/batcave/support/git.rb
batcave-0.0.5 lib/batcave/support/git.rb
batcave-0.0.4 lib/batcave/support/git.rb