mainej-activewarehouse 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/activewarehouse/README +99 -0
- data/activewarehouse/Rakefile +165 -0
- data/activewarehouse/TODO +4 -0
- data/activewarehouse/db/migrations/001_create_table_reports.rb +28 -0
- data/activewarehouse/doc/references.txt +4 -0
- data/activewarehouse/generators/bridge/USAGE +1 -0
- data/activewarehouse/generators/bridge/bridge_generator.rb +46 -0
- data/activewarehouse/generators/bridge/templates/fixture.yml +5 -0
- data/activewarehouse/generators/bridge/templates/migration.rb +27 -0
- data/activewarehouse/generators/bridge/templates/model.rb +3 -0
- data/activewarehouse/generators/bridge/templates/unit_test.rb +8 -0
- data/activewarehouse/generators/cube/USAGE +1 -0
- data/activewarehouse/generators/cube/cube_generator.rb +28 -0
- data/activewarehouse/generators/cube/templates/model.rb +3 -0
- data/activewarehouse/generators/cube/templates/unit_test.rb +8 -0
- data/activewarehouse/generators/date_dimension/USAGE +1 -0
- data/activewarehouse/generators/date_dimension/date_dimension_generator.rb +16 -0
- data/activewarehouse/generators/date_dimension/templates/fixture.yml +5 -0
- data/activewarehouse/generators/date_dimension/templates/migration.rb +31 -0
- data/activewarehouse/generators/date_dimension/templates/model.rb +3 -0
- data/activewarehouse/generators/date_dimension/templates/unit_test.rb +8 -0
- data/activewarehouse/generators/dimension/USAGE +1 -0
- data/activewarehouse/generators/dimension/dimension_generator.rb +46 -0
- data/activewarehouse/generators/dimension/templates/fixture.yml +5 -0
- data/activewarehouse/generators/dimension/templates/migration.rb +11 -0
- data/activewarehouse/generators/dimension/templates/model.rb +3 -0
- data/activewarehouse/generators/dimension/templates/unit_test.rb +8 -0
- data/activewarehouse/generators/dimension_view/USAGE +1 -0
- data/activewarehouse/generators/dimension_view/dimension_view_generator.rb +62 -0
- data/activewarehouse/generators/dimension_view/templates/migration.rb +17 -0
- data/activewarehouse/generators/dimension_view/templates/model.rb +3 -0
- data/activewarehouse/generators/dimension_view/templates/unit_test.rb +10 -0
- data/activewarehouse/generators/fact/USAGE +1 -0
- data/activewarehouse/generators/fact/fact_generator.rb +46 -0
- data/activewarehouse/generators/fact/templates/fixture.yml +5 -0
- data/activewarehouse/generators/fact/templates/migration.rb +13 -0
- data/activewarehouse/generators/fact/templates/model.rb +3 -0
- data/activewarehouse/generators/fact/templates/unit_test.rb +10 -0
- data/activewarehouse/generators/time_dimension/USAGE +1 -0
- data/activewarehouse/generators/time_dimension/templates/fixture.yml +5 -0
- data/activewarehouse/generators/time_dimension/templates/migration.rb +12 -0
- data/activewarehouse/generators/time_dimension/templates/model.rb +3 -0
- data/activewarehouse/generators/time_dimension/templates/unit_test.rb +8 -0
- data/activewarehouse/generators/time_dimension/time_dimension_generator.rb +14 -0
- data/activewarehouse/init.rb +1 -0
- data/activewarehouse/install.rb +5 -0
- data/activewarehouse/lib/active_warehouse.rb +91 -0
- data/activewarehouse/lib/active_warehouse/aggregate.rb +75 -0
- data/activewarehouse/lib/active_warehouse/aggregate/dwarf_aggregate.rb +369 -0
- data/activewarehouse/lib/active_warehouse/aggregate/dwarf_common.rb +44 -0
- data/activewarehouse/lib/active_warehouse/aggregate/dwarf_printer.rb +34 -0
- data/activewarehouse/lib/active_warehouse/aggregate/no_aggregate.rb +212 -0
- data/activewarehouse/lib/active_warehouse/aggregate/pid_aggregate.rb +29 -0
- data/activewarehouse/lib/active_warehouse/aggregate_field.rb +59 -0
- data/activewarehouse/lib/active_warehouse/bridge.rb +19 -0
- data/activewarehouse/lib/active_warehouse/bridge/hierarchy_bridge.rb +46 -0
- data/activewarehouse/lib/active_warehouse/builder.rb +3 -0
- data/activewarehouse/lib/active_warehouse/builder/date_dimension_builder.rb +91 -0
- data/activewarehouse/lib/active_warehouse/builder/generator/generator.rb +13 -0
- data/activewarehouse/lib/active_warehouse/builder/generator/name_generator.rb +20 -0
- data/activewarehouse/lib/active_warehouse/builder/generator/paragraph_generator.rb +11 -0
- data/activewarehouse/lib/active_warehouse/builder/random_data_builder.rb +239 -0
- data/activewarehouse/lib/active_warehouse/builder/test_data_builder.rb +54 -0
- data/activewarehouse/lib/active_warehouse/calculated_field.rb +27 -0
- data/activewarehouse/lib/active_warehouse/compat/compat.rb +49 -0
- data/activewarehouse/lib/active_warehouse/core_ext.rb +1 -0
- data/activewarehouse/lib/active_warehouse/core_ext/time.rb +5 -0
- data/activewarehouse/lib/active_warehouse/core_ext/time/calculations.rb +40 -0
- data/activewarehouse/lib/active_warehouse/cube.rb +235 -0
- data/activewarehouse/lib/active_warehouse/cube_query_result.rb +69 -0
- data/activewarehouse/lib/active_warehouse/dimension.rb +329 -0
- data/activewarehouse/lib/active_warehouse/dimension/date_dimension.rb +15 -0
- data/activewarehouse/lib/active_warehouse/dimension/dimension_reflection.rb +21 -0
- data/activewarehouse/lib/active_warehouse/dimension/dimension_view.rb +27 -0
- data/activewarehouse/lib/active_warehouse/dimension/hierarchical_dimension.rb +99 -0
- data/activewarehouse/lib/active_warehouse/dimension/slowly_changing_dimension.rb +147 -0
- data/activewarehouse/lib/active_warehouse/fact.rb +239 -0
- data/activewarehouse/lib/active_warehouse/field.rb +74 -0
- data/activewarehouse/lib/active_warehouse/migrations.rb +64 -0
- data/activewarehouse/lib/active_warehouse/ordered_hash.rb +34 -0
- data/activewarehouse/lib/active_warehouse/prejoin_fact.rb +97 -0
- data/activewarehouse/lib/active_warehouse/report.rb +7 -0
- data/activewarehouse/lib/active_warehouse/report/abstract_report.rb +149 -0
- data/activewarehouse/lib/active_warehouse/report/chart_report.rb +9 -0
- data/activewarehouse/lib/active_warehouse/report/data_cell.rb +21 -0
- data/activewarehouse/lib/active_warehouse/report/data_column.rb +19 -0
- data/activewarehouse/lib/active_warehouse/report/data_row.rb +15 -0
- data/activewarehouse/lib/active_warehouse/report/dimension.rb +58 -0
- data/activewarehouse/lib/active_warehouse/report/table_report.rb +38 -0
- data/activewarehouse/lib/active_warehouse/version.rb +9 -0
- data/activewarehouse/lib/active_warehouse/view.rb +9 -0
- data/activewarehouse/lib/active_warehouse/view/crumb.rb +64 -0
- data/activewarehouse/lib/active_warehouse/view/report_helper.rb +98 -0
- data/activewarehouse/lib/active_warehouse/view/table_view.rb +134 -0
- data/activewarehouse/lib/active_warehouse/view/yui_adapter.rb +68 -0
- data/activewarehouse/tasks/active_warehouse_tasks.rake +122 -0
- metadata +237 -0
@@ -0,0 +1 @@
|
|
1
|
+
./script/generate date_dimension
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class DateDimensionGenerator < DimensionGenerator
|
2
|
+
attr_accessor :file_name
|
3
|
+
attr_accessor :include_fiscal_year
|
4
|
+
|
5
|
+
default_options :skip_migration => false
|
6
|
+
|
7
|
+
def initialize(runtime_args, runtime_options = {})
|
8
|
+
super
|
9
|
+
|
10
|
+
@name = 'date'
|
11
|
+
@table_name = "#{@name}_dimension"
|
12
|
+
@class_name = "#{@name.camelize}Dimension"
|
13
|
+
@file_name = "#{@class_name.tableize.singularize}"
|
14
|
+
@include_fiscal_year = true # TODO: accept a runtime option to set this
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class <%= migration_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
t.column :sql_date_stamp, :date, :null => false # SQL Date object
|
5
|
+
t.column :calendar_year, :string, :null => false # 2005, 2006, 2007, etc.
|
6
|
+
t.column :calendar_quarter, :string, :null => false, :limit => 2 # Q1, Q2, Q3 or Q4
|
7
|
+
t.column :calendar_quarter_number, :integer, :null => false # 1, 2, 3 or 4
|
8
|
+
t.column :calendar_month_name, :string, :null => false, :limit => 9 # January, February, etc.
|
9
|
+
t.column :calendar_month_number, :integer, :null => false # 1, 2, 3, ... 12
|
10
|
+
t.column :calendar_week, :string, :null => false, :limit => 2 # 1, 2, 3, ... 52
|
11
|
+
t.column :calendar_week_number, :integer, :null => false # 1, 2, 3, ... 52
|
12
|
+
t.column :day_number_in_calendar_year, :integer, :null => false # 1, 2, 3, ... 365
|
13
|
+
t.column :day_number_in_calendar_month, :integer, :null => false # 1, 2, 3, ... 31
|
14
|
+
t.column :day_in_week, :string, :null => false, :limit => 9 # Monday, Tuesday, etc.
|
15
|
+
<% if include_fiscal_year -%>
|
16
|
+
t.column :fiscal_year, :string, :null => false
|
17
|
+
t.column :fiscal_quarter, :string, :null => false, :limit => 2
|
18
|
+
t.column :fiscal_quarter_number, :integer, :null => false
|
19
|
+
t.column :fiscal_month_number, :integer, :null => false
|
20
|
+
t.column :fiscal_week, :string, :null => false, :limit => 2
|
21
|
+
t.column :fiscal_week_number, :integer, :null => false
|
22
|
+
t.column :day_number_in_fiscal_year, :integer, :null => false
|
23
|
+
<% end -%>
|
24
|
+
end
|
25
|
+
# add indexes as required
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.down
|
29
|
+
drop_table :<%= table_name %>
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
./script/generate dimension NAME
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class DimensionGenerator < Rails::Generator::NamedBase
|
2
|
+
attr_accessor :file_name
|
3
|
+
|
4
|
+
default_options :skip_migration => false
|
5
|
+
|
6
|
+
def initialize(runtime_args, runtime_options = {})
|
7
|
+
super
|
8
|
+
|
9
|
+
@name = @name.tableize.singularize
|
10
|
+
@table_name = "#{@name}_dimension"
|
11
|
+
@class_name = "#{@name.camelize}Dimension"
|
12
|
+
@file_name = "#{@class_name.tableize.singularize}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def manifest
|
16
|
+
record do |m|
|
17
|
+
# Check for class naming collisions.
|
18
|
+
m.class_collisions class_path, "#{class_name}", "#{class_name}Test"
|
19
|
+
|
20
|
+
# Create required directories if necessary
|
21
|
+
m.directory File.join('app/models', class_path)
|
22
|
+
m.directory File.join('test/unit', class_path)
|
23
|
+
m.directory File.join('test/fixtures', class_path)
|
24
|
+
|
25
|
+
# Generate the files
|
26
|
+
m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
|
27
|
+
m.template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
|
28
|
+
m.template 'fixture.yml', File.join('test/fixtures', class_path, "#{table_name}.yml")
|
29
|
+
|
30
|
+
# Generate the migration unless :skip_migration option is specified
|
31
|
+
unless options[:skip_migration]
|
32
|
+
m.migration_template 'migration.rb', 'db/migrate', :assigns => {
|
33
|
+
:migration_name => "Create#{class_name.gsub(/::/, '')}"
|
34
|
+
}, :migration_file_name => "create_#{file_name.gsub(/\//, '_')}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
protected
|
40
|
+
def add_options!(opt)
|
41
|
+
opt.separator ''
|
42
|
+
opt.separator 'Options:'
|
43
|
+
opt.on("--skip-migration",
|
44
|
+
"Don't generate a migration file for this dimension") { |v| options[:skip_migration] = v }
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
./script/generate dimension_view NAME
|
@@ -0,0 +1,62 @@
|
|
1
|
+
class DimensionViewGenerator < Rails::Generator::NamedBase
|
2
|
+
attr_accessor :file_name, :view_name, :query_target_name, :query_target_table_name, :view_query, :view_attributes
|
3
|
+
|
4
|
+
default_options :skip_migration => false
|
5
|
+
|
6
|
+
def initialize(runtime_args, runtime_options = {})
|
7
|
+
super
|
8
|
+
|
9
|
+
usage if runtime_args.length != 2
|
10
|
+
|
11
|
+
@name = @name.tableize.singularize
|
12
|
+
@query_target_name = runtime_args[1]
|
13
|
+
# define the view and query target table name
|
14
|
+
@view_name = "#{@name}_dimension"
|
15
|
+
@query_target_table_name = "#{query_target_name}_dimension"
|
16
|
+
# define the view class name and query target class name
|
17
|
+
@class_name = "#{view_name.camelize}"
|
18
|
+
@query_target_class_name = "#{query_target_table_name.camelize}"
|
19
|
+
# define the output file name
|
20
|
+
@file_name = "#{class_name.tableize.singularize}"
|
21
|
+
# define the query target class and expose its columns as attributes for the view
|
22
|
+
@query_target_class = @query_target_class_name.constantize
|
23
|
+
@view_attributes = @query_target_class.column_names
|
24
|
+
@view_query = "select #{@view_attributes.join(',')} from #{query_target_table_name}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def manifest
|
28
|
+
record do |m|
|
29
|
+
# Check for class naming collisions.
|
30
|
+
m.class_collisions class_path, "#{class_name}", "#{class_name}Test"
|
31
|
+
|
32
|
+
# Create required directories if necessary
|
33
|
+
m.directory File.join('app/models', class_path)
|
34
|
+
m.directory File.join('test/unit', class_path)
|
35
|
+
m.directory File.join('test/fixtures', class_path)
|
36
|
+
|
37
|
+
# Generate the files
|
38
|
+
m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
|
39
|
+
m.template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
|
40
|
+
#m.template 'fixture.yml', File.join('test/fixtures', class_path, "#{table_name}.yml")
|
41
|
+
|
42
|
+
# Generate the migration unless :skip_migration option is specified
|
43
|
+
unless options[:skip_migration]
|
44
|
+
m.migration_template 'migration.rb', 'db/migrate', :assigns => {
|
45
|
+
:migration_name => "Create#{class_name.gsub(/::/, '')}"
|
46
|
+
}, :migration_file_name => "create_#{file_name.gsub(/\//, '_')}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def banner
|
52
|
+
"Usage: #{$0} #{spec.name} #{spec.name.camelize}Name SelectTarget [options]"
|
53
|
+
end
|
54
|
+
|
55
|
+
protected
|
56
|
+
def add_options!(opt)
|
57
|
+
opt.separator ''
|
58
|
+
opt.separator 'Options:'
|
59
|
+
opt.on("--skip-migration",
|
60
|
+
"Don't generate a migration file for this dimension view") { |v| options[:skip_migration] = v }
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class <%= migration_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_view "<%= view_name %>", "<%= view_query %>" do |t|
|
4
|
+
<%- view_attributes.each do |view_attribute| -%>
|
5
|
+
<%- if view_attribute == 'id' -%>
|
6
|
+
t.column :id
|
7
|
+
<%- else -%>
|
8
|
+
t.column :<%= name %>_<%= view_attribute %>
|
9
|
+
<%- end -%>
|
10
|
+
<%- end -%>
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_view "<%= view_name %>"
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
./script/generate fact NAME
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class FactGenerator < Rails::Generator::NamedBase
|
2
|
+
attr_accessor :file_name
|
3
|
+
|
4
|
+
default_options :skip_migration => false
|
5
|
+
|
6
|
+
def initialize(runtime_args, runtime_options = {})
|
7
|
+
super
|
8
|
+
|
9
|
+
@name = @name.underscore
|
10
|
+
@table_name = "#{@name}_facts"
|
11
|
+
@class_name = "#{@name.camelize}Fact"
|
12
|
+
@file_name = "#{@class_name.tableize.singularize}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def manifest
|
16
|
+
record do |m|
|
17
|
+
# Check for class naming collisions.
|
18
|
+
m.class_collisions class_path, "#{class_name}", "#{class_name}Test"
|
19
|
+
|
20
|
+
# Create required directories if necessary
|
21
|
+
m.directory File.join('app/models', class_path)
|
22
|
+
m.directory File.join('test/unit', class_path)
|
23
|
+
m.directory File.join('test/fixtures', class_path)
|
24
|
+
|
25
|
+
# Generate the files
|
26
|
+
m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
|
27
|
+
m.template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
|
28
|
+
m.template 'fixture.yml', File.join('test/fixtures', class_path, "#{table_name}.yml")
|
29
|
+
|
30
|
+
# Generate the migration unless :skip_migration option is specified
|
31
|
+
unless options[:skip_migration]
|
32
|
+
m.migration_template 'migration.rb', 'db/migrate', :assigns => {
|
33
|
+
:migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}"
|
34
|
+
}, :migration_file_name => "create_#{file_name.gsub(/\//, '_').pluralize}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
protected
|
40
|
+
def add_options!(opt)
|
41
|
+
opt.separator ''
|
42
|
+
opt.separator 'Options:'
|
43
|
+
opt.on("--skip-migration",
|
44
|
+
"Don't generate a migration file for this fact") { |v| options[:skip_migration] = v }
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class <%= migration_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
|
5
|
+
end
|
6
|
+
# you should add indexes for each foreign key, but don't add
|
7
|
+
# the foreign key itself unless you really know what you are doing.
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
drop_table :<%= table_name %>
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
./script/generate time_dimension
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class <%= migration_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
t.column :hour_of_day, :integer, :null => false
|
5
|
+
t.column :minute_of_hour, :integer, :null => false
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
drop_table :<%= table_name %>
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class TimeDimensionGenerator < DimensionGenerator
|
2
|
+
attr_accessor :file_name
|
3
|
+
|
4
|
+
default_options :skip_migration => false
|
5
|
+
|
6
|
+
def initialize(runtime_args, runtime_options = {})
|
7
|
+
super
|
8
|
+
|
9
|
+
@name = 'date'
|
10
|
+
@table_name = "#{@name}_dimension"
|
11
|
+
@class_name = "#{@name.camelize}Dimension"
|
12
|
+
@file_name = "#{@class_name.tableize.singularize}"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'active_warehouse'
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# This source file requires all of the necessary gems and source files for ActiveWarehouse. If you
|
2
|
+
# load this source file all of the other required files and gems will also be brought into the
|
3
|
+
# runtime.
|
4
|
+
|
5
|
+
#--
|
6
|
+
# Copyright (c) 2006-2007 Anthony Eden
|
7
|
+
#
|
8
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
9
|
+
# a copy of this software and associated documentation files (the
|
10
|
+
# "Software"), to deal in the Software without restriction, including
|
11
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
12
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
13
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
14
|
+
# the following conditions:
|
15
|
+
#
|
16
|
+
# The above copyright notice and this permission notice shall be
|
17
|
+
# included in all copies or substantial portions of the Software.
|
18
|
+
#
|
19
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
20
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
21
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
22
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
23
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
24
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
25
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
26
|
+
#++
|
27
|
+
|
28
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
29
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
30
|
+
|
31
|
+
require 'rubygems'
|
32
|
+
unless Kernel.respond_to?(:gem)
|
33
|
+
Kernel.send :alias_method, :gem, :require_gem
|
34
|
+
end
|
35
|
+
|
36
|
+
unless defined?(ActiveSupport)
|
37
|
+
begin
|
38
|
+
$:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
|
39
|
+
require 'active_support'
|
40
|
+
rescue LoadError
|
41
|
+
gem 'activesupport'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
unless defined?(ActiveRecord)
|
46
|
+
begin
|
47
|
+
$:.unshift(File.dirname(__FILE__) + "/../../activerecord/lib")
|
48
|
+
require 'active_record'
|
49
|
+
rescue LoadError
|
50
|
+
gem 'activerecord'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
unless defined?(ActionView)
|
55
|
+
begin
|
56
|
+
$:.unshift(File.dirname(__FILE__) + "/../../actionpack/lib")
|
57
|
+
require 'action_pack'
|
58
|
+
require 'action_controller'
|
59
|
+
require 'action_view'
|
60
|
+
rescue LoadError
|
61
|
+
gem 'actionpack'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
require 'fastercsv'
|
66
|
+
require 'fileutils'
|
67
|
+
require 'adapter_extensions'
|
68
|
+
|
69
|
+
# Require 1.1.6 compatibility code if necessary
|
70
|
+
require 'active_record/version'
|
71
|
+
if ActiveRecord::VERSION::MAJOR < 1 || ActiveRecord::VERSION::MINOR < 15
|
72
|
+
require 'active_warehouse/compat/compat'
|
73
|
+
end
|
74
|
+
|
75
|
+
require 'active_warehouse/ordered_hash'
|
76
|
+
require 'active_warehouse/field'
|
77
|
+
require 'active_warehouse/aggregate_field'
|
78
|
+
require 'active_warehouse/calculated_field'
|
79
|
+
require 'active_warehouse/version'
|
80
|
+
require 'active_warehouse/core_ext'
|
81
|
+
require 'active_warehouse/prejoin_fact'
|
82
|
+
require 'active_warehouse/fact'
|
83
|
+
require 'active_warehouse/bridge'
|
84
|
+
require 'active_warehouse/dimension'
|
85
|
+
require 'active_warehouse/cube'
|
86
|
+
require 'active_warehouse/cube_query_result'
|
87
|
+
require 'active_warehouse/aggregate'
|
88
|
+
require 'active_warehouse/report'
|
89
|
+
require 'active_warehouse/view'
|
90
|
+
require 'active_warehouse/builder'
|
91
|
+
require 'active_warehouse/migrations'
|