Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gemified and created minictl, minigen
- Loading branch information
1 parent
0a332a8
commit bf23da0
Showing
14 changed files
with
86 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
- thanks to yakischloba and careo on #eventmachine | ||
- thanks to masuidrive (http://blog.masuidrive.jp/) for a helpful gist which i can't find anymore. it demonstrated irc+eventmachine. | ||
- thx 2 yakischloba and careo #eventmachine | ||
- thx 2 http://blog.masuidrive.jp/ for a irc+eventmachine gist. |
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
command, *args = ARGV | ||
Mini::Bot.run(command, args) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'erb' | ||
|
||
abort("mini create <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 } } | ||
|
||
puts "generated minictl into #{ dir }. edit, then start mini with `ruby minictl` in there." |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
%w{ rubygems eventmachine activesupport ostruct json sinatra }.each { |lib| require lib } | ||
%w{ rubygems eventmachine activesupport ostruct sinatra }.each { |lib| require lib } | ||
%w{ listener irc web bot }.each { |lib| require File.dirname(__FILE__) + "/mini/#{ lib }" } |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@@web = Sinatra.new do | ||
get("/:command/:secret") do | ||
Mini::IRC.connection.execute([params[:command], params.to_yaml].join(" ")) if params[:secret] == ENV['MINI_SECRET'] | ||
post("/:command/:secret") do | ||
command, secret = params.delete("command"), params.delete("secret") | ||
Mini::IRC.connection.execute([command, params].join(" ")) if @@secret | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Gem::Specification.new do |s| | ||
s.name = "mini" | ||
s.version = "0.9" | ||
|
||
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.has_rdoc = false | ||
s.rdoc_options = ["--line-numbers", "--inline-source"] | ||
s.homepage = "http://github.com/purzelrakete/mini" | ||
s.require_paths = %w{ lib } | ||
s.requirements = %w{ eventmachine activesupport sinatra } | ||
s.rubygems_version = "1.3.1" | ||
s.executables = %w{ minigen } | ||
s.summary = "a ruby eventmachine bot inspired by richard jones' irccat. interact via netcat, irc or web." | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!<%= %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 } | ||
|
||
abort("minictl <server> <port> <user> <password> <main channel> <channel2>. no hashes 4 chans pls. ") unless ARGV.length >= 4 | ||
server, port, user, password, *channels = ARGV | ||
|
||
# | ||
# Change defaults as needed here. | ||
# | ||
|
||
Mini::Bot.start \ | ||
:secret => '<%= (0...40).map{ 65.+(rand(25)).chr }.join %>', # randomly generated for you. | ||
:mini_port => 12345, | ||
:web_port => 2345, | ||
:server => server, | ||
:port => port, | ||
:user => user, | ||
:password => password, | ||
:channels => [*channels] |