Class: Pk::Team

Inherits:
Thor
  • Object
show all
Includes:
Helper
Defined in:
lib/pk/team.rb

Instance Method Summary collapse

Methods included from Helper

#all_members_of, #init

Instance Method Details

#add(name, git_url) ⇒ Object



9
10
11
12
# File 'lib/pk/team.rb', line 9

def add(name, git_url)
  init
  `git clone #{git_url} ~/.pk/data/#{name}`
end

#list(team = nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/pk/team.rb', line 25

def list(team=nil)
  init
  if team
    all_members_of(team).each do |m|
      puts m
    end
  else
    `ls ~/.pk/data`.split.each do |t|
      puts t
    end
  end
end

#reload(team = nil) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/pk/team.rb', line 15

def reload(team=nil)
  init
  teams = Dir["#{ENV["HOME"]}/.pk/data/*/"].map{|f| File.basename(f) }
  teams = teams.select{|t| t == team} if team
  teams.each do |t|
    `cd ~/.pk/data/#{t} && git pull && cd -`
  end
end