Created
July 9, 2011 15:52
-
-
Save yoshuki/1073686 to your computer and use it in GitHub Desktop.
Works with SW Notifier(http://saikyoline.jp/air/swn/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'socket' | |
module Kernel | |
def sw(*args) | |
args.each do |arg| | |
TCPSocket.open('localhost', 12345) {|s| s.write arg } | |
end | |
end | |
def sw_r(*args) | |
sw *(args.map {|a| "R:#{a}" }) | |
end | |
def sw_y(*args) | |
sw *(args.map {|a| "Y:#{a}" }) | |
end | |
def sw_g(*args) | |
sw *(args.map {|a| "G:#{a}" }) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment