lita-github_pr_list 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92954eb65ab5ee5e43a5efc4ceff2739ed631dc4
4
- data.tar.gz: b7c95004063f30bcca990cf590a8b4063fe0a9db
3
+ metadata.gz: cd136b46fd37967324c1e940dfc9206fd3a1f92e
4
+ data.tar.gz: f7b266b71e0db502fe7fe35b078c1ace31720a60
5
5
  SHA512:
6
- metadata.gz: d4ebb88010886876c09ce16f37b95019079ebc7aadd2430cadfb8a61ed3fb9955d49d7e4c1af07baede2dad81f4afc146122e73078fd6140523e6d625b0bef0d
7
- data.tar.gz: 7d9466eae44d281956e3cac6fb5ac4edb09f0dcb7bf2af4f35083f7093409bdd7ce89cb1ce58adf64cb46a09a2135eab44c170921dc9af7678e4c51d6d47c878
6
+ metadata.gz: d9e2fecd95d0a77b25c14b032ebee689128ea7e5b9a7758a0f2c939c3098ac1dd1cfa5b6c1124d59718949b05372fb30bec185613d8f8459723738d43ddddbd4
7
+ data.tar.gz: 9ac698d88b237191bc1639c170afa24e4e83dcb5df6b2daf9990c2d5516ca72b0d41f138f4b9a83dc0eebcd83826cdb820f08ef4bbab95aa732816fa4f5ffdd4
@@ -1,5 +1,5 @@
1
1
  module Lita
2
2
  module GithubPrList
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -20,8 +20,7 @@ module Lita
20
20
 
21
21
  def add_hooks
22
22
  response.reply "Adding webhooks to #{github_organization}, this may take awhile..."
23
-
24
- github_client.repositories(github_organization).each do |repo|
23
+ github_client.organization_repositories(github_organization, type: 'all').each do |repo|
25
24
  begin
26
25
  create_hook(repo.full_name)
27
26
  rescue => ex
@@ -37,7 +36,7 @@ module Lita
37
36
  def remove_hooks
38
37
  response.reply "Removing #{web_hook} webhooks from #{github_organization}, this may take awhile..."
39
38
 
40
- github_client.repositories(github_organization).each do |repo|
39
+ github_client.organization_repositories(github_organization, åtype: 'all').each do |repo|
41
40
  github_client.hooks(repo.full_name).each do |hook|
42
41
  if hook.config.url == web_hook
43
42
  github_client.remove_hook(repo.full_name, hook.id)
@@ -30,7 +30,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
30
30
  it { routes_command("pr remove hooks").to(:remove_pr_hooks) }
31
31
 
32
32
  it "adds web hooks to an org's repos" do
33
- expect_any_instance_of(Octokit::Client).to receive(:repositories).and_return(repos)
33
+ expect_any_instance_of(Octokit::Client).to receive(:organization_repositories).and_return(repos)
34
34
  expect_any_instance_of(Octokit::Client).to receive(:create_hook).twice.and_return(nil)
35
35
 
36
36
  send_command("pr add hooks")
@@ -40,7 +40,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
40
40
  end
41
41
 
42
42
  it "removes web hooks from an org's repos" do
43
- expect_any_instance_of(Octokit::Client).to receive(:repositories).and_return(repos)
43
+ expect_any_instance_of(Octokit::Client).to receive(:organization_repositories).and_return(repos)
44
44
  expect_any_instance_of(Octokit::Client).to receive(:hooks).twice.and_return(hooks)
45
45
  expect_any_instance_of(Octokit::Client).to receive(:remove_hook).twice.and_return(nil)
46
46
 
@@ -51,7 +51,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
51
51
  end
52
52
 
53
53
  it "catches exceptions when the hook already exists and continues" do
54
- expect_any_instance_of(Octokit::Client).to receive(:repositories).and_return(repos)
54
+ expect_any_instance_of(Octokit::Client).to receive(:organization_repositories).and_return(repos)
55
55
  expect_any_instance_of(Octokit::Client).to receive(:create_hook).twice.and_return(nil)
56
56
  exception = Octokit::UnprocessableEntity.new
57
57
  allow(exception).to receive(:errors).and_return([OpenStruct.new(message: "Hook already exists on this repository")])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-github_pr_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken