Permalink
Browse files

Prepare for lib

  • Loading branch information...
1 parent a6ffc05 commit 4f8d90a35786fcbf673edce250099e978f363042 @jherdman jherdman committed Apr 23, 2008
Showing with 8 additions and 25 deletions.
  1. +8 −25 lib/viking.rb
View
@@ -1,28 +1,11 @@
-module Viking
- class Error < StandardError; end
-
- class << self
- attr_accessor :logger
- attr_accessor :default_engine
- attr_accessor :connect_options
- attr_writer :default_instance
+$:.unshift(File.dirname(__FILE__)) unless
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
- def default_instance
- @default_instance ||= connect(default_engine, connect_options)
- end
-
- def connect(engine, options)
- require "viking/#{engine}"
- Viking.const_get(engine.to_s.capitalize).new(options)
- end
-
- def verified?() default_instance.verified?; end
- def check_article(options = {}) default_instance.check_article(options); end
- def check_comment(options = {}) default_instance.check_comment(options); end
- def mark_as_spam(options = {}) default_instance.mark_as_spam(options); end
- def mark_as_ham(options = {}) default_instance.mark_as_ham(options); end
- def stats() default_instance.stats; end
- end
+## Load core extensions
+Dir[File.join(File.dirname(__FILE__), 'core_ext', '*.rb')].each do |core_ext|
+ require(core_ext)
end
-require 'viking/base'
+## Let's get this party started
+require 'viking/viking'
+require 'viking/version'

0 comments on commit 4f8d90a

Please sign in to comment.