Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Added monospaced templates for slack
Browse files Browse the repository at this point in the history
  • Loading branch information
brodock committed Aug 14, 2015
1 parent 01e34bd commit e358e21
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/lita-cowsay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
)]

require "lita/handlers/cowsay"

Lita::Handlers::Cowsay.template_root File.expand_path(
File.join("..", "..", "templates"), __FILE__
)
2 changes: 1 addition & 1 deletion lib/lita/handlers/cowsay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Cowsay < Handler

def cowsay(response)
text = response.args.join(" ")
response.reply Cow.new.say(text)
response.reply render_template("monospaced", cowsay: Cow.new.say(text))
end
end

Expand Down
1 change: 1 addition & 0 deletions templates/monospaced.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= @cowsay %>
3 changes: 3 additions & 0 deletions templates/monospaced.slack.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```
<%= @cowsay %>
```

0 comments on commit e358e21

Please sign in to comment.