Class: Access

Inherits:
Object
  • Object
show all
Defined in:
lib/mygit.rb

Constant Summary collapse

COL_WIDTH =
30

Class Method Summary collapse

Class Method Details

.find(name) ⇒ Object



71
72
73
74
75
76
77
# File 'lib/mygit.rb', line 71

def find name
  found = nil
  repo.each do |r|
    found = r if r['name'] == name
  end
  found
end

.listObject



64
65
66
67
68
69
# File 'lib/mygit.rb', line 64

def list
  repo.each do |r|
    spaces = ' ' * (COL_WIDTH - r['name'].size) unless r['name'].size > COL_WIDTH
    puts "#{r['name']} #{spaces} #{r['ssh_url']}"
  end
end

.repoObject



79
80
81
# File 'lib/mygit.rb', line 79

def repo
  @repo ||= FileStorage.new.repo
end