Permalink
Browse files

Fix up the google command so it actually messages people.

  • Loading branch information...
1 parent 2d9d387 commit 5c83c74a9c4e1d0dda57bbb5337e50add9d9e877 @radar radar committed Jan 6, 2009
Showing with 16 additions and 11 deletions.
  1. +2 −2 .gitignore
  2. +6 −6 leaves/logga/controller.rb
  3. +0 −1 libs/foliater.rb
  4. +8 −2 libs/genesis.rb
View
@@ -1,5 +1,5 @@
-config/seasons/helpa/database.yml
-config/seasons/helpa/stems.yml
+config/seasons/*/database.yml
+config/seasons/*/stems.yml
log/*
tmp/*
doc/*
View
@@ -1,10 +1,6 @@
# Controller for the logga leaf.
-gem 'activerecord', "2.1.2"
-require 'activerecord'
-ActiveRecord::Base.establish_connection(YAML::load(File.open("config/seasons/logga/database.yml", "r+"))["loglibrary"])
class Controller < Autumn::Leaf
- EXCLUSIONS = ["gg", "google"]
def who_command(stem, sender, reply_to, msg)
if authorized?(sender[:nick])
@@ -176,8 +172,12 @@ def update_classes(doc, prefix)
def google(host, stem, sender, msg, reply_to, opts)
return unless authorized?(sender[:nick])
message = "#{host}?q=#{msg.split(" ").join("+")}"
- message = opts[:directed_at] + ": #{message}" if opts[:directed_at]
- stem.message(message,reply_to)
+ if opts[:directed_at]
+ message = opts[:directed_at] + ": #{message}"
+ stem.message(message)
+ else
+ return message
+ end
end
def i_am_a_bot
View
@@ -171,7 +171,6 @@ def load_all_leaf_models
end
def load_leaf_models(leaf)
- model_code = nil
mod = config.leaf(leaf.options[:class], :module)
leaf.database do
Dir.glob("leaves/#{leaf.options[:class].snakecase}/models/*.rb").each { |model_file| require model_file }
View
@@ -11,6 +11,9 @@
require 'libs/speciator'
require 'libs/authentication'
+gem 'activerecord', "2.1.2"
+require 'activerecord'
+
AUTUMN_VERSION = "3.0 (7-4-08)"
module Autumn # :nodoc:
@@ -127,10 +130,13 @@ def load_shared_code
# PREREQS: load_season_settings
def load_databases
+ puts @season_dir
db_file = "#{@season_dir}/database.yml"
- if not File.exist? db_file then
+ if !File.exist?(db_file)
$NO_DATABASE = true
- return
+ else
+ file = YAML::load(File.open(db_file, 'r'))
+ ActiveRecord::Base.establish_connection(file[file.keys.first])
end
# gem 'extlib', '=0.9.8'
end

0 comments on commit 5c83c74

Please sign in to comment.