rubiks 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +12 -12
- data/Gemfile +2 -0
- data/README.md +90 -72
- data/lib/rubiks/calculated_measure.rb +26 -0
- data/lib/rubiks/cube.rb +80 -0
- data/lib/rubiks/dimension.rb +48 -0
- data/lib/rubiks/hierarchy.rb +46 -0
- data/lib/rubiks/jars/commons-collections.jar +0 -0
- data/lib/rubiks/jars/commons-dbcp.jar +0 -0
- data/lib/rubiks/jars/commons-logging.jar +0 -0
- data/lib/rubiks/jars/commons-math.jar +0 -0
- data/lib/rubiks/jars/commons-pool.jar +0 -0
- data/lib/rubiks/jars/commons-vfs.jar +0 -0
- data/lib/rubiks/jars/eigenbase-properties.jar +0 -0
- data/lib/rubiks/jars/eigenbase-resgen.jar +0 -0
- data/lib/rubiks/jars/eigenbase-xom.jar +0 -0
- data/lib/rubiks/jars/log4j.jar +0 -0
- data/lib/rubiks/jars/mondrian.jar +0 -0
- data/lib/rubiks/jars/olap4j-1.2.0-SNAPSHOT.jar +0 -0
- data/lib/rubiks/jars/olap4j-xmla-1.2.0-SNAPSHOT.jar +0 -0
- data/lib/rubiks/jars/olap4j-xmla.jar.orig +0 -0
- data/lib/rubiks/jars/olap4j-xmlaserver-0.0.1-SNAPSHOT.jar +0 -0
- data/lib/rubiks/jars/olap4j.jar.orig +0 -0
- data/lib/rubiks/jars/postgresql-9.2-1002.jdbc3.jar +0 -0
- data/lib/rubiks/jars/postgresql-9.2-1002.jdbc4.jar +0 -0
- data/lib/rubiks/level.rb +57 -0
- data/lib/rubiks/measure.rb +28 -0
- data/lib/rubiks/mondrian/cell_set.rb +148 -0
- data/lib/rubiks/mondrian/connection.rb +131 -0
- data/lib/rubiks/mondrian/errors.rb +56 -0
- data/lib/rubiks/mondrian/jars/commons-collections-3.2.jar +0 -0
- data/lib/rubiks/mondrian/jars/commons-dbcp-1.2.2.jar +0 -0
- data/lib/rubiks/mondrian/jars/commons-logging-1.1.1.jar +0 -0
- data/lib/rubiks/mondrian/jars/commons-math-1.2.jar +0 -0
- data/lib/rubiks/mondrian/jars/commons-pool-1.4.jar +0 -0
- data/lib/rubiks/mondrian/jars/eigenbase-properties-1.1.2.jar +0 -0
- data/lib/rubiks/mondrian/jars/eigenbase-resgen-1.3.1.jar +0 -0
- data/lib/rubiks/mondrian/jars/eigenbase-xom-1.3.1.jar +0 -0
- data/lib/rubiks/mondrian/jars/log4j-1.2.17.jar +0 -0
- data/lib/rubiks/mondrian/jars/mondrian-4.0.0-SNAPSHOT.jar +0 -0
- data/lib/rubiks/mondrian/jars/olap4j-1.2.0-SNAPSHOT.jar +0 -0
- data/lib/rubiks/mondrian/jars/olap4j-xmla-1.2.0-SNAPSHOT.jar +0 -0
- data/lib/rubiks/mondrian/jars/olap4j-xmlaserver-0.0.1-SNAPSHOT.jar +0 -0
- data/lib/rubiks/mondrian/member.rb +107 -0
- data/lib/rubiks/mondrian.rb +44 -0
- data/lib/rubiks/named_object.rb +121 -0
- data/lib/rubiks/schema.rb +28 -0
- data/lib/rubiks/version.rb +1 -1
- data/lib/rubiks.rb +28 -4
- data/rubiks.gemspec +2 -1
- data/spec/examples/simple_mondrian_schema_spec.rb +56 -0
- data/spec/rubiks/calculated_measure_spec.rb +12 -0
- data/spec/rubiks/cube_spec.rb +29 -0
- data/spec/rubiks/dimension_spec.rb +12 -0
- data/spec/rubiks/hierarchy_spec.rb +15 -0
- data/spec/rubiks/level_spec.rb +20 -0
- data/spec/rubiks/measure_spec.rb +11 -0
- data/spec/rubiks/schema_spec.rb +32 -0
- data/spec/spec_helper.rb +10 -3
- data/spec/support/shared_examples.rb +12 -0
- metadata +85 -47
- data/lib/rubiks/examples.rb +0 -61
- data/lib/rubiks/nodes/annotated_node.rb +0 -26
- data/lib/rubiks/nodes/calculated_member.rb +0 -81
- data/lib/rubiks/nodes/cube.rb +0 -149
- data/lib/rubiks/nodes/dimension.rb +0 -72
- data/lib/rubiks/nodes/hierarchy.rb +0 -100
- data/lib/rubiks/nodes/level.rb +0 -133
- data/lib/rubiks/nodes/measure.rb +0 -75
- data/lib/rubiks/nodes/schema.rb +0 -72
- data/lib/rubiks/nodes/validated_node.rb +0 -79
- data/spec/examples/mondrian_docs_example_spec.rb +0 -108
- data/spec/examples/simple_mondrian_example_spec.rb +0 -84
- data/spec/rubiks/nodes/annotated_node_spec.rb +0 -24
- data/spec/rubiks/nodes/calculated_member_spec.rb +0 -50
- data/spec/rubiks/nodes/cube_spec.rb +0 -63
- data/spec/rubiks/nodes/dimension_spec.rb +0 -41
- data/spec/rubiks/nodes/hierarchy_spec.rb +0 -48
- data/spec/rubiks/nodes/level_spec.rb +0 -93
- data/spec/rubiks/nodes/measure_spec.rb +0 -55
- data/spec/rubiks/nodes/schema_spec.rb +0 -38
- data/spec/rubiks/nodes/validated_node_spec.rb +0 -49
- data/spec/support/examples/mondrian_docs.yml +0 -36
- data/spec/support/examples/shared_dimensions.yml +0 -45
- data/spec/support/matchers/be_like.rb +0 -24
- data/spec/support/schema_context.rb +0 -59
@@ -1,45 +0,0 @@
|
|
1
|
-
shared_dimensions:
|
2
|
-
date_dimension: &date_dimension
|
3
|
-
name: date
|
4
|
-
hierarchies:
|
5
|
-
- name: year_quarter_month
|
6
|
-
levels:
|
7
|
-
- name: year
|
8
|
-
column: the_year
|
9
|
-
data_type: numeric
|
10
|
-
|
11
|
-
- name: quarter
|
12
|
-
data_type: string
|
13
|
-
|
14
|
-
- name: month
|
15
|
-
column: month_of_year
|
16
|
-
data_type: Numeric
|
17
|
-
|
18
|
-
gender_dimension: &gender_dimension
|
19
|
-
name: gender
|
20
|
-
hierarchies:
|
21
|
-
- name: gender
|
22
|
-
table: customer
|
23
|
-
levels:
|
24
|
-
- name: gender
|
25
|
-
data_type: string
|
26
|
-
|
27
|
-
cubes:
|
28
|
-
- name: sales
|
29
|
-
dimensions:
|
30
|
-
- <<: *date_dimension
|
31
|
-
- <<: *gender_dimension
|
32
|
-
|
33
|
-
measures:
|
34
|
-
- name: unit_sales
|
35
|
-
aggregator: sum
|
36
|
-
format_string: '#,###'
|
37
|
-
|
38
|
-
- name: logins
|
39
|
-
dimensions:
|
40
|
-
- <<: *date_dimension
|
41
|
-
- <<: *gender_dimension
|
42
|
-
|
43
|
-
measures:
|
44
|
-
- name: count
|
45
|
-
aggregator: count
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Matchers
|
2
|
-
class BeLike
|
3
|
-
def initialize(expected)
|
4
|
-
@expected = expected.gsub(/>\s*\n\s*/, '> ').gsub(/\s+/, ' ').strip
|
5
|
-
end
|
6
|
-
|
7
|
-
def matches?(actual)
|
8
|
-
@actual = actual.gsub(/>\s*\n\s*/, '> ').gsub(/\s+/, ' ').strip
|
9
|
-
@expected == @actual
|
10
|
-
end
|
11
|
-
|
12
|
-
def failure_message
|
13
|
-
"expected\n#{@actual}\nto be like\n#{@expected}"
|
14
|
-
end
|
15
|
-
|
16
|
-
def negative_failure_message
|
17
|
-
"expected\n#{@actual}\nto be unlike\n#{@expected}"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def be_like(expected)
|
22
|
-
BeLike.new(expected)
|
23
|
-
end
|
24
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
shared_context 'schema_context' do
|
2
|
-
|
3
|
-
def schema_hash
|
4
|
-
{
|
5
|
-
'cubes' => [cube_hash.deep_dup]
|
6
|
-
}
|
7
|
-
end
|
8
|
-
|
9
|
-
def cube_hash
|
10
|
-
{
|
11
|
-
'name' => 'fake_cube',
|
12
|
-
'dimensions' => [dimension_hash.deep_dup],
|
13
|
-
'measures' => [measure_hash.deep_dup],
|
14
|
-
'calculated_members' => [calculated_member_hash.deep_dup]
|
15
|
-
}
|
16
|
-
end
|
17
|
-
|
18
|
-
def dimension_hash
|
19
|
-
{
|
20
|
-
'name' => 'fake_dimension',
|
21
|
-
'hierarchies' => [hierarchy_hash.deep_dup]
|
22
|
-
}
|
23
|
-
end
|
24
|
-
|
25
|
-
def hierarchy_hash
|
26
|
-
{
|
27
|
-
'name' => 'fake_hierarchy',
|
28
|
-
'dimension' => 'fake_dimension',
|
29
|
-
'levels' => [level_hash.deep_dup]
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
def level_hash
|
34
|
-
{
|
35
|
-
'name' => 'fake_level',
|
36
|
-
'data_type' => 'numeric',
|
37
|
-
'cardinality' => 'normal',
|
38
|
-
'contiguous' => true
|
39
|
-
}
|
40
|
-
end
|
41
|
-
|
42
|
-
def measure_hash
|
43
|
-
{
|
44
|
-
'name' => 'fake_measure',
|
45
|
-
'aggregator' => 'sum',
|
46
|
-
'format_string' => '$#,###'
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
def calculated_member_hash
|
51
|
-
{
|
52
|
-
'name' => 'fake_calculated_member',
|
53
|
-
'dimension' => 'fake_dimension',
|
54
|
-
'formula' => 'fake_formula',
|
55
|
-
'format_string' => '$#,##0.00'
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|