github_cli 0.5.9 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. data/.travis.yml +1 -0
  2. data/CHANGELOG.md +12 -1
  3. data/Gemfile.lock +12 -10
  4. data/README.md +18 -0
  5. data/features/authorization.feature +53 -0
  6. data/features/blob.feature +1 -1
  7. data/features/download.feature +13 -11
  8. data/features/gist.feature +9 -1
  9. data/features/label.feature +11 -12
  10. data/features/member.feature +5 -4
  11. data/features/merging.feature +5 -4
  12. data/features/organization.feature +5 -4
  13. data/features/repository.feature +9 -1
  14. data/features/search.feature +5 -4
  15. data/github_cli.gemspec +1 -1
  16. data/lib/github_cli/api.rb +56 -49
  17. data/lib/github_cli/apis/assignee.rb +6 -6
  18. data/lib/github_cli/apis/authorization.rb +5 -5
  19. data/lib/github_cli/apis/blob.rb +6 -6
  20. data/lib/github_cli/apis/collaborator.rb +12 -12
  21. data/lib/github_cli/apis/commit.rb +6 -6
  22. data/lib/github_cli/apis/content.rb +9 -9
  23. data/lib/github_cli/apis/download.rb +15 -15
  24. data/lib/github_cli/apis/email.rb +9 -9
  25. data/lib/github_cli/apis/event.rb +24 -24
  26. data/lib/github_cli/apis/follower.rb +16 -15
  27. data/lib/github_cli/apis/fork.rb +6 -6
  28. data/lib/github_cli/apis/gist.rb +31 -30
  29. data/lib/github_cli/apis/hook.rb +6 -6
  30. data/lib/github_cli/apis/issue.rb +12 -12
  31. data/lib/github_cli/apis/key.rb +15 -15
  32. data/lib/github_cli/apis/label.rb +24 -26
  33. data/lib/github_cli/apis/member.rb +15 -27
  34. data/lib/github_cli/apis/merging.rb +3 -3
  35. data/lib/github_cli/apis/milestone.rb +15 -15
  36. data/lib/github_cli/apis/notification.rb +18 -18
  37. data/lib/github_cli/apis/organization.rb +9 -9
  38. data/lib/github_cli/apis/pull_request.rb +24 -24
  39. data/lib/github_cli/apis/reference.rb +15 -15
  40. data/lib/github_cli/apis/repository.rb +13 -12
  41. data/lib/github_cli/apis/search.rb +12 -12
  42. data/lib/github_cli/apis/starring.rb +15 -15
  43. data/lib/github_cli/apis/status.rb +6 -6
  44. data/lib/github_cli/apis/tag.rb +6 -6
  45. data/lib/github_cli/apis/team.rb +39 -39
  46. data/lib/github_cli/apis/tree.rb +6 -6
  47. data/lib/github_cli/apis/user.rb +9 -9
  48. data/lib/github_cli/apis/watching.rb +15 -15
  49. data/lib/github_cli/cli.rb +24 -16
  50. data/lib/github_cli/commands/assignees.rb +8 -2
  51. data/lib/github_cli/commands/authorizations.rb +10 -13
  52. data/lib/github_cli/commands/blobs.rb +9 -3
  53. data/lib/github_cli/commands/collaborators.rb +16 -4
  54. data/lib/github_cli/commands/commits.rb +11 -6
  55. data/lib/github_cli/commands/contents.rb +9 -6
  56. data/lib/github_cli/commands/downloads.rb +30 -6
  57. data/lib/github_cli/commands/emails.rb +12 -3
  58. data/lib/github_cli/commands/events.rb +30 -8
  59. data/lib/github_cli/commands/followers.rb +20 -5
  60. data/lib/github_cli/commands/forks.rb +6 -4
  61. data/lib/github_cli/commands/gists.rb +39 -12
  62. data/lib/github_cli/commands/hooks.rb +1 -1
  63. data/lib/github_cli/commands/issues.rb +15 -4
  64. data/lib/github_cli/commands/keys.rb +20 -5
  65. data/lib/github_cli/commands/labels.rb +53 -14
  66. data/lib/github_cli/commands/members.rb +28 -9
  67. data/lib/github_cli/commands/merging.rb +3 -2
  68. data/lib/github_cli/commands/milestones.rb +27 -15
  69. data/lib/github_cli/commands/notifications.rb +19 -11
  70. data/lib/github_cli/commands/organizations.rb +24 -5
  71. data/lib/github_cli/commands/pull_requests.rb +30 -8
  72. data/lib/github_cli/commands/references.rb +17 -5
  73. data/lib/github_cli/commands/repositories.rb +6 -4
  74. data/lib/github_cli/commands/search.rb +24 -6
  75. data/lib/github_cli/commands/starring.rb +19 -5
  76. data/lib/github_cli/commands/statuses.rb +7 -3
  77. data/lib/github_cli/commands/tags.rb +7 -3
  78. data/lib/github_cli/commands/teams.rb +52 -17
  79. data/lib/github_cli/commands/trees.rb +6 -2
  80. data/lib/github_cli/commands/users.rb +9 -3
  81. data/lib/github_cli/commands/watching.rb +19 -5
  82. data/lib/github_cli/vendor/thor/actions/directory.rb +2 -0
  83. data/lib/github_cli/vendor/thor/actions/empty_directory.rb +3 -19
  84. data/lib/github_cli/vendor/thor/actions/file_manipulation.rb +4 -1
  85. data/lib/github_cli/vendor/thor/actions.rb +1 -1
  86. data/lib/github_cli/vendor/thor/base.rb +20 -18
  87. data/lib/github_cli/vendor/thor/command.rb +1 -1
  88. data/lib/github_cli/vendor/thor/error.rb +0 -4
  89. data/lib/github_cli/vendor/thor/group.rb +4 -9
  90. data/lib/github_cli/vendor/thor/runner.rb +1 -1
  91. data/lib/github_cli/vendor/thor/shell/basic.rb +25 -7
  92. data/lib/github_cli/vendor/thor/version.rb +1 -1
  93. data/lib/github_cli/vendor/thor.rb +17 -2
  94. data/lib/github_cli/version.rb +1 -1
  95. data/spec/github_cli/api/configure_spec.rb +50 -0
  96. data/spec/github_cli/api/github_api_spec.rb +19 -0
  97. data/spec/github_cli/commands/assignees_spec.rb +1 -1
  98. data/spec/github_cli/commands/blobs_spec.rb +1 -1
  99. data/spec/github_cli/commands/collaborators_spec.rb +1 -1
  100. data/spec/github_cli/commands/commits_spec.rb +1 -1
  101. data/spec/github_cli/commands/contents_spec.rb +1 -1
  102. data/spec/github_cli/commands/downloads_spec.rb +35 -0
  103. data/spec/github_cli/commands/emails_spec.rb +1 -1
  104. data/spec/github_cli/commands/events_spec.rb +1 -1
  105. data/spec/github_cli/commands/followers_spec.rb +1 -1
  106. data/spec/github_cli/commands/forks_spec.rb +1 -1
  107. data/spec/github_cli/commands/gists_spec.rb +6 -1
  108. data/spec/github_cli/commands/issues_spec.rb +1 -1
  109. data/spec/github_cli/commands/keys_spec.rb +1 -1
  110. data/spec/github_cli/commands/labels_spec.rb +13 -3
  111. data/spec/github_cli/commands/members_spec.rb +46 -0
  112. data/spec/github_cli/commands/merging_spec.rb +1 -1
  113. data/spec/github_cli/commands/milestones_spec.rb +1 -1
  114. data/spec/github_cli/commands/notifications_spec.rb +1 -1
  115. data/spec/github_cli/commands/organizations_spec.rb +30 -0
  116. data/spec/github_cli/commands/pull_requests_spec.rb +1 -1
  117. data/spec/github_cli/commands/references_spec.rb +1 -1
  118. data/spec/github_cli/commands/repositories_spec.rb +5 -0
  119. data/spec/github_cli/commands/starring_spec.rb +1 -1
  120. data/spec/github_cli/commands/statuses_spec.rb +1 -1
  121. data/spec/github_cli/commands/tags_spec.rb +1 -1
  122. data/spec/github_cli/commands/teams_spec.rb +1 -1
  123. data/spec/github_cli/commands/trees_spec.rb +1 -1
  124. data/spec/github_cli/commands/users_spec.rb +1 -1
  125. data/spec/github_cli/commands/watching_spec.rb +1 -1
  126. metadata +27 -17
  127. data/spec/github_cli/api_spec.rb +0 -19
@@ -5,27 +5,27 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(user, repo, params, format)
9
- output format do
10
- github_api.repos.collaborators.list user, repo, params
8
+ def all(user, repo, params, options)
9
+ output options do
10
+ github_api(options).repos.collaborators.list user, repo, params
11
11
  end
12
12
  end
13
13
 
14
- def add(user, repo, collab, params, format)
15
- output format do
16
- github_api.repos.collaborators.add user, repo, collab, params
14
+ def add(user, repo, collab, params, options)
15
+ output options do
16
+ github_api(options).repos.collaborators.add user, repo, collab, params
17
17
  end
18
18
  end
19
19
 
20
- def collaborator?(user, repo, collab, params, format)
21
- output format do
22
- github_api.repos.collaborators.collaborator? user, repo, collab, params
20
+ def collaborator?(user, repo, collab, params, options)
21
+ output options do
22
+ github_api(options).repos.collaborators.collaborator? user, repo, collab, params
23
23
  end
24
24
  end
25
25
 
26
- def remove(user, repo, collab, params, format)
27
- output format do
28
- github_api.repos.collaborators.remove user, repo, collab, params
26
+ def remove(user, repo, collab, params, options)
27
+ output options do
28
+ github_api(options).repos.collaborators.remove user, repo, collab, params
29
29
  end
30
30
  end
31
31
  end
@@ -5,15 +5,15 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def get(user, repo, sha, params, format)
9
- output format do
10
- github_api.git_data.commits.get user, repo, sha, params
8
+ def get(user, repo, sha, params, options)
9
+ output options do
10
+ github_api(options).git_data.commits.get user, repo, sha, params
11
11
  end
12
12
  end
13
13
 
14
- def create(user, repo, params, format)
15
- output format do
16
- github_api.git_data.commits.create user, repo, params
14
+ def create(user, repo, params, options)
15
+ output options do
16
+ github_api(options).git_data.commits.create user, repo, params
17
17
  end
18
18
  end
19
19
  end
@@ -5,21 +5,21 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def get(user, repo, path, params, format)
9
- output format do
10
- github_api.repos.contents.get user, repo, path, params
8
+ def get(user, repo, path, params, options)
9
+ output options do
10
+ github_api(options).repos.contents.get user, repo, path, params
11
11
  end
12
12
  end
13
13
 
14
- def readme(user, repo, params, format)
15
- output format do
16
- github_api.repos.contents.readme user, repo, params
14
+ def readme(user, repo, params, options)
15
+ output options do
16
+ github_api(options).repos.contents.readme user, repo, params
17
17
  end
18
18
  end
19
19
 
20
- def archive(user, repo, params, format)
21
- output format do
22
- github_api.repos.contents.archive user, repo, params
20
+ def archive(user, repo, params, options)
21
+ output options do
22
+ github_api(options).repos.contents.archive user, repo, params
23
23
  end
24
24
  end
25
25
  end
@@ -5,33 +5,33 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(user, repo, params, format)
9
- output format do
10
- github_api.repos.downloads.list user, repo, params
8
+ def all(user, repo, params, options)
9
+ output options do
10
+ github_api(options).repos.downloads.list user, repo, params
11
11
  end
12
12
  end
13
13
 
14
- def get(user, repo, id, params, format)
15
- output format do
16
- github_api.repos.downloads.get user, repo, id, params
14
+ def get(user, repo, id, params, options)
15
+ output options do
16
+ github_api(options).repos.downloads.get user, repo, id, params
17
17
  end
18
18
  end
19
19
 
20
- def create(user, repo, params, format)
21
- output format do
22
- github_api.repos.downloads.create user, repo, params
20
+ def create(user, repo, params, options)
21
+ output options do
22
+ github_api(options).repos.downloads.create user, repo, params
23
23
  end
24
24
  end
25
25
 
26
- def upload(resource, filename, format)
27
- output format do
28
- github_api.repos.downloads.upload resource, filename
26
+ def upload(resource, filename, options)
27
+ output options do
28
+ github_api(options).repos.downloads.upload resource, filename
29
29
  end
30
30
  end
31
31
 
32
- def delete(user, repo, id, params, format)
33
- output format do
34
- github_api.repos.downloads.delete user, repo, id, params
32
+ def delete(user, repo, id, params, options)
33
+ output options do
34
+ github_api(options).repos.downloads.delete user, repo, id, params
35
35
  end
36
36
  end
37
37
  end
@@ -5,21 +5,21 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(params, format)
9
- output format do
10
- github_api.users.emails.list params
8
+ def all(params, options)
9
+ output options do
10
+ github_api(options).users.emails.list params
11
11
  end
12
12
  end
13
13
 
14
- def add(emails, params, format)
15
- output format do
16
- github_api.users.emails.add emails, params
14
+ def add(emails, params, options)
15
+ output options do
16
+ github_api(options).users.emails.add emails, params
17
17
  end
18
18
  end
19
19
 
20
- def delete(emails, params, format)
21
- output format do
22
- github_api.users.emails.delete emails, params
20
+ def delete(emails, params, options)
21
+ output options do
22
+ github_api(options).users.emails.delete emails, params
23
23
  end
24
24
  end
25
25
  end
@@ -5,51 +5,51 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def public(params, format)
9
- output format do
10
- github_api.activity.events.public params
8
+ def public(params, options)
9
+ output options do
10
+ github_api(options).activity.events.public params
11
11
  end
12
12
  end
13
13
 
14
- def repository(user, repo, params, format)
15
- output format do
16
- github_api.activity.events.repository user, repo, params
14
+ def repository(user, repo, params, options)
15
+ output options do
16
+ github_api(options).activity.events.repository user, repo, params
17
17
  end
18
18
  end
19
19
 
20
- def issue(user, repo, params, format)
21
- output format do
22
- github_api.activity.events.issue user, repo, params
20
+ def issue(user, repo, params, options)
21
+ output options do
22
+ github_api(options).activity.events.issue user, repo, params
23
23
  end
24
24
  end
25
25
 
26
- def network(user, repo, params, format)
27
- output format do
28
- github_api.activity.events.network user, repo, params
26
+ def network(user, repo, params, options)
27
+ output options do
28
+ github_api(options).activity.events.network user, repo, params
29
29
  end
30
30
  end
31
31
 
32
- def organization(org, params, format)
33
- output format do
34
- github_api.activity.events.organization org, params
32
+ def organization(org, params, options)
33
+ output options do
34
+ github_api(options).activity.events.organization org, params
35
35
  end
36
36
  end
37
37
 
38
- def received(user, params, format)
39
- output format do
40
- github_api.activity.events.received user, params
38
+ def received(user, params, options)
39
+ output options do
40
+ github_api(options).activity.events.received user, params
41
41
  end
42
42
  end
43
43
 
44
- def performed(user, params, format)
45
- output format do
46
- github_api.activity.events.performed user, params
44
+ def performed(user, params, options)
45
+ output options do
46
+ github_api(options).activity.events.performed user, params
47
47
  end
48
48
  end
49
49
 
50
- def user_org(user, org, params, format)
51
- output format do
52
- github_api.activity.events.user_org user, org, params
50
+ def user_org(user, org, params, options)
51
+ output options do
52
+ github_api(options).activity.events.user_org user, org, params
53
53
  end
54
54
  end
55
55
  end
@@ -5,33 +5,34 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(user, params, format)
9
- output format do
10
- github_api.users.followers.list user, params
8
+ def all(user, params, options)
9
+ args = user ? [user, params] : [params]
10
+ output options do
11
+ github_api(options).users.followers.list *args
11
12
  end
12
13
  end
13
14
 
14
- def following(user, params, format)
15
- output format do
16
- github_api.users.followers.following user, params
15
+ def following(user, params, options)
16
+ output options do
17
+ github_api(options).users.followers.following user, params
17
18
  end
18
19
  end
19
20
 
20
- def follower(user, params, format)
21
- output format do
22
- github_api.users.followers.following? user, params
21
+ def follower(user, params, options)
22
+ output options do
23
+ github_api(options).users.followers.following? user, params
23
24
  end
24
25
  end
25
26
 
26
- def follow(user, params, format)
27
- output format do
28
- github_api.users.followers.follow user, params
27
+ def follow(user, params, options)
28
+ output options do
29
+ github_api(options).users.followers.follow user, params
29
30
  end
30
31
  end
31
32
 
32
- def unfollow(user, params, format)
33
- output format do
34
- github_api.users.followers.unfollow user, params
33
+ def unfollow(user, params, options)
34
+ output options do
35
+ github_api(options).users.followers.unfollow user, params
35
36
  end
36
37
  end
37
38
  end
@@ -5,15 +5,15 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(user, repo, params, format)
9
- output format do
10
- github_api.repos.forks.list user, repo, params
8
+ def all(user, repo, params, options)
9
+ output options do
10
+ github_api(options).repos.forks.list user, repo, params
11
11
  end
12
12
  end
13
13
 
14
- def create(user, repo, params, format)
15
- output format do
16
- github_api.repos.forks.create user, repo, params
14
+ def create(user, repo, params, options)
15
+ output options do
16
+ github_api(options).repos.forks.create user, repo, params
17
17
  end
18
18
  end
19
19
  end
@@ -5,63 +5,64 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(params, format)
9
- output format do
10
- github_api.gists.list params
8
+ def all(params, options)
9
+ args = options[:public] ? ['public', params] : [params]
10
+ output options do
11
+ github_api(options).gists.list *args
11
12
  end
12
13
  end
13
14
 
14
- def starred(params, format)
15
- output format do
16
- github_api.gists.starred params
15
+ def starred(params, options)
16
+ output options do
17
+ github_api(options).gists.starred params
17
18
  end
18
19
  end
19
20
 
20
- def get(id, params, format)
21
- output format do
22
- github_api.gists.get id, params
21
+ def get(id, params, options)
22
+ output options do
23
+ github_api(options).gists.get id, params
23
24
  end
24
25
  end
25
26
 
26
- def create(params, format)
27
- output format do
28
- github_api.gists.create params
27
+ def create(params, options)
28
+ output options do
29
+ github_api(options).gists.create params
29
30
  end
30
31
  end
31
32
 
32
- def edit(id, params, format)
33
- output format do
34
- github_api.gists.edit id, params
33
+ def edit(id, params, options)
34
+ output options do
35
+ github_api(options).gists.edit id, params
35
36
  end
36
37
  end
37
38
 
38
- def star(id, params, format)
39
- output format do
40
- github_api.gists.star id, params
39
+ def star(id, params, options)
40
+ output options do
41
+ github_api(options).gists.star id, params
41
42
  end
42
43
  end
43
44
 
44
- def unstar(id, params, format)
45
- output format do
46
- github_api.gists.unstar id, params
45
+ def unstar(id, params, options)
46
+ output options do
47
+ github_api(options).gists.unstar id, params
47
48
  end
48
49
  end
49
50
 
50
- def starred?(id, params, format)
51
- output format do
52
- github_api.gists.starred? id, params
51
+ def starred?(id, params, options)
52
+ output options do
53
+ github_api(options).gists.starred? id, params
53
54
  end
54
55
  end
55
56
 
56
- def fork(id, params, format)
57
- output format do
58
- github_api.gists.fork id, params
57
+ def fork(id, params, options)
58
+ output options do
59
+ github_api(options).gists.fork id, params
59
60
  end
60
61
  end
61
62
 
62
- def delete(id, params, format)
63
- output format do
64
- github_api.gists.delete id, params
63
+ def delete(id, params, options)
64
+ output options do
65
+ github_api(options).gists.delete id, params
65
66
  end
66
67
  end
67
68
  end
@@ -6,37 +6,37 @@ module GithubCLI
6
6
  class << self
7
7
 
8
8
  def all(user, repo, params, options)
9
- output options[:format], options[:quiet] do
9
+ output options do
10
10
  github_api(options).repos.hooks.list user, repo, params
11
11
  end
12
12
  end
13
13
 
14
14
  def get(user, repo, id, params, options)
15
- output options[:format], options[:quiet] do
15
+ output options do
16
16
  github_api(options).repos.hooks.get user, repo, id, params
17
17
  end
18
18
  end
19
19
 
20
20
  def create(user, repo, params, options)
21
- output options[:format], options[:quiet] do
21
+ output options do
22
22
  github_api(options).repos.hooks.create user, repo, params
23
23
  end
24
24
  end
25
25
 
26
26
  def edit(user, repo, id, params, options)
27
- output options[:format], options[:quiet] do
27
+ output options do
28
28
  github_api(options).repos.hooks.edit user, repo, id, params
29
29
  end
30
30
  end
31
31
 
32
32
  def test(user, repo, id, params, options)
33
- output options[:format], options[:quiet] do
33
+ output options do
34
34
  github_api(options).repos.hooks.test user, repo, id, params
35
35
  end
36
36
  end
37
37
 
38
38
  def delete(user, repo, id, params, options)
39
- output options[:format], options[:quiet] do
39
+ output options do
40
40
  github_api(options).repos.hooks.delete user, repo, id, params
41
41
  end
42
42
  end
@@ -5,27 +5,27 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(arg, params, format)
9
- output format do
10
- github_api.issues.list arg, params
8
+ def all(arg, params, options)
9
+ output options do
10
+ github_api(options).issues.list arg, params
11
11
  end
12
12
  end
13
13
 
14
- def get(user, repo, id, params, format)
15
- output format do
16
- github_api.issues.get user, repo, id, params
14
+ def get(user, repo, id, params, options)
15
+ output options do
16
+ github_api(options).issues.get user, repo, id, params
17
17
  end
18
18
  end
19
19
 
20
- def create(user, repo, params, format)
21
- output format do
22
- github_api.issues.create user, repo, params
20
+ def create(user, repo, params, options)
21
+ output options do
22
+ github_api(options).issues.create user, repo, params
23
23
  end
24
24
  end
25
25
 
26
- def edit(user, repo, id, params, format)
27
- output format do
28
- github_api.issues.edit user, repo, id, params
26
+ def edit(user, repo, id, params, options)
27
+ output options do
28
+ github_api(options).issues.edit user, repo, id, params
29
29
  end
30
30
  end
31
31
  end
@@ -5,33 +5,33 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(user, repo, params, format)
9
- output format do
10
- github_api.repos.keys.list user, repo, params
8
+ def all(user, repo, params, options)
9
+ output options do
10
+ github_api(options).repos.keys.list user, repo, params
11
11
  end
12
12
  end
13
13
 
14
- def get(user, repo, id, params, format)
15
- output format do
16
- github_api.repos.keys.get user, repo, id, params
14
+ def get(user, repo, id, params, options)
15
+ output options do
16
+ github_api(options).repos.keys.get user, repo, id, params
17
17
  end
18
18
  end
19
19
 
20
- def create(user, repo, params, format)
21
- output format do
22
- github_api.repos.keys.create user, repo, params
20
+ def create(user, repo, params, options)
21
+ output options do
22
+ github_api(options).repos.keys.create user, repo, params
23
23
  end
24
24
  end
25
25
 
26
- def edit(user, repo, id, params, format)
27
- output format do
28
- github_api.repos.keys.edit user, repo, id, params
26
+ def edit(user, repo, id, params, options)
27
+ output options do
28
+ github_api(options).repos.keys.edit user, repo, id, params
29
29
  end
30
30
  end
31
31
 
32
- def delete(user, repo, id, params, format)
33
- output format do
34
- github_api.repos.keys.delete user, repo, id, params
32
+ def delete(user, repo, id, params, options)
33
+ output options do
34
+ github_api(options).repos.keys.delete user, repo, id, params
35
35
  end
36
36
  end
37
37
  end
@@ -5,55 +5,53 @@ module GithubCLI
5
5
 
6
6
  class << self
7
7
 
8
- def all(user, repo, params, format)
9
- output format do
10
- github_api.issues.labels.list user, repo, params
8
+ def all(user, repo, params, options)
9
+ output options do
10
+ github_api(options).issues.labels.list user, repo, params
11
11
  end
12
12
  end
13
13
 
14
- def get(user, repo, name, params, format)
15
- output format do
16
- github_api.issues.labels.get user, repo, name, params
14
+ def get(user, repo, name, params, options)
15
+ output options do
16
+ github_api(options).issues.labels.get user, repo, name, params
17
17
  end
18
18
  end
19
19
 
20
- def create(user, repo, params, format)
21
- output format do
22
- github_api.issues.labels.create user, repo, params
20
+ def create(user, repo, params, options)
21
+ output options do
22
+ github_api(options).issues.labels.create user, repo, params
23
23
  end
24
24
  end
25
25
 
26
- def update(user, repo, name, params, format)
27
- output format do
28
- github_api.issues.labels.update user, repo, name, params
26
+ def update(user, repo, name, params, options)
27
+ output options do
28
+ github_api(options).issues.labels.update user, repo, name, params
29
29
  end
30
30
  end
31
31
 
32
- def delete(user, repo, name, params, format)
33
- output format do
34
- github_api.issues.labels.delete user, repo, name, params
32
+ def delete(user, repo, name, params, options)
33
+ output options do
34
+ github_api(options).issues.labels.delete user, repo, name, params
35
35
  end
36
36
  end
37
37
 
38
38
  def add(user, repo, issue_id, *args)
39
- format, params = args.pop, args.pop
40
-
41
- output format do
42
- github_api.issues.labels.add user, repo, issue_id, args.flatten, params
39
+ options, params = args.pop, args.pop
40
+ output options do
41
+ github_api(options).issues.labels.add user, repo, issue_id, args.flatten, params
43
42
  end
44
43
  end
45
44
 
46
- def remove(user, repo, issue_id, label_id, params, format)
47
- output format do
48
- github_api.issues.labels.remove user, repo, issue_id, label_id, params
45
+ def remove(user, repo, issue_id, params, options)
46
+ output options do
47
+ github_api(options).issues.labels.remove user, repo, issue_id, params
49
48
  end
50
49
  end
51
50
 
52
51
  def replace(user, repo, issue_id, *args)
53
- format, params = args.pop, args.pop
54
-
55
- output format do
56
- github_api.issues.labels.replace user, repo, issue_id, args.flatten, params
52
+ options, params = args.pop, args.pop
53
+ output options do
54
+ github_api(options).issues.labels.replace user, repo, issue_id, args.flatten, params
57
55
  end
58
56
  end
59
57
  end