Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

correctly calls the script

  • Loading branch information...
commit 551b79d82841b4e1423d5081fa507b70fd0e30ed 1 parent 267f115
Rany Keddo purzelrakete authored
8 README.markdown
View
@@ -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.
2  TODO.textile
View
@@ -1,5 +1,3 @@
* add buffering to avoid flooding
-* add !commands
-* only respond to ppl on main chan
* add sinatra
* add datamapper
4 lib/mini/irc.rb
View
@@ -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
2  lib/mini/listener.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.