lita-pullrequests 0.0.7 → 0.0.8

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: f598e3c8f150c347901c12066061ceb86e18c566
4
- data.tar.gz: ffdc4af7b5102c4defd9ff843d06872d0dd3ced8
3
+ metadata.gz: c7fb70d9a92880f7968a8abd3630f910c92b5d9b
4
+ data.tar.gz: 6aeb680bddfb78388f945b2f0a9a4225a5bf0386
5
5
  SHA512:
6
- metadata.gz: b5de44cd9405946b5db91293523bad18b8980564536f031af1e4fe2a29582a5b93cb56680e17c3ceae195b23ddc18db7c6750709900124d8c1e6c6dae69e50bf
7
- data.tar.gz: 95b92f4fc37030bdcbd517b3f715064491a51c273aa914e4b0f45071e7c41e4868e347e6dca3e904d4c83a4495ed1b285d90835619cda4e8384d575ccad4e32b
6
+ metadata.gz: b9ba3e4c7f7832e3e8fabe3cb80d0ff157404d1de47dea185f1441db80762bee4e3d59592f6f27f9d5665c7e01affbe927062ff38c8e7f6e982da91991a2b13d
7
+ data.tar.gz: 92b0e722c461b6b6ff6930b29ef24a31c6e54d0662b0074241ec0fc6c04851258d9390a190f0922c6cc7b7a1b21f30a2c16ef865ba74f525f123ccaf4552b2ff
@@ -58,16 +58,17 @@ module Lita
58
58
  end
59
59
 
60
60
  def get_random_pr(chat)
61
- pulls = pulls_that_need_reviews.group_by { |pr| pr["url"].split("/")[-3] }
61
+ pulls_by_repo = pulls_that_need_reviews.group_by { |pr| pr["url"].split("/")[-3] }
62
62
  repo = chat.matches[0][0]
63
63
 
64
- if pulls[repo]
65
- pr = pulls[repo].sample
66
- if pr
64
+ if config.repos.map { |r| r.split("/")[1] }.include?(repo)
65
+ pulls = pulls_by_repo[repo]
66
+ if pulls
67
+ pr = pulls.sample
67
68
  title, user, url = pr["title"], pr["user"]["login"], pr["pull_request"]["html_url"]
68
69
  chat.reply "_#{title}_ - #{user} \n #{url}"
69
70
  else
70
- chat.reply "No pull requests need reviews right now!"
71
+ chat.reply "No pull requests need a review right now!"
71
72
  end
72
73
  else
73
74
  chat.reply("I'm not configured for a repo with that name.")
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-pullrequests"
3
- spec.version = "0.0.7"
3
+ spec.version = "0.0.8"
4
4
  spec.authors = ["Taylor Lapeyre"]
5
5
  spec.email = ["taylorlapeyre@gmail.com"]
6
6
  spec.description = %q{A Lita handler to help you keep track of your pull requests.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-pullrequests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Lapeyre