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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a8031619193c513be736c5ab30c7a042f8e7904
4
- data.tar.gz: f5cafa72ed70367ffe54ff72bb4aecc1f194e8e3
3
+ metadata.gz: e95a4831033d91c23789d7acd01976b7ad7772a8
4
+ data.tar.gz: 824e1d5b8dad51e051a317d79ef02f1057a28c57
5
5
  SHA512:
6
- metadata.gz: af14129f93d13f70895fb58193572b748e068db7c18d4330819442f80867be97705234510b1d0e4fb19158a621ae86aabf0e91b29f2fd02c2d56a0a895be9f83
7
- data.tar.gz: e886bd47ca666e7c2024f231eccbe1b1e0396a246b19143f0500571d4427c4848e74d46b7235c8ad12a763d33fd2b8226c36617c3c74b9f8d880a4133c127a5e
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
+ [![Gem Version](http://img.shields.io/gem/v/lita-jira-issues.svg)](https://rubygems.org/gems/lita-jira-issues)
3
4
  [![Build Status](http://img.shields.io/travis/amaltson/lita-jira-issues.svg)](https://travis-ci.org/amaltson/lita-jira-issues)
4
5
  [![Code Climate](http://img.shields.io/codeclimate/github/amaltson/lita-jira-issues.svg)](https://codeclimate.com/github/amaltson/lita-jira-issues)
5
6
  [![Coverage Status](http://img.shields.io/coveralls/amaltson/lita-jira-issues.svg)](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
- def initialize(*args)
8
- super(args)
9
- @jira = JiraGateway.new(http, config)
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
- unless configured?
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?
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-jira-issues"
3
- spec.version = "0.1.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", "~> 3.3"
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 'should fail to start without configuration' do
6
- send_message('Trying to use JIRA_123 not configured')
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
@@ -8,3 +8,5 @@ SimpleCov.start { add_filter "/spec/" }
8
8
 
9
9
  require "lita-jira-issues"
10
10
  require "lita/rspec"
11
+
12
+ Lita.version_3_compatibility_mode = false
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.1.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: '3.3'
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: '3.3'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement