ar_loader 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -181,6 +181,7 @@ A single association column can contain multiple name/value sets, in string form
181
181
  So if our Project model has many Categories, we can supply a Category list, which is keyed on the column 'reference' with :
182
182
 
183
183
  |Categories|
184
+
184
185
  reference:category_001,category_002
185
186
 
186
187
  During loading, a call to find_all_by_reference will be made, picking up the 2 categories with matching references,
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -71,6 +71,9 @@ module ARLoader
71
71
 
72
72
  # Create picture of the operators for assignment available on an AR model,
73
73
  # including via associations (which provide both << and = )
74
+ # Optoipns:
75
+ # :reload => clear caches and reperform lookup
76
+ # :instance_methods => if true include instance method type assignment operators as well as model's pure columns
74
77
  #
75
78
  def self.find_operators(klass, options = {} )
76
79
 
@@ -98,7 +101,8 @@ module ARLoader
98
101
  # Find the model's column associations which can be populated via = value
99
102
  if( options[:reload] || @@assignments[klass].nil? )
100
103
 
101
- @@assignments[klass] = (klass.column_names + klass.instance_methods.grep(/=/).map{|i| i.gsub(/=/, '')})
104
+ @@assignments[klass] = klass.column_names
105
+ @@assignments[klass] += klass.instance_methods.grep(/=/).map{|i| i.gsub(/=/, '')} if(options[:instance_methods] == true)
102
106
  @@assignments[klass] -= @@has_many[klass] if(@@has_many[klass])
103
107
  @@assignments[klass] -= @@belongs_to[klass] if(@@belongs_to[klass])
104
108
  @@assignments[klass] -= self.has_one[klass] if(self.has_one[klass])
@@ -0,0 +1,74 @@
1
+ # Copyright:: (c) Autotelik Media Ltd 2011
2
+ # Author :: Tom Statter
3
+ # Date :: Aug 2011
4
+ # License:: MIT
5
+ #
6
+ # Details:: Export a model to Excel
7
+ #
8
+ #
9
+ if(Guards::jruby?)
10
+
11
+ require 'jexcel_file'
12
+ require 'generator_base'
13
+
14
+ module ARLoader
15
+
16
+
17
+ class ExcelGenerator < GeneratorBase
18
+
19
+ attr_accessor :excel, :filename
20
+
21
+
22
+ def initialize(filename)
23
+ @excel = nil
24
+ @filename = filename
25
+ end
26
+
27
+
28
+ # Create an Excel file representing supplied Model
29
+
30
+ def generate(model, options = {})
31
+
32
+ @filename = options[:filename] if options[:filename]
33
+
34
+ @excel = JExcelFile.new()
35
+
36
+ sheet = @excel.create_sheet( model.name )
37
+
38
+ @excel.create_row(0)
39
+
40
+ MethodMapper.find_operators( model )
41
+
42
+ # header row
43
+ unless(MethodMapper.assignments[model].empty?)
44
+ row = sheet.createRow(0)
45
+ cell_index = 0
46
+ MethodMapper.assignments[model].each do |operator|
47
+ row.createCell(cell_index).setCellValue(operator)
48
+ cell_index += 1
49
+ end
50
+ end
51
+
52
+ @excel.save( filename )
53
+ end
54
+
55
+
56
+ # Create an Excel file representing supplied Model
57
+
58
+ def export(items, options = {})
59
+
60
+ @filename = options[:filename] if options[:filename]
61
+
62
+ @excel = JExcelFile.new()
63
+
64
+ @excel.to_xls(items)
65
+
66
+ @excel.save( filename )
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+ else
73
+ raise "BAD RUBY : PLEASE USE JRuby - Sorry JExcelFile requires JAVA via JRuby"
74
+ end # jruby
@@ -0,0 +1,14 @@
1
+ # Copyright:: (c) Autotelik Media Ltd 2011
2
+ # Author :: Tom Statter
3
+ # Date :: Aug 2010
4
+ # License:: MIT
5
+ #
6
+ # Details:: Base class for generators, which provide serivrs to describe a Model in an external format
7
+ #
8
+ module ARLoader
9
+
10
+ class GeneratorBase
11
+
12
+ end
13
+
14
+ end
@@ -42,6 +42,10 @@ if(Guards::jruby?)
42
42
  MAX_COLUMNS = 256.freeze
43
43
  MAX_ROWS = 65536.freeze
44
44
 
45
+ def self.date_format
46
+ HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm")
47
+ end
48
+
45
49
  # The HSSFWorkbook uses 0 based indexes
46
50
 
47
51
  def initialize()
@@ -55,12 +59,15 @@ if(Guards::jruby?)
55
59
 
56
60
  sheet(0) # also sets @current_sheet
57
61
  end
58
-
59
- def create(sheet_name)
62
+
63
+ # TOFIX - how do we know which sheet we are creating so we can set index @current_sheet
64
+ def create_sheet(sheet_name)
65
+ @current_sheet = 0
60
66
  @book = HSSFWorkbook.new()
61
67
  @sheet = @book.createSheet(sheet_name.gsub(" ", ''))
62
68
  date_style = @book.createCellStyle()
63
69
  date_style.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"))
70
+ @sheet
64
71
  end
65
72
 
66
73
  # Return the current or specified HSSFSheet
@@ -81,7 +88,7 @@ if(Guards::jruby?)
81
88
  end
82
89
 
83
90
 
84
- # Create new row, bring index in line with POI usage (our 1 is their 0)
91
+ # Create new row
85
92
  def create_row(index)
86
93
  @row = @sheet.createRow(index)
87
94
  @row
@@ -115,47 +122,29 @@ if(Guards::jruby?)
115
122
  end
116
123
 
117
124
 
118
- # The internal representation of a Excel File
119
-
120
- def to_s
121
- outs = ByteArrayOutputStream.new
122
- @book.write(outs);
123
- outs.close();
124
- String.from_java_bytes(outs.toByteArray)
125
- end
126
-
127
- end
128
-
129
- module ExcelHelper
130
- require 'java'
125
+ def set_headers(headers)
131
126
 
132
- include_class 'org.apache.poi.poifs.filesystem.POIFSFileSystem'
133
- include_class 'org.apache.poi.hssf.usermodel.HSSFCell'
134
- include_class 'org.apache.poi.hssf.usermodel.HSSFWorkbook'
135
- include_class 'org.apache.poi.hssf.usermodel.HSSFCellStyle'
136
- include_class 'org.apache.poi.hssf.usermodel.HSSFDataFormat'
137
- include_class 'java.io.ByteArrayOutputStream'
138
- include_class 'java.util.Date'
127
+ return if headers.empty?
139
128
 
140
- # ActiveRecord Helper - Export model data to XLS file format
141
- #
142
- def to_xls(items=[])
129
+ create_sheet( headers.first.class.name ) unless(@sheet)
143
130
 
144
- @excel = ExcelFile.new(items[0].class.name)
145
-
146
- @excel.create_row(0)
147
-
148
- sheet = @excel.sheet
131
+ row = sheet.createRow(0)
149
132
 
150
- # header row
151
- if !items.empty?
152
- row = sheet.createRow(0)
153
- cell_index = 0
154
- items[0].class.columns.each do |column|
155
- row.createCell(cell_index).setCellValue(column.name)
156
- cell_index += 1
157
- end
133
+ headers.each_with_index.each do |column, i|
134
+ row.createCell(i).setCellValue(column.name.to_s)
158
135
  end
136
+ end
137
+
138
+
139
+ def to_xls(items)
140
+ return if items.empty?
141
+
142
+ create_sheet( items.first.class.name ) unless(@sheet)
143
+
144
+ set_headers( items.first.class.columns )
145
+
146
+ date_style = @book.createCellStyle
147
+ date_style.setDataFormat( JExcelFile::date_format )
159
148
 
160
149
  # value rows
161
150
  row_index = 1
@@ -165,23 +154,38 @@ if(Guards::jruby?)
165
154
  cell_index = 0
166
155
  item.class.columns.each do |column|
167
156
  cell = row.createCell(cell_index)
157
+
168
158
  if column.sql_type =~ /date/ then
159
+
169
160
  millis = item.send(column.name).to_f * 1000
170
161
  cell.setCellValue(Date.new(millis))
171
- cell.setCellStyle(dateStyle);
162
+
163
+ cell.setCellStyle( date_style );
172
164
  elsif column.sql_type =~ /int/ then
173
165
  cell.setCellValue(item.send(column.name).to_i)
166
+
174
167
  else
175
168
  value = item.send(column.name)
176
- cell.setCellValue(item.send(column.name)) unless value.nil?
169
+ cell.setCellValue( value.to_s ) unless value.nil?
177
170
  end
171
+
178
172
  cell_index += 1
179
173
  end
180
174
  row_index += 1
181
175
  end
182
176
  @excel.to_s
183
177
  end
178
+
179
+ # The internal representation of a Excel File
180
+
181
+ def to_s
182
+ outs = ByteArrayOutputStream.new
183
+ @book.write(outs);
184
+ outs.close();
185
+ String.from_java_bytes(outs.toByteArray)
186
+ end
187
+
184
188
  end
185
189
  else
186
- raise "Bad Platform - Sorry can only access Excel files via JRuby"
190
+ raise "Sorry can only access JExcelFile using JRuby"
187
191
  end
@@ -11,7 +11,7 @@ require 'excel_loader'
11
11
 
12
12
  module ARLoader
13
13
 
14
- class ProductLoader < ExcelLoader
14
+ class ProductLoader < LoaderBase
15
15
 
16
16
  def initialize(product = nil)
17
17
  super( Product, product )
@@ -0,0 +1,72 @@
1
+ # Copyright:: (c) Autotelik Media Ltd 2011
2
+ # Author :: Tom Statter
3
+ # Date :: Aug 2011
4
+ # License:: MIT
5
+ #
6
+ # Details:: Specs for Excel aspect of Active Record Loader
7
+ #
8
+ require File.dirname(__FILE__) + '/spec_helper'
9
+
10
+ require 'erb'
11
+ require 'excel_generator'
12
+
13
+ include ARLoader
14
+
15
+ describe 'Excel Generator' do
16
+
17
+ before(:all) do
18
+ db_connect( 'test_file' ) # , test_memory, test_mysql
19
+
20
+ db_clear() # todo read up about proper transactional fixtures
21
+
22
+
23
+ @klazz = Project
24
+ @assoc_klazz = Category
25
+ end
26
+
27
+ before(:each) do
28
+ MethodMapper.clear
29
+ MethodMapper.find_operators( @klazz )
30
+ MethodMapper.find_operators( @assoc_klazz )
31
+ end
32
+
33
+ it "should be able to create a new excel generator" do
34
+ generator = ExcelGenerator.new( 'dummy.xls' )
35
+ end
36
+
37
+ it "should genrate template .xls file from model" do
38
+
39
+ expect= $fixture_path + '/simple_template_spec.xls'
40
+
41
+ begin FileUtils.rm(expect); rescue; end
42
+
43
+ gen = ExcelGenerator.new( expect )
44
+
45
+ gen.generate(@klazz)
46
+
47
+ File.exists?(expect).should be_true
48
+
49
+ end
50
+
51
+
52
+ it "should export a simple model to .xls spreedsheet" do
53
+
54
+ Project.create( :value_as_string => 'Value as Text', :value_as_boolean => true, :value_as_double => 75.672)
55
+ #001 Demo string blah blah 2011-02-14 1.00 320.00
56
+
57
+
58
+ expect= $fixture_path + '/results/simple_export_spec.xls'
59
+
60
+ begin FileUtils.rm(expect); rescue; end
61
+
62
+ gen = ExcelGenerator.new(expect)
63
+
64
+ items = Project.all
65
+
66
+ gen.export(items)
67
+
68
+ File.exists?(expect).should be_true
69
+
70
+ end
71
+
72
+ end
data/spec/logs/test.log CHANGED
@@ -4998,3 +4998,372 @@ ActiveRecord::JDBCError: [SQLITE_CONSTRAINT] Abort due to constraint violation
4998
4998
  SQL (1.0ms) SELECT 1 FROM "products" WHERE ("products"."permalink" = 'demo-product-for-ar-loader') AND ("products".id <> 1) LIMIT 1
4999
4999
  OptionType Load (0.0ms) SELECT "option_types".* FROM "option_types" WHERE "option_types"."name" = 'mime_type' ORDER BY option_types.position LIMIT 1
5000
5000
  ProductOptionType Load (0.0ms) SELECT "product_option_types".* FROM "product_option_types" WHERE ("product_option_types".product_id = 1)
5001
+ D, [2011-08-22T11:23:46.234803 #1350] DEBUG -- : SQL (0.6ms)  SELECT name
5002
+ FROM sqlite_master
5003
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5004
+ 
5005
+ D, [2011-08-22T11:23:46.249987 #1350] DEBUG -- : SQL (1.1ms) SELECT name
5006
+ FROM sqlite_master
5007
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5008
+
5009
+ D, [2011-08-22T11:23:46.252346 #1350] DEBUG -- : SQL (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5010
+ I, [2011-08-22T11:23:46.252830 #1350] INFO -- : Migrating to CreateTestBed (20110803201325)
5011
+ D, [2011-08-22T11:23:46.304987 #1350] DEBUG -- : AREL (1.3ms) DELETE FROM "projects" WHERE 1=1
5012
+ D, [2011-08-22T11:23:46.306807 #1350] DEBUG -- : AREL (1.1ms) DELETE FROM "milestones" WHERE 1=1
5013
+ D, [2011-08-22T11:23:46.310374 #1350] DEBUG -- : AREL (3.0ms) DELETE FROM "categories" WHERE 1=1
5014
+ D, [2011-08-22T11:23:46.311763 #1350] DEBUG -- : AREL (0.9ms) DELETE FROM "versions" WHERE 1=1
5015
+ D, [2011-08-22T11:23:46.313171 #1350] DEBUG -- : AREL (0.9ms) DELETE FROM "loader_releases" WHERE 1=1
5016
+ D, [2011-08-22T11:33:44.745000 #1440] DEBUG -- : SQL (0.0ms)  SELECT name
5017
+ FROM sqlite_master
5018
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5019
+ 
5020
+ D, [2011-08-22T11:33:44.752000 #1440] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5021
+ I, [2011-08-22T11:33:44.755000 #1440] INFO -- : Migrating to CreateTestBed (20110803201325)
5022
+ D, [2011-08-22T11:33:44.856000 #1440] DEBUG -- : AREL (3.0ms) DELETE FROM "projects"
5023
+ D, [2011-08-22T11:33:44.861000 #1440] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5024
+ D, [2011-08-22T11:33:44.867000 #1440] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5025
+ D, [2011-08-22T11:33:44.872000 #1440] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5026
+ D, [2011-08-22T11:33:44.877000 #1440] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5027
+ D, [2011-08-22T11:34:37.330000 #1444] DEBUG -- : SQL (0.0ms)  SELECT name
5028
+ FROM sqlite_master
5029
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5030
+ 
5031
+ D, [2011-08-22T11:34:37.337000 #1444] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5032
+ I, [2011-08-22T11:34:37.339000 #1444] INFO -- : Migrating to CreateTestBed (20110803201325)
5033
+ D, [2011-08-22T11:34:37.438000 #1444] DEBUG -- : AREL (53.0ms) DELETE FROM "projects"
5034
+ D, [2011-08-22T11:34:37.445000 #1444] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5035
+ D, [2011-08-22T11:34:37.450000 #1444] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5036
+ D, [2011-08-22T11:34:37.456000 #1444] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5037
+ D, [2011-08-22T11:34:37.461000 #1444] DEBUG -- : AREL (2.0ms) DELETE FROM "loader_releases"
5038
+ D, [2011-08-22T11:35:47.136000 #1448] DEBUG -- : SQL (1.0ms)  SELECT name
5039
+ FROM sqlite_master
5040
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5041
+ 
5042
+ D, [2011-08-22T11:35:47.141000 #1448] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5043
+ I, [2011-08-22T11:35:47.143000 #1448] INFO -- : Migrating to CreateTestBed (20110803201325)
5044
+ D, [2011-08-22T11:35:47.244000 #1448] DEBUG -- : AREL (50.0ms) DELETE FROM "projects"
5045
+ D, [2011-08-22T11:35:47.250000 #1448] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5046
+ D, [2011-08-22T11:35:47.256000 #1448] DEBUG -- : AREL (4.0ms) DELETE FROM "categories"
5047
+ D, [2011-08-22T11:35:47.263000 #1448] DEBUG -- : AREL (4.0ms) DELETE FROM "versions"
5048
+ D, [2011-08-22T11:35:47.269000 #1448] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5049
+ D, [2011-08-22T11:36:11.032000 #1450] DEBUG -- : SQL (0.0ms)  SELECT name
5050
+ FROM sqlite_master
5051
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5052
+ 
5053
+ D, [2011-08-22T11:36:11.038000 #1450] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5054
+ I, [2011-08-22T11:36:11.041000 #1450] INFO -- : Migrating to CreateTestBed (20110803201325)
5055
+ D, [2011-08-22T11:36:11.145000 #1450] DEBUG -- : AREL (51.0ms) DELETE FROM "projects"
5056
+ D, [2011-08-22T11:36:11.151000 #1450] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5057
+ D, [2011-08-22T11:36:11.158000 #1450] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5058
+ D, [2011-08-22T11:36:11.164000 #1450] DEBUG -- : AREL (4.0ms) DELETE FROM "versions"
5059
+ D, [2011-08-22T11:36:11.170000 #1450] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5060
+ D, [2011-08-22T11:41:05.699000 #1459] DEBUG -- : SQL (1.0ms)  SELECT name
5061
+ FROM sqlite_master
5062
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5063
+ 
5064
+ D, [2011-08-22T11:41:05.705000 #1459] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5065
+ I, [2011-08-22T11:41:05.707000 #1459] INFO -- : Migrating to CreateTestBed (20110803201325)
5066
+ D, [2011-08-22T11:41:05.806000 #1459] DEBUG -- : AREL (52.0ms) DELETE FROM "projects"
5067
+ D, [2011-08-22T11:41:05.812000 #1459] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5068
+ D, [2011-08-22T11:41:05.818000 #1459] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5069
+ D, [2011-08-22T11:41:05.823000 #1459] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5070
+ D, [2011-08-22T11:41:05.829000 #1459] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5071
+ D, [2011-08-22T11:49:27.621000 #1474] DEBUG -- : SQL (0.0ms)  SELECT name
5072
+ FROM sqlite_master
5073
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5074
+ 
5075
+ D, [2011-08-22T11:49:27.628000 #1474] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5076
+ I, [2011-08-22T11:49:27.630000 #1474] INFO -- : Migrating to CreateTestBed (20110803201325)
5077
+ D, [2011-08-22T11:49:27.737000 #1474] DEBUG -- : AREL (57.0ms) DELETE FROM "projects"
5078
+ D, [2011-08-22T11:49:27.744000 #1474] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5079
+ D, [2011-08-22T11:49:27.749000 #1474] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5080
+ D, [2011-08-22T11:49:27.755000 #1474] DEBUG -- : AREL (2.0ms) DELETE FROM "versions"
5081
+ D, [2011-08-22T11:49:27.761000 #1474] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5082
+ D, [2011-08-22T11:52:17.937000 #1482] DEBUG -- : SQL (1.0ms)  SELECT name
5083
+ FROM sqlite_master
5084
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5085
+ 
5086
+ D, [2011-08-22T11:52:17.944000 #1482] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5087
+ I, [2011-08-22T11:52:17.946000 #1482] INFO -- : Migrating to CreateTestBed (20110803201325)
5088
+ D, [2011-08-22T11:52:18.038000 #1482] DEBUG -- : AREL (44.0ms) DELETE FROM "projects"
5089
+ D, [2011-08-22T11:52:18.045000 #1482] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5090
+ D, [2011-08-22T11:52:18.051000 #1482] DEBUG -- : AREL (2.0ms) DELETE FROM "categories"
5091
+ D, [2011-08-22T11:52:18.057000 #1482] DEBUG -- : AREL (4.0ms) DELETE FROM "versions"
5092
+ D, [2011-08-22T11:52:18.064000 #1482] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5093
+ D, [2011-08-22T11:53:32.083000 #1486] DEBUG -- : SQL (0.0ms)  SELECT name
5094
+ FROM sqlite_master
5095
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5096
+ 
5097
+ D, [2011-08-22T11:53:32.089000 #1486] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5098
+ I, [2011-08-22T11:53:32.091000 #1486] INFO -- : Migrating to CreateTestBed (20110803201325)
5099
+ D, [2011-08-22T11:53:32.194000 #1486] DEBUG -- : AREL (56.0ms) DELETE FROM "projects"
5100
+ D, [2011-08-22T11:53:32.199000 #1486] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5101
+ D, [2011-08-22T11:53:32.204000 #1486] DEBUG -- : AREL (2.0ms) DELETE FROM "categories"
5102
+ D, [2011-08-22T11:53:32.210000 #1486] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5103
+ D, [2011-08-22T11:53:32.216000 #1486] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5104
+ D, [2011-08-22T11:59:38.897000 #1511] DEBUG -- : SQL (0.0ms)  SELECT name
5105
+ FROM sqlite_master
5106
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5107
+ 
5108
+ D, [2011-08-22T11:59:38.903000 #1511] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5109
+ I, [2011-08-22T11:59:38.905000 #1511] INFO -- : Migrating to CreateTestBed (20110803201325)
5110
+ D, [2011-08-22T11:59:39.012000 #1511] DEBUG -- : AREL (50.0ms) DELETE FROM "projects"
5111
+ D, [2011-08-22T11:59:39.019000 #1511] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5112
+ D, [2011-08-22T11:59:39.024000 #1511] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5113
+ D, [2011-08-22T11:59:39.030000 #1511] DEBUG -- : AREL (4.0ms) DELETE FROM "versions"
5114
+ D, [2011-08-22T11:59:39.035000 #1511] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5115
+ D, [2011-08-28T18:59:49.606915 #35892] DEBUG -- : SQL (0.8ms)  SELECT name
5116
+ FROM sqlite_master
5117
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5118
+ 
5119
+ D, [2011-08-28T18:59:49.617217 #35892] DEBUG -- : SQL (0.5ms) SELECT name
5120
+ FROM sqlite_master
5121
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5122
+
5123
+ D, [2011-08-28T18:59:49.618299 #35892] DEBUG -- : SQL (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5124
+ I, [2011-08-28T18:59:49.618556 #35892] INFO -- : Migrating to CreateTestBed (20110803201325)
5125
+ D, [2011-08-28T18:59:49.658765 #35892] DEBUG -- : AREL (1.1ms) DELETE FROM "projects" WHERE 1=1
5126
+ D, [2011-08-28T18:59:49.659837 #35892] DEBUG -- : AREL (0.6ms) DELETE FROM "milestones" WHERE 1=1
5127
+ D, [2011-08-28T18:59:49.660892 #35892] DEBUG -- : AREL (0.7ms) DELETE FROM "categories" WHERE 1=1
5128
+ D, [2011-08-28T18:59:49.661908 #35892] DEBUG -- : AREL (0.7ms) DELETE FROM "versions" WHERE 1=1
5129
+ D, [2011-08-28T18:59:49.662931 #35892] DEBUG -- : AREL (0.7ms) DELETE FROM "loader_releases" WHERE 1=1
5130
+ D, [2011-08-28T19:02:07.124587 #35964] DEBUG -- : SQL (0.6ms)  SELECT name
5131
+ FROM sqlite_master
5132
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5133
+ 
5134
+ D, [2011-08-28T19:02:07.125393 #35964] DEBUG -- : SQL (0.5ms) SELECT name
5135
+ FROM sqlite_master
5136
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5137
+
5138
+ D, [2011-08-28T19:02:07.126397 #35964] DEBUG -- : SQL (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5139
+ I, [2011-08-28T19:02:07.126653 #35964] INFO -- : Migrating to CreateTestBed (20110803201325)
5140
+ D, [2011-08-28T19:02:07.168251 #35964] DEBUG -- : AREL (2.7ms) DELETE FROM "projects" WHERE 1=1
5141
+ D, [2011-08-28T19:02:07.218400 #35964] DEBUG -- : AREL (49.6ms) DELETE FROM "milestones" WHERE 1=1
5142
+ D, [2011-08-28T19:02:07.220466 #35964] DEBUG -- : AREL (1.0ms) DELETE FROM "categories" WHERE 1=1
5143
+ D, [2011-08-28T19:02:07.222096 #35964] DEBUG -- : AREL (1.0ms) DELETE FROM "versions" WHERE 1=1
5144
+ D, [2011-08-28T19:02:07.223598 #35964] DEBUG -- : AREL (1.0ms) DELETE FROM "loader_releases" WHERE 1=1
5145
+ D, [2011-08-28T19:04:41.329000 #36105] DEBUG -- : SQL (1.0ms)  SELECT name
5146
+ FROM sqlite_master
5147
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5148
+ 
5149
+ D, [2011-08-28T19:04:41.350000 #36105] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5150
+ I, [2011-08-28T19:04:41.352000 #36105] INFO -- : Migrating to CreateTestBed (20110803201325)
5151
+ D, [2011-08-28T19:04:41.444000 #36105] DEBUG -- : AREL (3.0ms) DELETE FROM "projects"
5152
+ D, [2011-08-28T19:04:41.450000 #36105] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5153
+ D, [2011-08-28T19:04:41.464000 #36105] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5154
+ D, [2011-08-28T19:04:41.469000 #36105] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5155
+ D, [2011-08-28T19:04:41.474000 #36105] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5156
+ D, [2011-08-28T19:05:38.139000 #36140] DEBUG -- : SQL (0.0ms)  SELECT name
5157
+ FROM sqlite_master
5158
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5159
+ 
5160
+ D, [2011-08-28T19:05:38.145000 #36140] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5161
+ I, [2011-08-28T19:05:38.147000 #36140] INFO -- : Migrating to CreateTestBed (20110803201325)
5162
+ D, [2011-08-28T19:05:38.242000 #36140] DEBUG -- : AREL (50.0ms) DELETE FROM "projects"
5163
+ D, [2011-08-28T19:05:38.248000 #36140] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5164
+ D, [2011-08-28T19:05:38.254000 #36140] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5165
+ D, [2011-08-28T19:05:38.260000 #36140] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5166
+ D, [2011-08-28T19:05:38.265000 #36140] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5167
+ D, [2011-08-28T19:06:51.565000 #36181] DEBUG -- : SQL (1.0ms)  SELECT name
5168
+ FROM sqlite_master
5169
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5170
+ 
5171
+ D, [2011-08-28T19:06:51.571000 #36181] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5172
+ I, [2011-08-28T19:06:51.573000 #36181] INFO -- : Migrating to CreateTestBed (20110803201325)
5173
+ D, [2011-08-28T19:06:51.677000 #36181] DEBUG -- : AREL (58.0ms) DELETE FROM "projects"
5174
+ D, [2011-08-28T19:06:51.683000 #36181] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5175
+ D, [2011-08-28T19:06:51.688000 #36181] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5176
+ D, [2011-08-28T19:06:51.694000 #36181] DEBUG -- : AREL (4.0ms) DELETE FROM "versions"
5177
+ D, [2011-08-28T19:06:51.700000 #36181] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5178
+ D, [2011-08-28T19:07:26.254000 #36205] DEBUG -- : SQL (0.0ms)  SELECT name
5179
+ FROM sqlite_master
5180
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5181
+ 
5182
+ D, [2011-08-28T19:07:26.260000 #36205] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5183
+ I, [2011-08-28T19:07:26.262000 #36205] INFO -- : Migrating to CreateTestBed (20110803201325)
5184
+ D, [2011-08-28T19:07:26.359000 #36205] DEBUG -- : AREL (51.0ms) DELETE FROM "projects"
5185
+ D, [2011-08-28T19:07:26.365000 #36205] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5186
+ D, [2011-08-28T19:07:26.371000 #36205] DEBUG -- : AREL (4.0ms) DELETE FROM "categories"
5187
+ D, [2011-08-28T19:07:26.377000 #36205] DEBUG -- : AREL (4.0ms) DELETE FROM "versions"
5188
+ D, [2011-08-28T19:07:26.383000 #36205] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5189
+ D, [2011-08-28T19:07:26.510000 #36205] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5190
+ D, [2011-08-28T19:07:51.630000 #36219] DEBUG -- : SQL (1.0ms)  SELECT name
5191
+ FROM sqlite_master
5192
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5193
+ 
5194
+ D, [2011-08-28T19:07:51.635000 #36219] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5195
+ I, [2011-08-28T19:07:51.637000 #36219] INFO -- : Migrating to CreateTestBed (20110803201325)
5196
+ D, [2011-08-28T19:07:51.735000 #36219] DEBUG -- : AREL (58.0ms) DELETE FROM "projects"
5197
+ D, [2011-08-28T19:07:51.742000 #36219] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5198
+ D, [2011-08-28T19:07:51.748000 #36219] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5199
+ D, [2011-08-28T19:07:51.753000 #36219] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5200
+ D, [2011-08-28T19:07:51.766000 #36219] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5201
+ D, [2011-08-28T19:07:51.888000 #36219] DEBUG -- : Project Load (1.0ms) SELECT "projects".* FROM "projects"
5202
+ D, [2011-08-28T19:11:13.918000 #36327] DEBUG -- : SQL (0.0ms)  SELECT name
5203
+ FROM sqlite_master
5204
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5205
+ 
5206
+ D, [2011-08-28T19:11:13.925000 #36327] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5207
+ I, [2011-08-28T19:11:13.927000 #36327] INFO -- : Migrating to CreateTestBed (20110803201325)
5208
+ D, [2011-08-28T19:11:14.027000 #36327] DEBUG -- : AREL (55.0ms) DELETE FROM "projects"
5209
+ D, [2011-08-28T19:11:14.033000 #36327] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5210
+ D, [2011-08-28T19:11:14.038000 #36327] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5211
+ D, [2011-08-28T19:11:14.044000 #36327] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5212
+ D, [2011-08-28T19:11:14.049000 #36327] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5213
+ D, [2011-08-28T19:11:14.173000 #36327] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5214
+ D, [2011-08-28T19:15:58.600000 #36496] DEBUG -- : SQL (1.0ms)  SELECT name
5215
+ FROM sqlite_master
5216
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5217
+ 
5218
+ D, [2011-08-28T19:15:58.606000 #36496] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5219
+ I, [2011-08-28T19:15:58.608000 #36496] INFO -- : Migrating to CreateTestBed (20110803201325)
5220
+ D, [2011-08-28T19:15:58.705000 #36496] DEBUG -- : AREL (52.0ms) DELETE FROM "projects"
5221
+ D, [2011-08-28T19:15:58.711000 #36496] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5222
+ D, [2011-08-28T19:15:58.717000 #36496] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5223
+ D, [2011-08-28T19:15:58.723000 #36496] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5224
+ D, [2011-08-28T19:15:58.728000 #36496] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5225
+ D, [2011-08-28T19:15:59.014000 #36496] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5226
+ D, [2011-08-28T19:15:59.023000 #36496] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5227
+ D, [2011-08-28T19:17:41.459000 #36548] DEBUG -- : SQL (1.0ms)  SELECT name
5228
+ FROM sqlite_master
5229
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5230
+ 
5231
+ D, [2011-08-28T19:17:41.466000 #36548] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5232
+ I, [2011-08-28T19:17:41.468000 #36548] INFO -- : Migrating to CreateTestBed (20110803201325)
5233
+ D, [2011-08-28T19:17:41.565000 #36548] DEBUG -- : AREL (49.0ms) DELETE FROM "projects"
5234
+ D, [2011-08-28T19:17:41.571000 #36548] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5235
+ D, [2011-08-28T19:17:41.577000 #36548] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5236
+ D, [2011-08-28T19:17:41.584000 #36548] DEBUG -- : AREL (4.0ms) DELETE FROM "versions"
5237
+ D, [2011-08-28T19:17:41.591000 #36548] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5238
+ D, [2011-08-28T19:17:41.811000 #36548] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5239
+ D, [2011-08-28T19:17:41.821000 #36548] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5240
+ D, [2011-08-28T19:21:17.453000 #36665] DEBUG -- : SQL (0.0ms)  SELECT name
5241
+ FROM sqlite_master
5242
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5243
+ 
5244
+ D, [2011-08-28T19:21:17.459000 #36665] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5245
+ I, [2011-08-28T19:21:17.461000 #36665] INFO -- : Migrating to CreateTestBed (20110803201325)
5246
+ D, [2011-08-28T19:21:17.557000 #36665] DEBUG -- : AREL (58.0ms) DELETE FROM "projects"
5247
+ D, [2011-08-28T19:21:17.573000 #36665] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5248
+ D, [2011-08-28T19:21:17.579000 #36665] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5249
+ D, [2011-08-28T19:21:17.584000 #36665] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5250
+ D, [2011-08-28T19:21:17.590000 #36665] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5251
+ D, [2011-08-28T19:21:17.816000 #36665] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5252
+ D, [2011-08-28T19:21:17.827000 #36665] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5253
+ D, [2011-08-28T19:23:33.105000 #36739] DEBUG -- : SQL (1.0ms)  SELECT name
5254
+ FROM sqlite_master
5255
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5256
+ 
5257
+ D, [2011-08-28T19:23:33.111000 #36739] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5258
+ I, [2011-08-28T19:23:33.113000 #36739] INFO -- : Migrating to CreateTestBed (20110803201325)
5259
+ D, [2011-08-28T19:23:33.207000 #36739] DEBUG -- : AREL (56.0ms) DELETE FROM "projects"
5260
+ D, [2011-08-28T19:23:33.213000 #36739] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5261
+ D, [2011-08-28T19:23:33.219000 #36739] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5262
+ D, [2011-08-28T19:23:33.225000 #36739] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5263
+ D, [2011-08-28T19:23:33.239000 #36739] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5264
+ D, [2011-08-28T19:23:33.458000 #36739] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5265
+ D, [2011-08-28T19:23:33.469000 #36739] DEBUG -- : Project Load (1.0ms) SELECT "projects".* FROM "projects"
5266
+ D, [2011-08-28T19:24:02.510000 #36759] DEBUG -- : SQL (1.0ms)  SELECT name
5267
+ FROM sqlite_master
5268
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5269
+ 
5270
+ D, [2011-08-28T19:24:02.516000 #36759] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5271
+ I, [2011-08-28T19:24:02.518000 #36759] INFO -- : Migrating to CreateTestBed (20110803201325)
5272
+ D, [2011-08-28T19:24:02.613000 #36759] DEBUG -- : AREL (50.0ms) DELETE FROM "projects"
5273
+ D, [2011-08-28T19:24:02.619000 #36759] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5274
+ D, [2011-08-28T19:24:02.624000 #36759] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5275
+ D, [2011-08-28T19:24:02.629000 #36759] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5276
+ D, [2011-08-28T19:24:02.634000 #36759] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5277
+ D, [2011-08-28T19:24:02.854000 #36759] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5278
+ D, [2011-08-28T19:24:02.865000 #36759] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5279
+ D, [2011-08-28T19:25:21.236000 #36798] DEBUG -- : SQL (1.0ms)  SELECT name
5280
+ FROM sqlite_master
5281
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5282
+ 
5283
+ D, [2011-08-28T19:25:21.242000 #36798] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5284
+ I, [2011-08-28T19:25:21.244000 #36798] INFO -- : Migrating to CreateTestBed (20110803201325)
5285
+ D, [2011-08-28T19:25:21.347000 #36798] DEBUG -- : AREL (55.0ms) DELETE FROM "projects"
5286
+ D, [2011-08-28T19:25:21.352000 #36798] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5287
+ D, [2011-08-28T19:25:21.358000 #36798] DEBUG -- : AREL (2.0ms) DELETE FROM "categories"
5288
+ D, [2011-08-28T19:25:21.364000 #36798] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5289
+ D, [2011-08-28T19:25:21.369000 #36798] DEBUG -- : AREL (2.0ms) DELETE FROM "loader_releases"
5290
+ D, [2011-08-28T19:25:21.622000 #36798] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5291
+ D, [2011-08-28T19:25:21.636000 #36798] DEBUG -- : Project Load (1.0ms) SELECT "projects".* FROM "projects"
5292
+ D, [2011-08-28T19:25:40.252000 #36810] DEBUG -- : SQL (0.0ms)  SELECT name
5293
+ FROM sqlite_master
5294
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5295
+ 
5296
+ D, [2011-08-28T19:25:40.258000 #36810] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5297
+ I, [2011-08-28T19:25:40.260000 #36810] INFO -- : Migrating to CreateTestBed (20110803201325)
5298
+ D, [2011-08-28T19:25:40.359000 #36810] DEBUG -- : AREL (59.0ms) DELETE FROM "projects"
5299
+ D, [2011-08-28T19:25:40.374000 #36810] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5300
+ D, [2011-08-28T19:25:40.379000 #36810] DEBUG -- : AREL (2.0ms) DELETE FROM "categories"
5301
+ D, [2011-08-28T19:25:40.384000 #36810] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5302
+ D, [2011-08-28T19:25:40.389000 #36810] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5303
+ D, [2011-08-28T19:25:40.630000 #36810] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5304
+ D, [2011-08-28T19:25:40.640000 #36810] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5305
+ D, [2011-08-28T19:35:00.656000 #37114] DEBUG -- : SQL (1.0ms)  SELECT name
5306
+ FROM sqlite_master
5307
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5308
+ 
5309
+ D, [2011-08-28T19:35:00.662000 #37114] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5310
+ I, [2011-08-28T19:35:00.664000 #37114] INFO -- : Migrating to CreateTestBed (20110803201325)
5311
+ D, [2011-08-28T19:35:00.762000 #37114] DEBUG -- : AREL (53.0ms) DELETE FROM "projects"
5312
+ D, [2011-08-28T19:35:00.769000 #37114] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5313
+ D, [2011-08-28T19:35:00.775000 #37114] DEBUG -- : AREL (2.0ms) DELETE FROM "categories"
5314
+ D, [2011-08-28T19:35:00.780000 #37114] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5315
+ D, [2011-08-28T19:35:00.786000 #37114] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5316
+ D, [2011-08-28T19:35:01.017000 #37114] DEBUG -- : SQL (1.0ms) SELECT last_insert_rowid()
5317
+ D, [2011-08-28T19:35:01.024000 #37114] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5318
+ D, [2011-08-28T19:35:29.340000 #37131] DEBUG -- : SQL (1.0ms)  SELECT name
5319
+ FROM sqlite_master
5320
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5321
+ 
5322
+ D, [2011-08-28T19:35:29.346000 #37131] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5323
+ I, [2011-08-28T19:35:29.348000 #37131] INFO -- : Migrating to CreateTestBed (20110803201325)
5324
+ D, [2011-08-28T19:35:29.615000 #37131] DEBUG -- : AREL (221.0ms) DELETE FROM "projects"
5325
+ D, [2011-08-28T19:35:29.622000 #37131] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5326
+ D, [2011-08-28T19:35:29.629000 #37131] DEBUG -- : AREL (4.0ms) DELETE FROM "categories"
5327
+ D, [2011-08-28T19:35:29.634000 #37131] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5328
+ D, [2011-08-28T19:35:29.639000 #37131] DEBUG -- : AREL (3.0ms) DELETE FROM "loader_releases"
5329
+ D, [2011-08-28T19:35:29.860000 #37131] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5330
+ D, [2011-08-28T19:35:29.869000 #37131] DEBUG -- : Project Load (1.0ms) SELECT "projects".* FROM "projects"
5331
+ D, [2011-08-28T19:44:22.255000 #37418] DEBUG -- : SQL (1.0ms)  SELECT name
5332
+ FROM sqlite_master
5333
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5334
+ 
5335
+ D, [2011-08-28T19:44:22.260000 #37418] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5336
+ I, [2011-08-28T19:44:22.262000 #37418] INFO -- : Migrating to CreateTestBed (20110803201325)
5337
+ D, [2011-08-28T19:44:22.364000 #37418] DEBUG -- : AREL (53.0ms) DELETE FROM "projects"
5338
+ D, [2011-08-28T19:44:22.371000 #37418] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5339
+ D, [2011-08-28T19:44:22.376000 #37418] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5340
+ D, [2011-08-28T19:44:22.382000 #37418] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5341
+ D, [2011-08-28T19:44:22.389000 #37418] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5342
+ D, [2011-08-28T19:44:22.611000 #37418] DEBUG -- : SQL (1.0ms) SELECT last_insert_rowid()
5343
+ D, [2011-08-28T19:44:22.622000 #37418] DEBUG -- : Project Load (1.0ms) SELECT "projects".* FROM "projects"
5344
+ D, [2011-08-28T19:45:45.136000 #37466] DEBUG -- : SQL (1.0ms)  SELECT name
5345
+ FROM sqlite_master
5346
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5347
+ 
5348
+ D, [2011-08-28T19:45:45.142000 #37466] DEBUG -- : SQL (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5349
+ I, [2011-08-28T19:45:45.144000 #37466] INFO -- : Migrating to CreateTestBed (20110803201325)
5350
+ D, [2011-08-28T19:45:45.247000 #37466] DEBUG -- : AREL (58.0ms) DELETE FROM "projects"
5351
+ D, [2011-08-28T19:45:45.254000 #37466] DEBUG -- : AREL (2.0ms) DELETE FROM "milestones"
5352
+ D, [2011-08-28T19:45:45.260000 #37466] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5353
+ D, [2011-08-28T19:45:45.266000 #37466] DEBUG -- : AREL (2.0ms) DELETE FROM "versions"
5354
+ D, [2011-08-28T19:45:45.271000 #37466] DEBUG -- : AREL (2.0ms) DELETE FROM "loader_releases"
5355
+ D, [2011-08-28T19:45:45.499000 #37466] DEBUG -- : SQL (0.0ms) SELECT last_insert_rowid()
5356
+ D, [2011-08-28T19:45:45.508000 #37466] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
5357
+ D, [2011-08-28T19:52:11.867000 #37696] DEBUG -- : SQL (1.0ms)  SELECT name
5358
+ FROM sqlite_master
5359
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
5360
+ 
5361
+ D, [2011-08-28T19:52:11.874000 #37696] DEBUG -- : SQL (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
5362
+ I, [2011-08-28T19:52:11.876000 #37696] INFO -- : Migrating to CreateTestBed (20110803201325)
5363
+ D, [2011-08-28T19:52:11.985000 #37696] DEBUG -- : AREL (52.0ms) DELETE FROM "projects"
5364
+ D, [2011-08-28T19:52:11.991000 #37696] DEBUG -- : AREL (3.0ms) DELETE FROM "milestones"
5365
+ D, [2011-08-28T19:52:11.996000 #37696] DEBUG -- : AREL (3.0ms) DELETE FROM "categories"
5366
+ D, [2011-08-28T19:52:12.002000 #37696] DEBUG -- : AREL (3.0ms) DELETE FROM "versions"
5367
+ D, [2011-08-28T19:52:12.008000 #37696] DEBUG -- : AREL (4.0ms) DELETE FROM "loader_releases"
5368
+ D, [2011-08-28T19:52:12.262000 #37696] DEBUG -- : SQL (1.0ms) SELECT last_insert_rowid()
5369
+ D, [2011-08-28T19:52:12.270000 #37696] DEBUG -- : Project Load (0.0ms) SELECT "projects".* FROM "projects"
@@ -0,0 +1,80 @@
1
+ # Copyright:: (c) Autotelik Media Ltd 2011
2
+ # Author :: Tom Statter
3
+ # Date :: Aug 2011
4
+ # License:: MIT.
5
+ #
6
+ # REQUIRES: JRuby
7
+ #
8
+ # Usage::
9
+ #
10
+ # In Rakefile:
11
+ #
12
+ # require 'ar_loader'
13
+ #
14
+ # ArLoader::load_tasks
15
+ #
16
+ # Cmd Line:
17
+ #
18
+ # => jruby -S rake ar_loader:gen:excel model=<active record class> result=<output_template.xls>
19
+ #
20
+ namespace :ar_loader do
21
+ namespace :gen do
22
+
23
+ desc "Generate a template .xls (Excel) file for a model"
24
+
25
+ task :excel, [:model, :result] => [:environment] do |t, args|
26
+
27
+ require 'excel_generator'
28
+
29
+ # in familiar ruby style args seems to have been become empty using this new style for rake 0.9.2
30
+ # whatever format i try, on both Win and OSX .. so had to revert back to ENV
31
+ model = ENV['model']
32
+ result = ENV['result']
33
+
34
+ raise "USAGE: jruby -S rake ar_loader:gen:excel model=<Class> result=<file.xls>" unless(result)
35
+ raise "ERROR: Cannot process without AR Model - please supply model=<Class>" unless(model)
36
+
37
+ begin
38
+ klass = Kernel.const_get(model)
39
+ rescue NameError
40
+ raise "ERROR: No such AR Model found - check valid model supplied via model=<Class>"
41
+ end
42
+
43
+ gen = ARLoader::ExcelGenerator.new
44
+
45
+ gen.generate(klass, result)
46
+ end
47
+
48
+ end
49
+
50
+ namespace :export do
51
+
52
+ desc "Export active record data to .xls (Excel) file"
53
+
54
+ task :excel, [:model, :result] => [:environment] do |t, args|
55
+
56
+ require 'excel_generator'
57
+
58
+ # in familiar ruby style args seems to have been become empty using this new style for rake 0.9.2
59
+ # whatever format i try, on both Win and OSX .. so had to revert back to ENV
60
+ model = ENV['model']
61
+ result = ENV['result']
62
+
63
+ raise "USAGE: jruby -S rake ar_loader:gen:excel model=<Class> result=<file.xls>" unless(result)
64
+ raise "ERROR: Cannot process without AR Model - please supply model=<Class>" unless(model)
65
+
66
+ begin
67
+ klass = Kernel.const_get(model)
68
+ rescue NameError
69
+ raise "ERROR: No such AR Model found - check valid model supplied via model=<Class>"
70
+ end
71
+
72
+ gen = ARLoader::ExcelGenerator.new
73
+
74
+
75
+ gen.export(klass.all, result)
76
+ end
77
+
78
+ end
79
+
80
+ end
metadata CHANGED
@@ -1,16 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_loader
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 13
4
5
  prerelease:
5
- version: 0.0.8
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 9
10
+ version: 0.0.9
6
11
  platform: ruby
7
12
  authors:
8
- - thomas statter
13
+ - thomas statter
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-08-15 00:00:00 +01:00
18
+ date: 2011-09-25 00:00:00 +01:00
14
19
  default_executable:
15
20
  dependencies: []
16
21
 
@@ -21,62 +26,68 @@ executables: []
21
26
  extensions: []
22
27
 
23
28
  extra_rdoc_files:
24
- - README.markdown
25
- - LICENSE
29
+ - README.markdown
30
+ - LICENSE
26
31
  files:
27
- - LICENSE
28
- - README.markdown
29
- - Rakefile
30
- - lib/ar_loader.rb
31
- - lib/to_b.rb
32
- - lib/VERSION
33
- - lib/ar_loader/exceptions.rb
34
- - lib/ar_loader/file_definitions.rb
35
- - lib/ar_loader/mapping_file_definitions.rb
36
- - lib/ar_loader/method_detail.rb
37
- - lib/ar_loader/method_mapper.rb
38
- - lib/helpers/spree_helper.rb
39
- - lib/helpers/jruby/jexcel_file.rb
40
- - lib/helpers/jruby/word.rb
41
- - lib/java/poi-3.2-FINAL-20081019.jar
42
- - lib/java/poi-3.6.jar
43
- - lib/java/poi-contrib-3.6-20091214.jar
44
- - lib/java/poi-examples-3.6-20091214.jar
45
- - lib/java/poi-ooxml-3.6-20091214.jar
46
- - lib/java/poi-ooxml-schemas-3.6-20091214.jar
47
- - lib/java/poi-scratchpad-3.6-20091214.jar
48
- - lib/loaders/csv_loader.rb
49
- - lib/loaders/excel_loader.rb
50
- - lib/loaders/loader_base.rb
51
- - lib/loaders/spree/image_loader.rb
52
- - lib/loaders/spree/product_loader.rb
53
- - spec/csv_loader_spec.rb
54
- - spec/database.yml
55
- - spec/excel_loader_spec.rb
56
- - spec/loader_spec.rb
57
- - spec/method_mapper_spec.rb
58
- - spec/models.rb
59
- - spec/spec_helper.rb
60
- - spec/spree_loader_spec.rb
61
- - spec/db/migrate/20110803201325_create_test_bed.rb
62
- - spec/fixtures/BadAssociationName.xls
63
- - spec/fixtures/DemoNegativeTesting.xls
64
- - spec/fixtures/DemoTestModelAssoc.xls
65
- - spec/fixtures/ProjectsMultiCategories.xls
66
- - spec/fixtures/SimpleProjects.xls
67
- - spec/fixtures/SpreeProducts.xls
68
- - spec/fixtures/SpreeZoneExample.csv
69
- - spec/fixtures/SpreeZoneExample.xls
70
- - spec/logs/test.log
71
- - tasks/db_tasks.rake
72
- - tasks/excel_loader.rake
73
- - tasks/file_tasks.rake
74
- - tasks/loader.rake
75
- - tasks/word_to_seedfu.rake
76
- - tasks/config/seed_fu_product_template.erb
77
- - tasks/config/tidy_config.txt
78
- - tasks/spree/image_load.rake
79
- - tasks/spree/product_loader.rake
32
+ - LICENSE
33
+ - README.markdown
34
+ - Rakefile
35
+ - lib/ar_loader/exceptions.rb
36
+ - lib/ar_loader/file_definitions.rb
37
+ - lib/ar_loader/mapping_file_definitions.rb
38
+ - lib/ar_loader/method_detail.rb
39
+ - lib/ar_loader/method_mapper.rb
40
+ - lib/ar_loader.rb
41
+ - lib/generators/excel_generator.rb
42
+ - lib/generators/generator_base.rb
43
+ - lib/helpers/jruby/jexcel_file.rb
44
+ - lib/helpers/jruby/word.rb
45
+ - lib/helpers/spree_helper.rb
46
+ - lib/java/poi-3.6.jar
47
+ - lib/java/poi-contrib-3.6-20091214.jar
48
+ - lib/java/poi-examples-3.6-20091214.jar
49
+ - lib/java/poi-ooxml-3.6-20091214.jar
50
+ - lib/java/poi-ooxml-schemas-3.6-20091214.jar
51
+ - lib/java/poi-scratchpad-3.6-20091214.jar
52
+ - lib/loaders/csv_loader.rb
53
+ - lib/loaders/excel_loader.rb
54
+ - lib/loaders/loader_base.rb
55
+ - lib/loaders/spree/image_loader.rb
56
+ - lib/loaders/spree/product_loader.rb
57
+ - lib/to_b.rb
58
+ - lib/VERSION
59
+ - spec/csv_loader_spec.rb
60
+ - spec/database.yml
61
+ - spec/db/migrate/20110803201325_create_test_bed.rb
62
+ - spec/excel_generator_spec.rb
63
+ - spec/excel_loader_spec.rb
64
+ - spec/fixtures/BadAssociationName.xls
65
+ - spec/fixtures/DemoNegativeTesting.xls
66
+ - spec/fixtures/DemoTestModelAssoc.xls
67
+ - spec/fixtures/ProjectsMultiCategories.xls
68
+ - spec/fixtures/results/simple_export_spec.xls
69
+ - spec/fixtures/simple_export_spec.xls
70
+ - spec/fixtures/simple_template_spec.xls
71
+ - spec/fixtures/SimpleProjects.xls
72
+ - spec/fixtures/SpreeProducts.xls
73
+ - spec/fixtures/SpreeZoneExample.csv
74
+ - spec/fixtures/SpreeZoneExample.xls
75
+ - spec/loader_spec.rb
76
+ - spec/logs/test.log
77
+ - spec/method_mapper_spec.rb
78
+ - spec/models.rb
79
+ - spec/spec_helper.rb
80
+ - spec/spree_loader_spec.rb
81
+ - tasks/config/seed_fu_product_template.erb
82
+ - tasks/config/tidy_config.txt
83
+ - tasks/db_tasks.rake
84
+ - tasks/excel_generator.rake
85
+ - tasks/excel_loader.rake
86
+ - tasks/file_tasks.rake
87
+ - tasks/loader.rake
88
+ - tasks/spree/image_load.rake
89
+ - tasks/spree/product_loader.rake
90
+ - tasks/word_to_seedfu.rake
80
91
  has_rdoc: true
81
92
  homepage: http://www.autotelik.co.uk
82
93
  licenses: []
@@ -85,23 +96,29 @@ post_install_message:
85
96
  rdoc_options: []
86
97
 
87
98
  require_paths:
88
- - lib
99
+ - lib
89
100
  required_ruby_version: !ruby/object:Gem::Requirement
90
101
  none: false
91
102
  requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: "0"
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ hash: 3
106
+ segments:
107
+ - 0
108
+ version: "0"
95
109
  required_rubygems_version: !ruby/object:Gem::Requirement
96
110
  none: false
97
111
  requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: "0"
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ hash: 3
115
+ segments:
116
+ - 0
117
+ version: "0"
101
118
  requirements: []
102
119
 
103
120
  rubyforge_project:
104
- rubygems_version: 1.5.1
121
+ rubygems_version: 1.6.2
105
122
  signing_key:
106
123
  specification_version: 3
107
124
  summary: File based loader for Active Record models
Binary file