lita-enhance 0.9.1 → 0.9.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: 7f9ed20c0c2894e0f4d1ba24c6c2e504a58a1f68
4
- data.tar.gz: e146c0f5e9f850d5d1b9b9f00f04524c2bfeb799
3
+ metadata.gz: bab760c36e5ebb11ec2c0773f6de3c1096fc1582
4
+ data.tar.gz: 4139bbccc64e710503d0aec21d2b8b13ba0f87bb
5
5
  SHA512:
6
- metadata.gz: b9f889fbaebe8c3fb334c2d4545a26726e3540f2674de3eb4aa8dca78e4d33e94fbd08b731c4c27ead4dd15cea04d4dab34647e8c31cb3636c798a148def1159
7
- data.tar.gz: c7de265818f5108bba4a9f9bc24154a31356a206d2b5595a5d4626602b78fcbaef20264a618b5df55a48151a74a7cb7647088db5f919a663c7fae4cd2986cb06
6
+ metadata.gz: 5cdec5118bd90e90fa50427da94bd33e243bd76db7cbb067ec755928b094cce0bc5fa745129b2b92139d356935e6336c4fde8644f0971205d2397d3afb727b67
7
+ data.tar.gz: ae27a421db43c6cd1134297942257e154670c508ce79a477ba23b305d366e80c6102b652ec3a794ad0e25bbba16a620d206fdf042315112a4e36691e0d802f25
@@ -114,7 +114,7 @@ module Lita
114
114
  enhanced_message = session.enhance!(blurry_string, level)
115
115
 
116
116
  if enhanced_message != blurry_string
117
- response.reply(mono(enhanced_message))
117
+ response.reply(render_template('enhance', message: enhanced_message))
118
118
  else
119
119
  response.reply(no_change(t 'enhance.nothing_to_enhance'))
120
120
  end
@@ -191,16 +191,6 @@ module Lita
191
191
  message
192
192
  end
193
193
  end
194
-
195
- # Attempts to render the message using a monospaced font via adapter specific messaging
196
- def mono(message)
197
- case adapter
198
- when :hipchat
199
- "/quote #{message}"
200
- else
201
- message
202
- end
203
- end
204
194
  end
205
195
 
206
196
 
data/lib/lita-enhance.rb CHANGED
@@ -5,3 +5,8 @@ Lita.load_locales Dir[File.expand_path(
5
5
  )]
6
6
 
7
7
  require "lita/handlers/enhance"
8
+
9
+ Lita::Handlers::Enhance.template_root File.expand_path(
10
+ File.join("..", "..", "templates"),
11
+ __FILE__
12
+ )
data/lita-enhance.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-enhance"
3
- spec.version = "0.9.1"
3
+ spec.version = "0.9.2"
4
4
  spec.authors = ["Doug Barth"]
5
5
  spec.email = ["doug@pagerduty.com"]
6
6
  spec.description = %q{A Lita handler that enhances text by replacing opaque machine identifiers with that machine's hostname}
@@ -101,6 +101,17 @@ describe Lita::Handlers::Enhance, lita_handler: true do
101
101
  expect(replies).to include('I could not find anything to enhance')
102
102
  end
103
103
 
104
+ describe 'under Slack' do
105
+ before do
106
+ robot.config.robot.adapter = :slack
107
+ end
108
+
109
+ it 'should format the response with a code block' do
110
+ send_command('enhance 54.214.188.37')
111
+ expect(replies).to include('```*box01*```')
112
+ end
113
+ end
114
+
104
115
  describe 'under HipChat' do
105
116
  before do
106
117
  robot.config.robot.adapter = :hipchat
@@ -0,0 +1 @@
1
+ <%= @message %>
@@ -0,0 +1 @@
1
+ /quote <%= @message %>
@@ -0,0 +1 @@
1
+ ```<%= @message %>```
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-enhance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Barth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-10 00:00:00.000000000 Z
11
+ date: 2015-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -123,6 +123,9 @@ files:
123
123
  - spec/lita/handlers/enhance/session_spec.rb
124
124
  - spec/lita/handlers/enhance_spec.rb
125
125
  - spec/spec_helper.rb
126
+ - templates/enhance.erb
127
+ - templates/enhance.hipchat.erb
128
+ - templates/enhance.slack.erb
126
129
  homepage: https://github.com/PagerDuty/lita-enhance
127
130
  licenses:
128
131
  - MIT