mondrian-olap 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/.rspec +2 -0
  2. data/Gemfile +15 -0
  3. data/LICENSE-Mondrian.html +259 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.rdoc +219 -0
  6. data/RUNNING_TESTS.rdoc +41 -0
  7. data/Rakefile +46 -0
  8. data/VERSION +1 -0
  9. data/lib/mondrian-olap.rb +1 -0
  10. data/lib/mondrian/jars/commons-collections-3.1.jar +0 -0
  11. data/lib/mondrian/jars/commons-dbcp-1.2.1.jar +0 -0
  12. data/lib/mondrian/jars/commons-logging-1.0.4.jar +0 -0
  13. data/lib/mondrian/jars/commons-math-1.0.jar +0 -0
  14. data/lib/mondrian/jars/commons-pool-1.2.jar +0 -0
  15. data/lib/mondrian/jars/commons-vfs-1.0.jar +0 -0
  16. data/lib/mondrian/jars/eigenbase-properties.jar +0 -0
  17. data/lib/mondrian/jars/eigenbase-resgen.jar +0 -0
  18. data/lib/mondrian/jars/eigenbase-xom.jar +0 -0
  19. data/lib/mondrian/jars/javacup.jar +0 -0
  20. data/lib/mondrian/jars/log4j-1.2.8.jar +0 -0
  21. data/lib/mondrian/jars/log4j.properties +18 -0
  22. data/lib/mondrian/jars/mondrian.jar +0 -0
  23. data/lib/mondrian/jars/olap4j.jar +0 -0
  24. data/lib/mondrian/olap.rb +14 -0
  25. data/lib/mondrian/olap/connection.rb +122 -0
  26. data/lib/mondrian/olap/cube.rb +236 -0
  27. data/lib/mondrian/olap/query.rb +313 -0
  28. data/lib/mondrian/olap/result.rb +155 -0
  29. data/lib/mondrian/olap/schema.rb +158 -0
  30. data/lib/mondrian/olap/schema_element.rb +123 -0
  31. data/mondrian-olap.gemspec +116 -0
  32. data/spec/connection_spec.rb +56 -0
  33. data/spec/cube_spec.rb +259 -0
  34. data/spec/fixtures/MondrianTest.xml +128 -0
  35. data/spec/fixtures/MondrianTestOracle.xml +128 -0
  36. data/spec/query_spec.rb +582 -0
  37. data/spec/rake_tasks.rb +185 -0
  38. data/spec/schema_definition_spec.rb +345 -0
  39. data/spec/spec_helper.rb +67 -0
  40. data/spec/support/matchers/be_like.rb +24 -0
  41. metadata +217 -0
@@ -0,0 +1,67 @@
1
+ require "rubygems"
2
+ require "bundler"
3
+ Bundler.setup(:default, :development)
4
+
5
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
6
+
7
+ require 'rspec'
8
+ require 'active_record'
9
+
10
+ DATABASE_HOST = ENV['DATABASE_HOST'] || 'localhost'
11
+ DATABASE_USER = ENV['DATABASE_USER'] || 'mondrian_test'
12
+ DATABASE_PASSWORD = ENV['DATABASE_PASSWORD'] || 'mondrian_test'
13
+
14
+ case MONDRIAN_DRIVER = ENV['MONDRIAN_DRIVER'] || 'mysql'
15
+ when 'mysql'
16
+ require 'jdbc/mysql'
17
+ JDBC_DRIVER = 'com.mysql.jdbc.Driver'
18
+ DATABASE_NAME = ENV['DATABASE_NAME'] || 'mondrian_test'
19
+ when 'postgresql'
20
+ require 'jdbc/postgres'
21
+ JDBC_DRIVER = 'org.postgresql.Driver'
22
+ DATABASE_NAME = ENV['DATABASE_NAME'] || 'mondrian_test'
23
+ when 'oracle'
24
+ require 'active_record/connection_adapters/oracle_enhanced_adapter'
25
+ DATABASE_NAME = ENV['DATABASE_NAME'] || 'orcl'
26
+ end
27
+
28
+ puts "==> Using #{MONDRIAN_DRIVER} driver"
29
+
30
+ require 'mondrian/olap'
31
+
32
+ require 'support/matchers/be_like'
33
+
34
+ RSpec.configure do |config|
35
+ config.include Matchers
36
+ end
37
+
38
+ CONNECTION_PARAMS = {
39
+ :driver => MONDRIAN_DRIVER,
40
+ :host => DATABASE_HOST,
41
+ :database => DATABASE_NAME,
42
+ :username => DATABASE_USER,
43
+ :password => DATABASE_PASSWORD
44
+ }
45
+
46
+ if MONDRIAN_DRIVER == 'oracle'
47
+ CATALOG_FILE = File.expand_path('../fixtures/MondrianTestOracle.xml', __FILE__)
48
+ AR_CONNECTION_PARAMS = {
49
+ :adapter => 'oracle_enhanced',
50
+ :host => CONNECTION_PARAMS[:host],
51
+ :database => CONNECTION_PARAMS[:database],
52
+ :username => CONNECTION_PARAMS[:username],
53
+ :password => CONNECTION_PARAMS[:password]
54
+ }
55
+ else
56
+ CATALOG_FILE = File.expand_path('../fixtures/MondrianTest.xml', __FILE__)
57
+ AR_CONNECTION_PARAMS = {
58
+ :adapter => 'jdbc',
59
+ :driver => JDBC_DRIVER,
60
+ :url => "jdbc:#{MONDRIAN_DRIVER}://#{CONNECTION_PARAMS[:host]}/#{CONNECTION_PARAMS[:database]}",
61
+ :username => CONNECTION_PARAMS[:username],
62
+ :password => CONNECTION_PARAMS[:password]
63
+ }
64
+ end
65
+ CONNECTION_PARAMS_WITH_CATALOG = CONNECTION_PARAMS.merge(:catalog => CATALOG_FILE)
66
+
67
+ ActiveRecord::Base.establish_connection(AR_CONNECTION_PARAMS)
@@ -0,0 +1,24 @@
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
metadata ADDED
@@ -0,0 +1,217 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mondrian-olap
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.1.0
6
+ platform: ruby
7
+ authors:
8
+ - Raimonds Simanovskis
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-03-19 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: nokogiri
18
+ version_requirements: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 1.5.0.beta.4
24
+ requirement: *id001
25
+ prerelease: false
26
+ type: :runtime
27
+ - !ruby/object:Gem::Dependency
28
+ name: jruby-openssl
29
+ version_requirements: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ requirement: *id002
36
+ prerelease: false
37
+ type: :development
38
+ - !ruby/object:Gem::Dependency
39
+ name: jeweler
40
+ version_requirements: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 1.5.2
46
+ requirement: *id003
47
+ prerelease: false
48
+ type: :development
49
+ - !ruby/object:Gem::Dependency
50
+ name: rspec
51
+ version_requirements: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ version: "2.5"
57
+ requirement: *id004
58
+ prerelease: false
59
+ type: :development
60
+ - !ruby/object:Gem::Dependency
61
+ name: autotest
62
+ version_requirements: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ requirement: *id005
69
+ prerelease: false
70
+ type: :development
71
+ - !ruby/object:Gem::Dependency
72
+ name: jdbc-mysql
73
+ version_requirements: &id006 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ requirement: *id006
80
+ prerelease: false
81
+ type: :development
82
+ - !ruby/object:Gem::Dependency
83
+ name: jdbc-postgres
84
+ version_requirements: &id007 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: "0"
90
+ requirement: *id007
91
+ prerelease: false
92
+ type: :development
93
+ - !ruby/object:Gem::Dependency
94
+ name: activerecord
95
+ version_requirements: &id008 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ~>
99
+ - !ruby/object:Gem::Version
100
+ version: 3.0.5
101
+ requirement: *id008
102
+ prerelease: false
103
+ type: :development
104
+ - !ruby/object:Gem::Dependency
105
+ name: activerecord-jdbc-adapter
106
+ version_requirements: &id009 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: "0"
112
+ requirement: *id009
113
+ prerelease: false
114
+ type: :development
115
+ - !ruby/object:Gem::Dependency
116
+ name: activerecord-oracle_enhanced-adapter
117
+ version_requirements: &id010 !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: "0"
123
+ requirement: *id010
124
+ prerelease: false
125
+ type: :development
126
+ description: |
127
+ JRuby gem for performing multidimensional queries of relational database data using Mondrian OLAP Java library
128
+
129
+ email: raimonds.simanovskis@gmail.com
130
+ executables: []
131
+
132
+ extensions: []
133
+
134
+ extra_rdoc_files:
135
+ - LICENSE-Mondrian.html
136
+ - LICENSE.txt
137
+ - README.rdoc
138
+ files:
139
+ - .rspec
140
+ - Gemfile
141
+ - LICENSE-Mondrian.html
142
+ - LICENSE.txt
143
+ - README.rdoc
144
+ - RUNNING_TESTS.rdoc
145
+ - Rakefile
146
+ - VERSION
147
+ - lib/mondrian-olap.rb
148
+ - lib/mondrian/jars/commons-collections-3.1.jar
149
+ - lib/mondrian/jars/commons-dbcp-1.2.1.jar
150
+ - lib/mondrian/jars/commons-logging-1.0.4.jar
151
+ - lib/mondrian/jars/commons-math-1.0.jar
152
+ - lib/mondrian/jars/commons-pool-1.2.jar
153
+ - lib/mondrian/jars/commons-vfs-1.0.jar
154
+ - lib/mondrian/jars/eigenbase-properties.jar
155
+ - lib/mondrian/jars/eigenbase-resgen.jar
156
+ - lib/mondrian/jars/eigenbase-xom.jar
157
+ - lib/mondrian/jars/javacup.jar
158
+ - lib/mondrian/jars/log4j-1.2.8.jar
159
+ - lib/mondrian/jars/log4j.properties
160
+ - lib/mondrian/jars/mondrian.jar
161
+ - lib/mondrian/jars/olap4j.jar
162
+ - lib/mondrian/olap.rb
163
+ - lib/mondrian/olap/connection.rb
164
+ - lib/mondrian/olap/cube.rb
165
+ - lib/mondrian/olap/query.rb
166
+ - lib/mondrian/olap/result.rb
167
+ - lib/mondrian/olap/schema.rb
168
+ - lib/mondrian/olap/schema_element.rb
169
+ - mondrian-olap.gemspec
170
+ - spec/connection_spec.rb
171
+ - spec/cube_spec.rb
172
+ - spec/fixtures/MondrianTest.xml
173
+ - spec/fixtures/MondrianTestOracle.xml
174
+ - spec/query_spec.rb
175
+ - spec/rake_tasks.rb
176
+ - spec/schema_definition_spec.rb
177
+ - spec/spec_helper.rb
178
+ - spec/support/matchers/be_like.rb
179
+ has_rdoc: true
180
+ homepage: http://github.com/rsim/mondrian-olap
181
+ licenses: []
182
+
183
+ post_install_message:
184
+ rdoc_options: []
185
+
186
+ require_paths:
187
+ - lib
188
+ required_ruby_version: !ruby/object:Gem::Requirement
189
+ none: false
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ hash: 2
194
+ segments:
195
+ - 0
196
+ version: "0"
197
+ required_rubygems_version: !ruby/object:Gem::Requirement
198
+ none: false
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: "0"
203
+ requirements: []
204
+
205
+ rubyforge_project:
206
+ rubygems_version: 1.5.1
207
+ signing_key:
208
+ specification_version: 3
209
+ summary: JRuby API for Mondrian OLAP Java library
210
+ test_files:
211
+ - spec/connection_spec.rb
212
+ - spec/cube_spec.rb
213
+ - spec/query_spec.rb
214
+ - spec/rake_tasks.rb
215
+ - spec/schema_definition_spec.rb
216
+ - spec/spec_helper.rb
217
+ - spec/support/matchers/be_like.rb