Sha256: 5a91bce96076745ea610b0be2099f2b82294bda292b21d476a62340c5424f527

Contents?: true

Size: 382 Bytes

Versions: 6

Compression:

Stored size: 382 Bytes

Contents

class Dir
  def git_repos(subdir = '*')
    Dir.glob(File.join(self.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[/[^\/]+\/[^\/]+\z/] # e.g. "pvdb/git-multi"
      def repo_name.full_name() self ; end             # awesome duck-typing!
      repo_name
    }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
git-multi-1.0.5 lib/ext/dir.rb
git-multi-1.0.4 lib/ext/dir.rb
git-multi-1.0.3 lib/ext/dir.rb
git-multi-1.0.2 lib/ext/dir.rb
git-multi-1.0.1 lib/ext/dir.rb
git-multi-1.0.0 lib/ext/dir.rb