From: Michael Orlitzky Date: Mon, 9 Apr 2012 00:50:11 +0000 (-0400) Subject: Restructure the lib directory to avoid name collisions. X-Git-Tag: 0.0.1~118 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=314f5670531dfda9b3d708fce8b0161a098cf134;p=mailshears.git Restructure the lib directory to avoid name collisions. --- diff --git a/bin/mailshears b/bin/mailshears index 5a8ee0a..96a3c30 100755 --- a/bin/mailshears +++ b/bin/mailshears @@ -13,21 +13,11 @@ # filesystem, but not the database. # -# Needed for rm_rf. -require 'fileutils' +require 'mailshears' # Load our config file. require 'configuration' -# And the necessary classes. -require 'errors.rb' -require 'exit_codes.rb' -require 'postfixadmin_db' - -Configuration::PLUGINS.each do |plugin_file| - require "plugins/#{plugin_file}" -end - pgadb = PostfixadminDb.new(Configuration::DBHOST, Configuration::DBPORT, Configuration::DBOPTS, diff --git a/lib/mailshears.rb b/lib/mailshears.rb new file mode 100644 index 0000000..75e38f0 --- /dev/null +++ b/lib/mailshears.rb @@ -0,0 +1,11 @@ +# Load the rest of the code we'll use. + +# And the necessary classes. +require 'mailshears/errors.rb' +require 'mailshears/exit_codes.rb' +require 'mailshears/postfixadmin_db' + +Configuration::PLUGINS.each do |plugin_file| + require "mailshears/plugins/#{plugin_file}" +end + diff --git a/lib/errors.rb b/lib/mailshears/errors.rb similarity index 100% rename from lib/errors.rb rename to lib/mailshears/errors.rb diff --git a/lib/exit_codes.rb b/lib/mailshears/exit_codes.rb similarity index 100% rename from lib/exit_codes.rb rename to lib/mailshears/exit_codes.rb diff --git a/lib/filesystem.rb b/lib/mailshears/filesystem.rb similarity index 100% rename from lib/filesystem.rb rename to lib/mailshears/filesystem.rb diff --git a/lib/mailstore.rb b/lib/mailshears/mailstore.rb similarity index 100% rename from lib/mailstore.rb rename to lib/mailshears/mailstore.rb diff --git a/lib/plugin.rb b/lib/mailshears/plugin.rb similarity index 100% rename from lib/plugin.rb rename to lib/mailshears/plugin.rb diff --git a/lib/plugins/dovecot_mailstore.rb b/lib/mailshears/plugins/dovecot_mailstore.rb similarity index 95% rename from lib/plugins/dovecot_mailstore.rb rename to lib/mailshears/plugins/dovecot_mailstore.rb index df541b8..c50b117 100644 --- a/lib/plugins/dovecot_mailstore.rb +++ b/lib/mailshears/plugins/dovecot_mailstore.rb @@ -1,7 +1,10 @@ -require 'errors' -require 'filesystem' -require 'mailstore' -require 'plugin' +# Needed for rm_rf. +require 'fileutils' + +require 'mailshears/errors' +require 'mailshears/filesystem' +require 'mailshears/mailstore' +require 'mailshears/plugin' class DovecotMailstore < Mailstore diff --git a/lib/plugins/roundcube_db.rb b/lib/mailshears/plugins/roundcube_db.rb similarity index 100% rename from lib/plugins/roundcube_db.rb rename to lib/mailshears/plugins/roundcube_db.rb diff --git a/lib/postfixadmin_db.rb b/lib/mailshears/postfixadmin_db.rb similarity index 100% rename from lib/postfixadmin_db.rb rename to lib/mailshears/postfixadmin_db.rb