lita-jira 0.7.2 → 0.8.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: 60daa5d9457d96452b4a5173475ea8d0100e3599
4
- data.tar.gz: dbe9dd305a9fb2d16131f3aadbd45de6371d60cf
3
+ metadata.gz: 48c00700fdf50c30b6ad579589c2fd0524c40910
4
+ data.tar.gz: 601010e495e0f28b68a3a7f854eb0af1c51bcb63
5
5
  SHA512:
6
- metadata.gz: 26a7c84e39b53e8efd70fa120b1917f6662df89162b947d2e8cb5b9c2f1048550c8e85a70deebb79d5f8583daff6d42465b6c71cf9d9a059b11afcace65f12ba
7
- data.tar.gz: 75e000b407485a88e511940c8aeacae0264914196de243fc6f1ba3643756d3414e996d632a3d639500b1571c3b4f3f4d25bf28a047993aa58b98cb33ecbc0266
6
+ metadata.gz: 9b64f58dc863e610feb45e334859b7b21af89a0ff2dfcde1ee49b82a19702781eeb8bcddba9ea0ac7aa486deeb9a789c2260a814b96a7d1c0877b447bf4ff470
7
+ data.tar.gz: 873c4fb13c1f868e55f1edc193aa675178b50cd0dc93b51808ce02b5dfe484b7ad2153f6544328249eaf99dd7b2b1100f6b1b9c29b3bf0a910ae051ff5dfd424
data/README.md CHANGED
@@ -33,6 +33,7 @@ config.handlers.jira.site = 'https://your.jira.instance.example.com/'
33
33
  * `ambient` (boolean) - When set to `true`, Lita will show JIRA issue details when a JIRA issue key is mentioned in chat, outside the context of a command. Default: `false`
34
34
  * `ignore` (array) - Prevent ambient JIRA issue detection in certain users' messages. Accepts user names, mention names, and IDs. Default: `[]`
35
35
  * `rooms` (array) - Limit ambient JIRA issue detection to a certain list of rooms. If unspecified, the bot will respond to detected issues in all rooms.
36
+ * `use_ssl` (boolean) - When set to `true`, an SSL connection will be used to JIRA. Set to `false` if you run JIRA over plain http.
36
37
 
37
38
  ``` ruby
38
39
  config.handlers.jira.context = '/myjira'
@@ -40,6 +41,7 @@ config.handlers.jira.format = 'one-line'
40
41
  config.handlers.jira.ambient = true
41
42
  config.handlers.jira.ignore = ['Jira', 'Github', 'U1234']
42
43
  config.handlers.jira.rooms = ['devtools', 'engineering']
44
+ config.handlers.jira.use_ssl = false
43
45
  ```
44
46
 
45
47
  ## Usage
@@ -2,15 +2,12 @@
2
2
  module JiraHelper
3
3
  # Issues
4
4
  module Issue
5
- # NOTE: Prefer this syntax here as it's cleaner
6
- # rubocop:disable Style/RescueEnsureAlignment
7
5
  def fetch_issue(key, expected = true)
8
6
  client.Issue.find(key)
9
- rescue
10
- log.error('JIRA HTTPError') if expected
11
- nil
7
+ rescue
8
+ log.error('JIRA HTTPError') if expected
9
+ nil
12
10
  end
13
- # rubocop:enable Style/RescueEnsureAlignment
14
11
 
15
12
  # Leverage the jira-ruby Issue.jql search feature
16
13
  #
@@ -20,15 +17,12 @@ module JiraHelper
20
17
  client.Issue.jql(jql)
21
18
  end
22
19
 
23
- # NOTE: Prefer this syntax here as it's cleaner
24
- # rubocop:disable Style/RescueEnsureAlignment
25
20
  def fetch_project(key)
26
21
  client.Project.find(key)
27
- rescue
28
- log.error('JIRA HTTPError')
29
- nil
22
+ rescue
23
+ log.error('JIRA HTTPError')
24
+ nil
30
25
  end
31
- # rubocop:enable Style/RescueEnsureAlignment
32
26
 
33
27
  # NOTE: Not breaking this function out just yet.
34
28
  # rubocop:disable Metrics/AbcSize
@@ -8,7 +8,8 @@ module JiraHelper
8
8
  password: config.password,
9
9
  site: config.site,
10
10
  context_path: config.context,
11
- auth_type: :basic
11
+ auth_type: :basic,
12
+ use_ssl: config.use_ssl
12
13
  )
13
14
  end
14
15
  end
@@ -8,6 +8,6 @@ module JiraHelper
8
8
  PROJECT_PATTERN = /(?<project>[a-zA-Z0-9]{1,10})/
9
9
  ISSUE_PATTERN = /(?<issue>#{PROJECT_PATTERN}-[0-9]{1,5}+)/
10
10
  EMAIL_PATTERN = /(?<email>[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+)/i
11
- AMBIENT_PATTERN = /\s#{ISSUE_PATTERN}/
11
+ AMBIENT_PATTERN = /(\s|^)#{ISSUE_PATTERN}/
12
12
  end
13
13
  end
@@ -15,6 +15,7 @@ module Lita
15
15
  config :ambient, required: false, types: [TrueClass, FalseClass], default: false
16
16
  config :ignore, required: false, type: Array, default: []
17
17
  config :rooms, required: false, type: Array
18
+ config :use_ssl, required: false, types: [TrueClass, FalseClass], default: true
18
19
 
19
20
  include ::JiraHelper::Issue
20
21
  include ::JiraHelper::Misc
@@ -109,7 +110,7 @@ module Lita
109
110
  return
110
111
  end
111
112
 
112
- return response.reply(t('myissues.empty')) unless issues.size > 0
113
+ return response.reply(t('myissues.empty')) if issues.empty?
113
114
 
114
115
  response.reply(format_issues(issues))
115
116
  end
data/lita-jira.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-jira'
3
- spec.version = '0.7.2'
4
- spec.authors = ['Eric Sigler', 'Matt Critchlow']
5
- spec.email = ['me@esigler.com', 'matt.critchlow@gmail.com']
3
+ spec.version = '0.8.0'
4
+ spec.authors = ['Eric Sigler', 'Matt Critchlow', 'Tristan Chong', 'Lee Briggs']
5
+ spec.email = ['me@esigler.com', 'matt.critchlow@gmail.com', 'ong@tristaneuan.ch', 'lee@brig.gs']
6
6
  spec.description = 'A JIRA plugin for Lita.'
7
7
  spec.summary = spec.description
8
8
  spec.homepage = 'https://github.com/esigler/lita-jira'
@@ -189,9 +189,10 @@ describe Lita::Handlers::Jira, lita_handler: true do
189
189
  end
190
190
 
191
191
  it 'shows details for a detected issue in a message' do
192
+ send_message('XYZ-987')
192
193
  send_message('foo XYZ-987 bar')
193
194
  send_message('foo XYZ-987?')
194
- expect(replies.size).to eq(2)
195
+ expect(replies.size).to eq(3)
195
196
  end
196
197
 
197
198
  it 'does not show details for a detected issue in a command' do
@@ -200,8 +201,10 @@ describe Lita::Handlers::Jira, lita_handler: true do
200
201
  end
201
202
 
202
203
  it 'does not show details for a issue in a URL-ish context' do
204
+ send_message('http://www.example.com/XYZ-987')
203
205
  send_message('http://www.example.com/XYZ-987.html')
204
206
  send_message('http://www.example.com/someother-XYZ-987.html')
207
+ send_message('TIL http://ruby-doc.org/core-2.3.0/Enumerable.html#method-i-each_slice')
205
208
  expect(replies.size).to eq(0)
206
209
  end
207
210
 
@@ -281,10 +284,10 @@ describe Lita::Handlers::Jira, lita_handler: true do
281
284
  grab_request(valid_client)
282
285
  send_command('jira myissues')
283
286
  expect(replies[-3..-1]).to eq([
284
- 'Here are issues currently assigned to you:',
285
- "[XYZ-987] Some summary text\nStatus: In Progress, assigned to: A Person, fixVersion: Sprint 2, priority: P0\nhttp://jira.local/browse/XYZ-987",
286
- "[XYZ-988] Some summary text 2\nStatus: In Progress 2, assigned to: A Person 2, fixVersion: none, priority: P1\nhttp://jira.local/browse/XYZ-988"
287
- ])
287
+ 'Here are issues currently assigned to you:',
288
+ "[XYZ-987] Some summary text\nStatus: In Progress, assigned to: A Person, fixVersion: Sprint 2, priority: P0\nhttp://jira.local/browse/XYZ-987",
289
+ "[XYZ-988] Some summary text 2\nStatus: In Progress 2, assigned to: A Person 2, fixVersion: none, priority: P1\nhttp://jira.local/browse/XYZ-988"
290
+ ])
288
291
  end
289
292
 
290
293
  it 'shows an error when the search fails' do
metadata CHANGED
@@ -1,15 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-jira
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Sigler
8
8
  - Matt Critchlow
9
+ - Tristan Chong
10
+ - Lee Briggs
9
11
  autorequire:
10
12
  bindir: bin
11
13
  cert_chain: []
12
- date: 2015-12-01 00:00:00.000000000 Z
14
+ date: 2016-02-26 00:00:00.000000000 Z
13
15
  dependencies:
14
16
  - !ruby/object:Gem::Dependency
15
17
  name: lita
@@ -127,6 +129,8 @@ description: A JIRA plugin for Lita.
127
129
  email:
128
130
  - me@esigler.com
129
131
  - matt.critchlow@gmail.com
132
+ - ong@tristaneuan.ch
133
+ - lee@brig.gs
130
134
  executables: []
131
135
  extensions: []
132
136
  extra_rdoc_files: []