Permalink
Browse files

correctly calls the script

  • Loading branch information...
1 parent 267f115 commit 551b79d82841b4e1423d5081fa507b70fd0e30ed @purzelrakete purzelrakete committed Feb 20, 2009
Showing with 10 additions and 6 deletions.
  1. +7 −1 README.markdown
  2. +0 −2 TODO.textile
  3. +2 −2 lib/mini/irc.rb
  4. +1 −1 lib/mini/listener.rb
View
8 README.markdown
@@ -13,4 +13,10 @@ now send some data down the pipes!
echo "#musicteam,#legal,@alice New album uploaded: ..." | nc somemachine 12345
tail -f /var/log/important.log | nc somemachine 12345
-run stuff by typing ?command in the main mini channel or by dmsging mini bot. this will invoke miniminimini.rb with the command as an arg. place miniminimini.rb on your $PATH.
+run stuff by typing ?command in the main mini channel or by dmsging mini bot. this will invoke a script called miniminimini with the command as an arg. here's an example miniminimini:
+
+ #!/usr/local/bin/ruby
+
+ puts "called miniminimini with #{ ARGV.inspect }"
+
+place this on your $PATH and don't forget to chmod +x. check where ruby lives by typing `which ruby`, and replace the bang line above with your ruby path.
View
2 TODO.textile
@@ -1,5 +1,3 @@
* add buffering to avoid flooding
-* add !commands
-* only respond to ppl on main chan
* add sinatra
* add datamapper
View
4 lib/mini/irc.rb
@@ -26,8 +26,8 @@ def unwind(nicks)
IRC.moderators = nicks.split.map { |nick| nick.delete("@").delete("+") }
while job = (@queue ||= []).pop
- sender, bang = job
- say(%x{ #{ ruby -S miniminimini.rb bang[1..-1] } }) if IRC.moderators.include?(sender)
+ sender, cmd = job
+ say(%x{ miniminimini #{ cmd } }) if IRC.moderators.include?(sender)
end
end
View
2 lib/mini/listener.rb
@@ -2,7 +2,7 @@ module Mini
module Listener
mattr_accessor :connection
- # echo "#musicteam,#legal,@alice New album uploaded: ..." | nc -q0 somemachine 12345.
+ # echo "#musicteam,#legal,@alice New album uploaded: ..." | nc somemachine 12345.
def receive_data(data)
all, targets, *payload = *data.match(/^(([\#@]\S+,? ?)*)(.*)$/)
targets = targets.split(",").map { |target| target.strip }.uniq

0 comments on commit 551b79d

Please sign in to comment.