Commit 72e0f44

unknown <mkhan@.arcresources.ca>
2009-10-14 18:52:34
cleaned up the rake file a bit. implemented missing method in database command. main
1 parent 5e84bd8
Changed files (2)
product
application
product/application/data/SqlDatabaseCommand.cs
@@ -1,4 +1,3 @@
-using System;
 using System.Collections.Generic;
 using System.Data;
 
@@ -11,11 +10,22 @@ namespace gorilla.migrations.data
         public SqlDatabaseCommand(IDbConnection connection)
         {
             this.connection = connection;
+			this.connection.Open();
         }
 
         public IEnumerable<DataRow> run(string sql)
         {
-            throw new NotImplementedException();
+            var table = new DataTable();
+            using (var command = connection.CreateCommand())
+            {
+                command.CommandText = sql;
+                command.CommandType = CommandType.Text;
+                table.Load( command.ExecuteReader());
+            }
+            foreach (DataRow row in table.Rows)
+            {
+                yield return row;
+            }
         }
 
         public void run(SqlFile sql)
@@ -34,4 +44,4 @@ namespace gorilla.migrations.data
             connection.Dispose();
         }
     }
-}
\ No newline at end of file
+}
rakefile.rb
@@ -22,9 +22,6 @@ end
 template_files = TemplateFileList.new('**/*.template')
 template_code_dir = File.join('product','templated_code')
 
-sql_runner = SqlRunner.new :sql_tool => local_settings[:osql_exe] , :connection_string => local_settings[:osql_connectionstring]
-
-
 #configuration files
 config_files = FileList.new(File.join('product','config','*.template')).select{|fn| ! fn.include?('app.config')}
 app_config = TemplateFile.new(File.join('product','config',local_settings[:app_config_template]))
@@ -35,7 +32,7 @@ project_test_dir  = File.join('product',"#{Project.tests_dir}",'bin','debug')
 
 output_folders = [project_startup_dir,project_test_dir]
 
-task :default => [:build_db,:test]
+task :default => [:test]
 
 task :clean do
 	FileUtils.rm_rf('artifacts')
@@ -48,30 +45,21 @@ task :init => :clean do
   mkdir "artifacts/deploy/#{Project.name}"
 end
 
-task :expand_all_template_files do
-  template_files.generate_all_output_files(local_settings.settings)
-end
-
-task :build_db => :expand_all_template_files do
-    sql_runner.process_sql_files(create_sql_fileset('ddl'))
-end
-
-task :load_data => :build_db do
-    sql_runner.process_sql_files(create_sql_fileset('data'))
-end
-
-task :compile => :expand_all_template_files do
+task :compile do
   MSBuildRunner.compile :compile_target => COMPILE_TARGET, :solution_file => 'solution.sln'
 end
 
 task :test, :category_to_exclude, :needs => [:compile] do |t,args|
-  puts Project.startup_dir
   runner = MbUnitRunner.new :compile_target => COMPILE_TARGET, :category_to_exclude => 'SLOW', :show_report => true, :report_type => "text"
   runner.execute_tests ["#{Project.tests_dir}"]
 end
 
+task :test_xml, :category_to_exclude, :needs => [:compile] do |t,args|
+  runner = MbUnitRunner.new :compile_target => COMPILE_TARGET, :category_to_exclude => 'SLOW'
+  runner.execute_tests ["#{Project.tests_dir}"]
+end
+
 task :test_all, :category_to_exclude, :needs => [:compile] do |t,args|
-  puts Project.startup_dir
   runner = MbUnitRunner.new :compile_target => COMPILE_TARGET, :category_to_exclude => 'none', :show_report => true, :report_type => "text"
   runner.execute_tests ["#{Project.tests_dir}"]
 end
@@ -85,9 +73,9 @@ task :info do
 	puts COMPILE_TARGET
 end
 
-task :run_test_report => [:test] do
+task :run_test_report => [:test_xml] do
  runner = BDDDocRunner.new
- runner.run(File.join('product',"#{Project.tests_dir}",'bin','debug',"#{Project.tests_dir}.dll"))
+ runner.run(File.join('product',"#{Project.tests_dir}",'bin','debug',"application.tests.dll"))
 end
 
 task :deploy => [:init,:compile] do
@@ -98,15 +86,6 @@ task :deploy => [:init,:compile] do
   FileUtils.cp_r(File.join('thirdparty','developwithpassion.commons'),deploy_folder)
 end
 
-task :from_ide do
-  app_config.generate_to(File.join(project_startup_dir,"#{Project.startup_config}"),local_settings.settings)
-  app_config.generate_to(File.join(project_test_dir,"#{Project.tests_dir}.dll.config"),local_settings.settings)
-
-  config_files.each do |file|
-    TemplateFile.new(file).generate_to_directories([project_startup_dir,project_test_dir],local_settings.settings)
-  end
-end
-
 task :run do
 	deploy_folder = File.join('artifacts','deploy')
 	sql_folder = File.join(Dir.getwd,'product','sql')