Sha256: 3b7e8be67028397550a96ff9e0b8a16d0a55038b4cbed360911bea28ccb4a6b3

Contents?: true

Size: 345 Bytes

Versions: 25

Compression:

Stored size: 345 Bytes

Contents

class Dir
  def git_repos(subdir = '*')
    Dir.glob(File.join(path, subdir, '*', '.git')).map { |path_to_git_dir|
      path_to_git_repo = File.dirname(path_to_git_dir)   # without "/.git"
      repo_name = path_to_git_repo[%r{[^\/]+\/[^\/]+\z}] # e.g. "pvdb/git-multi"
      def repo_name.full_name() self; end
      repo_name
    }
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
git-multi-4.0.1 lib/ext/dir.rb
git-multi-4.0.0 lib/ext/dir.rb
git-multi-3.0.3 lib/ext/dir.rb
git-multi-3.0.2 lib/ext/dir.rb
git-multi-3.0.0 lib/ext/dir.rb
git-multi-2.10.0 lib/ext/dir.rb
git-multi-2.9.0 lib/ext/dir.rb
git-multi-2.8.0 lib/ext/dir.rb
git-multi-2.7.0 lib/ext/dir.rb
git-multi-2.6.1 lib/ext/dir.rb
git-multi-2.6.0 lib/ext/dir.rb
git-multi-2.5.0 lib/ext/dir.rb
git-multi-2.4.0 lib/ext/dir.rb
git-multi-2.3.0 lib/ext/dir.rb
git-multi-2.2.0 lib/ext/dir.rb
git-multi-2.1.0 lib/ext/dir.rb
git-multi-2.0.0 lib/ext/dir.rb
git-multi-1.2.1 lib/ext/dir.rb
git-multi-1.2.0 lib/ext/dir.rb
git-multi-1.1.0 lib/ext/dir.rb