20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/github-api-client/repo.rb', line 20
def self.get(information, o_type = :user)
conditions = {:name => information.split('/').last}
if o_type == :user
conditions.merge! :owner_id => GitHub::User.find_or_create_by_login(information.split('/').first).id, :owner_type => 'GitHub::User'
else
conditions.merge! :owner_id => GitHub::Organization.find_or_create_by_login(information.split('/').first).id, :owner_type => 'GitHub::Organization'
end
if r = GitHub::Repo.where(conditions).first
r.get
else
r = GitHub::Repo.new(conditions).get
p r.parent
r
end
end
|