lita-jira-issues 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/lita/handlers/jira_issues.rb +4 -16
- data/lita-jira-issues.gemspec +2 -2
- data/spec/lita/handlers/jira_issues_spec.rb +2 -6
- data/spec/spec_helper.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e95a4831033d91c23789d7acd01976b7ad7772a8
|
4
|
+
data.tar.gz: 824e1d5b8dad51e051a317d79ef02f1057a28c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a74037ccfcce383aba01ab2ed0536492e3e436a4a54ed19a8adf0e2f24ea219f9d14994b4f2e8e675714b9ed0cbcedc2680cc3783fa71a60b44b5c362d5d5c8
|
7
|
+
data.tar.gz: af2817980dafb19f46eaabb0c3162c88635a81d19b5d5fd90a927e8831592031e1909f9a473e2be31202735a611d7e324eb398eea75a271b38ff4810417e190e
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# lita-jira-issues
|
2
2
|
|
3
|
+
[](https://rubygems.org/gems/lita-jira-issues)
|
3
4
|
[](https://travis-ci.org/amaltson/lita-jira-issues)
|
4
5
|
[](https://codeclimate.com/github/amaltson/lita-jira-issues)
|
5
6
|
[](https://coveralls.io/r/amaltson/lita-jira-issues)
|
@@ -8,6 +9,9 @@ Lita handler for showing JIRA issue details when a JIRA issue key is mentioned i
|
|
8
9
|
chat. Inspired by the [Hubot jira-issue
|
9
10
|
plugin](https://github.com/github/hubot-scripts/blob/master/src/scripts/jira-issues.coffee)
|
10
11
|
|
12
|
+
**Note**: Version 0.2+ of this hander require Lita 4. If you'd like to use this
|
13
|
+
handler with Lita 3.x, please use version 0.1
|
14
|
+
|
11
15
|
## Installation
|
12
16
|
|
13
17
|
Add lita-jira-issues to your Lita instance's Gemfile:
|
@@ -4,33 +4,21 @@ module Lita
|
|
4
4
|
module Handlers
|
5
5
|
class JiraIssues < Handler
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.default_config(config)
|
13
|
-
config.enabled = true
|
14
|
-
end
|
7
|
+
config :url, required: true, type: String
|
8
|
+
config :username, required: true, type: String
|
9
|
+
config :password, required: true, type: String
|
15
10
|
|
16
11
|
route /[a-zA-Z]+-\d+/, :jira_message, help: {
|
17
12
|
"KEY-123" => "Replies with information about the given JIRA key"
|
18
13
|
}
|
19
14
|
|
20
15
|
def jira_message(response)
|
21
|
-
|
22
|
-
raise 'Need to configure url, username, password for jira_issues ' \
|
23
|
-
'to work'
|
24
|
-
end
|
16
|
+
@jira ||= JiraGateway.new(http, config)
|
25
17
|
response.matches.each do | key |
|
26
18
|
handle_key(response, key)
|
27
19
|
end
|
28
20
|
end
|
29
21
|
|
30
|
-
def configured?
|
31
|
-
config.url && config.username && config.password
|
32
|
-
end
|
33
|
-
|
34
22
|
def handle_key(response, key)
|
35
23
|
data = @jira.data_for_issue(key)
|
36
24
|
return if data.empty?
|
data/lita-jira-issues.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-jira-issues"
|
3
|
-
spec.version = "0.
|
3
|
+
spec.version = "0.2.0"
|
4
4
|
spec.authors = ["Arthur Maltson"]
|
5
5
|
spec.email = ["arthur@maltson.com"]
|
6
6
|
spec.description = "Lita handler to show JIRA issue details"
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
-
spec.add_runtime_dependency "lita", "~>
|
18
|
+
spec.add_runtime_dependency "lita", "~> 4.0"
|
19
19
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 1.3"
|
21
21
|
spec.add_development_dependency "rake", "~> 10.3"
|
@@ -2,12 +2,8 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Lita::Handlers::JiraIssues, lita_handler: true do
|
4
4
|
|
5
|
-
it
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
it { routes('JIRA-123').to(:jira_message) }
|
10
|
-
it { routes('user talking about something JIRA-123 had key').to(:jira_message) }
|
5
|
+
it { is_expected.to route('JIRA-123').to(:jira_message) }
|
6
|
+
it { is_expected.to route('user talking about something JIRA-123 had key').to(:jira_message) }
|
11
7
|
|
12
8
|
describe 'Looking up keys' do
|
13
9
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-jira-issues
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Maltson
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|