class Gitti::GitRepoSet

Public Class Methods

new( hash ) click to toggle source
# File lib/gitti/reposet.rb, line 14
def initialize( hash )
  @hash = hash
end
read( path ) click to toggle source
# File lib/gitti/reposet.rb, line 7
def self.read( path )
  txt  = File.open( path, 'r:utf-8') { |f| f.read }
  hash = YAML.load( txt )
  new( hash )
end

Public Instance Methods

each() { |org, names| ... } click to toggle source
# File lib/gitti/reposet.rb, line 23
def each
  @hash.each do |org_with_counter,names|

    ## remove optional number from key e.g.
    ##   mrhydescripts (3)    =>  mrhydescripts
    ##   footballjs (4)       =>  footballjs
    ##   etc.

    org = org_with_counter.sub( /\([0-9]+\)/, '' ).strip

    ## puts "  -- #{key_with_counter} [#{key}] --"

    yield( org, names )
  end
end
size() click to toggle source
# File lib/gitti/reposet.rb, line 18
def size
  ## sum up total number of repos
  @size ||=  @hash.reduce(0) {|sum,(_,names)| sum+= names.size; sum }
end