Skip to content

Commit 71ebef0

Browse files
committed
add Repository#name_with_owner
1 parent f2633b6 commit 71ebef0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/service/structs.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ def url
2525
class Repository < Struct.new(:id, :source_id, :name, :owner)
2626
extend StructLoading
2727

28+
def name_with_owner
29+
@name_with_owner ||= "#{owner.login}/#{name}"
30+
end
31+
2832
def url
2933
owner.url << "/#{name}"
3034
end

test/service_app_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def test_json_post
6969

7070
assert_equal "https://github.com/github", svc.meta.repository.owner.url
7171
assert_equal "https://github.com/github/octocat", svc.meta.repository.url
72+
assert_equal "github/octocat", svc.meta.repository.name_with_owner
7273
end
7374

7475
def test_nagios_check

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy