lita-pullrequests 0.0.1 → 0.0.2

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: 70bef7ab4b7be5fc0e5f962cfb08398e2ff46cb1
4
- data.tar.gz: 825b2b2d31027dbe2cd8570fce5906ac33ec97e0
3
+ metadata.gz: 4dd5b417518a055224ceff19fc93b4855fa72a6e
4
+ data.tar.gz: 2e9da1a4c86869447103c22114875958ac284756
5
5
  SHA512:
6
- metadata.gz: 5996838b6aba9b79e3a725af316ea583a72f5506e152bfc3a71a004542b1557c6f432759388b0593a3f74208a51a55e1fe5e23cfbfb2bba26f67b48651c5d874
7
- data.tar.gz: 6971f04b3f2a9cb2b99af838b2a7a7cf7db2fb7cec27e37f0b242b5ed6f49212f0cf8c949a62bd0284f9c0588f9ef7922397ac5c7265122849d6dc22782b8a92
6
+ metadata.gz: e2ea4f78b1e1f4df961474fea3e9ee0f20a6f7cba6c07b6641a4c49fce7fb796c54e8875a102aa4ddda34e11d5c7f0a32fa4c02094a2cb6783de97369bafdd7a
7
+ data.tar.gz: 322ad9afa953af2626987d06257429caf6b7b38799daf31c1c250a592634f77f7ed711f3b0d28fc6847cc160052714ceb1a02f722c6c7b0ad5cf82432baec5c0
data/README.md CHANGED
@@ -18,7 +18,7 @@ Add the following configuration lines to your `lita_config`:
18
18
  config.handlers.pullrequests.access_token = "a-github-api-access-token"
19
19
  config.handlers.pullrequests.repo = "username/reponame"
20
20
  config.handlers.pullrequests.review_label = "title of a label that represents a pr ready for review"
21
- config.handlers.pullrequests.review_label = "title of a label that represents a pr ready for merge"
21
+ config.handlers.pullrequests.merge_label = "title of a label that represents a pr ready for merge"
22
22
  ```
23
23
 
24
24
  ## Usage
@@ -1,24 +1,24 @@
1
1
  module Lita
2
2
  module Handlers
3
3
  class Pullrequests < Handler
4
- config :access_token, type: String, required: true # bdaf08383ca76c58ab779ab8ff1ad7f6dc5bb3a4
4
+ config :access_token, type: String, required: true
5
5
  config :repo, type: String, required: true
6
6
  config :review_label, type: String, required: false
7
7
  config :merge_label, type: String, required: false
8
8
 
9
- route(/(pull request( me)?)|(give me something to review)/, :get_random_pr, command: true, help: {
9
+ route(/^(pull request( me)?)|(give me something to review)$/, :get_random_pr, command: true, help: {
10
10
  "give me something to review" => "Shows you a random pull request that needs reviewing.",
11
11
  "pull request (me)" => "Shows you a random pull request that needs reviewing."
12
12
  })
13
13
 
14
- route(/(summarize|all) pull requests/, :list_all_pull_requests, command: true, help: {
14
+ route(/^(summarize|all) pull requests$/, :list_all_pull_requests, command: true, help: {
15
15
  "(summarize|all) pull requests" => "Lists all pull requests that need action."
16
16
  })
17
17
 
18
18
 
19
19
  # Helper method
20
20
  def truncate(str, truncate_at, options = {})
21
- return dup unless str.length > truncate_at
21
+ return str unless str.length > truncate_at
22
22
 
23
23
  omission = options[:omission] || '...'
24
24
  length_with_room_for_omission = truncate_at - omission.length
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-pullrequests"
3
- spec.version = "0.0.1"
3
+ spec.version = "0.0.2"
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.}
@@ -2,17 +2,19 @@ require "spec_helper"
2
2
 
3
3
  describe Lita::Handlers::Pullrequests, lita_handler: true do
4
4
  before do
5
- Lita.config.handlers.pullrequests.access_token = "87084d4f3a658f2979a892b6cbf7be80b9949bcf"
5
+ Lita.config.handlers.pullrequests.access_token = ENV["GITHUB_ACCESS_TOKEN"]
6
6
  Lita.config.handlers.pullrequests.repo = "taylorlapeyre/lita-pullrequests"
7
7
  Lita.config.handlers.pullrequests.review_label = "Needs Review"
8
8
  Lita.config.handlers.pullrequests.merge_label = "Ready To Merge"
9
9
  end
10
10
 
11
- it { is_expected.to route_command("pull request") }
12
- it { is_expected.to route_command("pull request me") }
13
- it { is_expected.to route_command("give me something to review") }
14
- it { is_expected.to route_command("all pull requests") }
15
- it { is_expected.to route_command("summarize pull requests") }
11
+ it { is_expected.to route_command("pull request").to(:get_random_pr) }
12
+ it { is_expected.to route_command("pull request me").to(:get_random_pr) }
13
+ it { is_expected.to route_command("give me something to review").to(:get_random_pr) }
14
+ it { is_expected.to route_command("all pull requests").to(:list_all_pull_requests) }
15
+ it { is_expected.to route_command("summarize pull requests").to(:list_all_pull_requests) }
16
+
17
+ it { is_expected.to_not route_command("all pull requests").to(:get_random_pr) }
16
18
 
17
19
  it "can respond with a random pull request" do
18
20
  send_command("give me something to review")
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Lapeyre