Permalink
Browse files

Adding ActiveWrapper initializer

  • Loading branch information...
1 parent 50e8db9 commit 27ecb71dbdac57e13de3b0982246a52bb0754508 @winton committed Jun 9, 2010
Showing with 19 additions and 2 deletions.
  1. +12 −1 lib/gem_template.rb
  2. +7 −1 require.rb
View
@@ -1,2 +1,13 @@
require File.expand_path("#{File.dirname(__FILE__)}/../require")
-Require.lib!
+Require.lib!
+
+class GemTemplate
+
+ def initialize(environment, root)
+ @db, @log, @mail = ActiveWrapper.setup(
+ :base => root,
+ :env => environment
+ )
+ @db.establish_connection
+ end
+end
View
@@ -3,13 +3,15 @@
require 'require'
Require do
+ gem(:active_wrapper, '=0.2.7') { require 'active_wrapper' }
gem :require, '=0.2.7'
gem(:rake, '=0.8.7') { require 'rake' }
gem :rspec, '=1.3.0'
gemspec do
author 'Winton Welsh'
dependencies do
+ gem :active_wrapper
gem :require
end
email 'mail@wintoni.us'
@@ -20,7 +22,11 @@
end
bin { require 'lib/gem_template' }
- lib { require 'lib/gem_template/gem_template' }
+
+ lib do
+ gem :active_wrapper
+ require 'lib/gem_template/gem_template'
+ end
rakefile do
gem(:rake) { require 'rake/gempackagetask' }

0 comments on commit 27ecb71

Please sign in to comment.