Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Switch to mIRC colors #465

Merged
merged 1 commit into from

2 participants

@AI0867

No description provided.

@technoweenie technoweenie merged commit 86b528e into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 30, 2012
  1. @AI0867

    Switch to mIRC colors

    AI0867 authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +1 −1  docs/irker
  2. +6 −6 services/irker.rb
View
2  docs/irker
@@ -4,6 +4,6 @@
4. `branch` lets you specify the branch name, or a template with `%s` to fill the branch name in.
5. `long_urls` enables full URLs instead of shortened URLs.
6. `module` sets the module name in the project.
-7. `color` adds ANSI color codes to the message.
+7. `color` adds mIRC color codes to the message.
8. `full_commits` sends multiple messages to show up to 5 lines of the commit message.
View
12 services/irker.rb
@@ -62,11 +62,11 @@ def build_irker_commit(repository, branch, sha1, commit, module_name)
channels = data['channels'].split(";")
if data['color'].to_i == 1 then
- bold = "\x1b[1m"
- green = "\x1b[1;32m"
- yellow = "\x1b[1;33m"
- brown = "\x1b[33m"
- reset = "\x1b[0m"
+ bold = "\x02"
+ green = "\x0303"
+ yellow = "\x0307"
+ brown = "\x0305"
+ reset = "\x0F"
else
bold = green = yellow = brown = reset = ''
end
@@ -90,7 +90,7 @@ def build_irker_commit(repository, branch, sha1, commit, module_name)
messages.push JSON.generate({'to' => channels, 'privmsg' => privmsg.strip})
log_lines[0..4].each do |log_line|
privmsg = <<-PRIVMSG
- #{repository}: #{log_line[0..400]}
+ #{bold}#{repository}:#{reset} #{log_line[0..400]}
PRIVMSG
messages.push JSON.generate({'to' => channels, 'privmsg' => privmsg.strip})
end
Something went wrong with that request. Please try again.