Permalink
Browse files

everything working

  • Loading branch information...
1 parent bf23da0 commit 7ec2cbe786ae1a53c00851c88ca123a6f381e96c @purzelrakete purzelrakete committed Mar 7, 2009
Showing with 26 additions and 21 deletions.
  1. +0 −2 bin/minicmd
  2. +7 −5 bin/minigen
  3. +2 −2 lib/mini/bot.rb
  4. +1 −1 lib/mini/irc.rb
  5. +2 −3 mini.gemspec
  6. +14 −0 scripts/minicmd.erb
  7. +0 −8 scripts/minictl.erb
View
@@ -1,2 +0,0 @@
-command, *args = ARGV
-Mini::Bot.run(command, args)
View
@@ -1,9 +1,11 @@
require 'erb'
-abort("mini create <directory>") unless ARGV.first == "create" && dir = Dir[ARGV.last].first
+abort("mini create <mini-directory>") unless ARGV.first == "create" && dir = Dir[ARGV.last].first
-target = dir.chomp('/') + '/minictl'
-File.open(target, 'w') { |f| f.write(ERB.new(IO.read(File.dirname(__FILE__) + '/../scripts/minictl.erb')).result) }
-%x{ chmod +x #{ target } }
+%w{ minictl minicmd }.each do |script|
+ target = dir.chomp('/') + '/' + script
+ File.open(target, 'w') { |f| f.write(ERB.new(IO.read(File.dirname(__FILE__) + "/../scripts/#{ script }.erb")).result) }
+ %x{ chmod +x #{ target } }
+end
-puts "generated minictl into #{ dir }. edit, then start mini with `ruby minictl` in there."
+puts "generated files into #{ dir }. edit files, then add #{ dir } to your $PATH in your shell rc file. start with minictl."
View
@@ -6,9 +6,9 @@ class Bot
def self.start(options)
EventMachine::run do
Mini::IRC.connect(options)
- EventMachine::start_server("0.0.0.0", options[:mini_port], Mini::Listener)
+ EventMachine::start_server("0.0.0.0", options[:mini_port].to_i, Mini::Listener)
@@secret = options[:secret]
- @@web.run! :port => options[:web_port]
+ @@web.run! :port => options[:web_port].to_i
end
end
View
@@ -43,7 +43,7 @@ def execute(cmd)
end
def self.connect(options)
- self.connection = EM.connect(options[:server], (options[:port] || "6667").to_i, self, options)
+ self.connection = EM.connect(options[:server], options[:port].to_i, self, options)
end
# callbacks
View
@@ -1,13 +1,12 @@
Gem::Specification.new do |s|
s.name = "mini"
- s.version = "0.9"
-
+ s.version = "0.9.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = %w{ Rany Keddo }
s.date = "2009-03-01"
s.email = "purzelrakete@gmail.com"
s.extra_rdoc_files = %w{ README.markdown }
- s.files = ["CREDITS.markdown", "LICENSE.markdown", "README.markdown", "TODO.markdown", "bin/minigen", "bin/minicmd", "lib/mini", "lib/mini/bot.rb", "lib/mini/irc.rb", "lib/mini/listener.rb", "lib/mini/web.rb", "lib/mini.rb", "scripts/minictl.erb",]
+ s.files = ["CREDITS.markdown", "LICENSE.markdown", "README.markdown", "TODO.markdown", "bin/minigen", "lib/mini", "lib/mini/bot.rb", "lib/mini/irc.rb", "lib/mini/listener.rb", "lib/mini/web.rb", "lib/mini.rb", "scripts/minicmd.erb", "scripts/minictl.erb",]
s.has_rdoc = false
s.rdoc_options = ["--line-numbers", "--inline-source"]
s.homepage = "http://github.com/purzelrakete/mini"
View
@@ -0,0 +1,14 @@
+#!<%= %x{ which ruby } %>
+require 'rubygems'
+require 'mini'
+
+#
+# require any plugins you want to load into the default minicmd:
+# require 'mini_my_plugin'
+#
+# or write some commands straight into here, like...
+#
+Mini::Bot.commands["echo"] = lambda { |*args| puts args }
+
+command, *args = ARGV
+Mini::Bot.run(command, args)
View
@@ -2,14 +2,6 @@
require 'rubygems'
require 'mini'
-#
-# require any plugins you want to load into the default minicmd:
-# require 'mini_my_plugin'
-#
-# or write some commands straight into here, like...
-#
-Mini::Bot.commands["echo"] = lambda { |*args| puts args }
-
abort("minictl <server> <port> <user> <password> <main channel> <channel2>. no hashes 4 chans pls. ") unless ARGV.length >= 4
server, port, user, password, *channels = ARGV

0 comments on commit 7ec2cbe

Please sign in to comment.