Sha256: 6826250144a6b817328e3c1ebb34d5d56beb979a5beb24fc1fde53fb757bafee

Contents?: true

Size: 478 Bytes

Versions: 17

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

module Lolcommits
  class VCSInfo
    def self.repo_root?(path = '.')
      GitInfo.repo_root?(path) || MercurialInfo.repo_root?(path)
    end

    def self.local_name(path = '.')
      if GitInfo.repo_root?(path)
        GitInfo.local_name(path)
      elsif MercurialInfo.repo_root?(path)
        MercurialInfo.local_name(path)
      else
        raise "'#{File.expand_path(path)}' is not the root of a supported VCS"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
lolcommits-0.17.2 lib/lolcommits/vcs_info.rb
lolcommits-0.17.1 lib/lolcommits/vcs_info.rb
lolcommits-0.17.0 lib/lolcommits/vcs_info.rb
lolcommits-0.16.5 lib/lolcommits/vcs_info.rb
lolcommits-0.16.4 lib/lolcommits/vcs_info.rb
lolcommits-0.16.3 lib/lolcommits/vcs_info.rb
lolcommits-0.16.2 lib/lolcommits/vcs_info.rb
lolcommits-0.16.1 lib/lolcommits/vcs_info.rb
lolcommits-0.16.0 lib/lolcommits/vcs_info.rb
lolcommits-0.16.0.pre1 lib/lolcommits/vcs_info.rb
lolcommits-0.15.1 lib/lolcommits/vcs_info.rb
lolcommits-0.15.0 lib/lolcommits/vcs_info.rb
lolcommits-0.14.2 lib/lolcommits/vcs_info.rb
lolcommits-0.14.1 lib/lolcommits/vcs_info.rb
lolcommits-0.14.0 lib/lolcommits/vcs_info.rb
lolcommits-0.13.1 lib/lolcommits/vcs_info.rb
lolcommits-0.13.0 lib/lolcommits/vcs_info.rb