rubiks 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rspec +4 -0
- data/.travis.yml +6 -0
- data/Gemfile +17 -2
- data/Guardfile +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +9 -4
- data/Rakefile +3 -8
- data/lib/rubiks/nodes/annotated_node.rb +20 -0
- data/lib/rubiks/nodes/cube.rb +77 -0
- data/lib/rubiks/nodes/dimension.rb +54 -0
- data/lib/rubiks/nodes/hierarchy.rb +55 -0
- data/lib/rubiks/nodes/level.rb +29 -0
- data/lib/rubiks/nodes/measure.rb +66 -0
- data/lib/rubiks/nodes/schema.rb +61 -0
- data/lib/rubiks/nodes/validated_node.rb +47 -0
- data/lib/rubiks/version.rb +2 -2
- data/lib/rubiks.rb +6 -8
- data/rubiks.gemspec +5 -13
- data/spec/examples/mondrian_xml_example_spec.rb +91 -0
- data/spec/rubiks/nodes/annotated_node_spec.rb +24 -0
- data/spec/rubiks/nodes/cube_spec.rb +39 -0
- data/spec/rubiks/nodes/dimension_spec.rb +26 -0
- data/spec/rubiks/nodes/hierarchy_spec.rb +27 -0
- data/spec/rubiks/nodes/level_spec.rb +26 -0
- data/spec/rubiks/nodes/measure_spec.rb +31 -0
- data/spec/rubiks/nodes/schema_spec.rb +59 -0
- data/spec/rubiks/nodes/validated_node_spec.rb +49 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/matchers/be_like.rb +24 -0
- data/spec/support/schema_context.rb +46 -0
- metadata +45 -144
- data/.simplecov +0 -6
- data/examples/finance/.rvmrc +0 -1
- data/examples/finance/Gemfile +0 -11
- data/examples/finance/app.rb +0 -14
- data/examples/finance/database.yml +0 -5
- data/examples/finance/domain.rb +0 -44
- data/examples/finance/setup +0 -46
- data/lib/rubiks/cube.rb +0 -95
- data/lib/rubiks/dimension.rb +0 -23
- data/lib/rubiks/hierarchy.rb +0 -15
- data/lib/rubiks/transformers/lookup_transformer.rb +0 -101
- data/test/rubiks/test_cube.rb +0 -15
- data/test/rubiks/test_dimension.rb +0 -11
- data/test/test_helper.rb +0 -6
| @@ -0,0 +1,39 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe ::Rubiks::Cube do
         | 
| 4 | 
            +
              include_context 'schema_context'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              subject { described_class.new_from_hash }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              specify { subject.respond_to?(:from_hash) }
         | 
| 9 | 
            +
              specify { subject.respond_to?(:to_hash) }
         | 
| 10 | 
            +
              specify { subject.respond_to?(:dimensions) }
         | 
| 11 | 
            +
              specify { subject.respond_to?(:measures) }
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              context 'when parsed from a valid hash' do
         | 
| 14 | 
            +
                subject { described_class.new_from_hash(cube_hash) }
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                it { should be_valid }
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                its(:to_hash) { should have_key('name') }
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                it 'has a Rubiks::Dimension' do
         | 
| 21 | 
            +
                  subject.dimensions.first.should be_kind_of(::Rubiks::Dimension)
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                it 'has a Rubiks::Measure' do
         | 
| 25 | 
            +
                  subject.measures.first.should be_kind_of(::Rubiks::Measure)
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                it 'has one value' do
         | 
| 29 | 
            +
                  subject.values.size.should eq(1)
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
              context 'when parsed from an invalid (empty) hash' do
         | 
| 34 | 
            +
                subject { described_class.new_from_hash({}) }
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                it { should_not be_valid }
         | 
| 37 | 
            +
              end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
            end
         | 
| @@ -0,0 +1,26 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe ::Rubiks::Dimension do
         | 
| 4 | 
            +
              include_context 'schema_context'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              subject { described_class.new_from_hash }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              specify { subject.respond_to?(:from_hash) }
         | 
| 9 | 
            +
              specify { subject.respond_to?(:to_hash) }
         | 
| 10 | 
            +
              specify { subject.respond_to?(:hierarchies) }
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              context 'when parsed from a valid hash' do
         | 
| 13 | 
            +
                subject { described_class.new_from_hash(dimension_hash) }
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                its(:to_hash) { should have_key('hierarchies') }
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                it { should be_valid }
         | 
| 18 | 
            +
              end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
              context 'when parsed from an invalid (empty) hash' do
         | 
| 21 | 
            +
                subject { described_class.new_from_hash({}) }
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                it { should_not be_valid }
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            end
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
            # Mondrian level has: has_all, all_member_name, primary_key
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            describe ::Rubiks::Hierarchy do
         | 
| 5 | 
            +
              include_context 'schema_context'
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              subject { described_class.new_from_hash }
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              specify { subject.respond_to?(:from_hash) }
         | 
| 10 | 
            +
              specify { subject.respond_to?(:to_hash) }
         | 
| 11 | 
            +
              specify { subject.respond_to?(:levels) }
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              context 'when parsed from a valid hash' do
         | 
| 14 | 
            +
                subject { described_class.new_from_hash(hierarchy_hash) }
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                its(:to_hash) { should have_key('levels') }
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                it { should be_valid }
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              context 'when parsed from an invalid (empty) hash' do
         | 
| 22 | 
            +
                subject { described_class.new_from_hash({}) }
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                it { should_not be_valid }
         | 
| 25 | 
            +
              end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            end
         | 
| @@ -0,0 +1,26 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
            # Mondrian level has: unique_members, column, type, name_column, ordinal_column
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            describe ::Rubiks::Level do
         | 
| 5 | 
            +
              include_context 'schema_context'
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              subject { described_class.new_from_hash }
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              specify { subject.respond_to?(:from_hash) }
         | 
| 10 | 
            +
              specify { subject.respond_to?(:to_hash) }
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              context 'when parsed from a valid hash' do
         | 
| 13 | 
            +
                subject { described_class.new_from_hash(level_hash) }
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                its(:to_hash) { should have_key('name') }
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                it { should be_valid }
         | 
| 18 | 
            +
              end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
              context 'when parsed from an invalid (empty) hash' do
         | 
| 21 | 
            +
                subject { described_class.new_from_hash({}) }
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                it { should_not be_valid }
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            end
         | 
| @@ -0,0 +1,31 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe ::Rubiks::Measure do
         | 
| 4 | 
            +
              include_context 'schema_context'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              subject { described_class.new_from_hash }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              specify { subject.respond_to?(:from_hash) }
         | 
| 9 | 
            +
              specify { subject.respond_to?(:to_hash) }
         | 
| 10 | 
            +
              specify { subject.respond_to?(:column) }
         | 
| 11 | 
            +
              specify { subject.respond_to?(:aggregator) }
         | 
| 12 | 
            +
              specify { subject.respond_to?(:format_string) }
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              context 'when parsed from a valid hash' do
         | 
| 15 | 
            +
                subject { described_class.new_from_hash(measure_hash) }
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                it { should be_valid }
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                its(:to_hash) { should have_key('name') }
         | 
| 20 | 
            +
                its(:to_hash) { should have_key('column') }
         | 
| 21 | 
            +
                its(:to_hash) { should have_key('aggregator') }
         | 
| 22 | 
            +
                its(:to_hash) { should have_key('format_string') }
         | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
              context 'when parsed from an invalid (empty) hash' do
         | 
| 26 | 
            +
                subject { described_class.new_from_hash({}) }
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                it { should_not be_valid }
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            end
         | 
| @@ -0,0 +1,59 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe ::Rubiks::Schema do
         | 
| 4 | 
            +
              include_context 'schema_context'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              subject { described_class.new_from_hash }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              specify { subject.respond_to?(:from_hash) }
         | 
| 9 | 
            +
              specify { subject.respond_to?(:to_hash) }
         | 
| 10 | 
            +
              specify { subject.respond_to?(:to_json) }
         | 
| 11 | 
            +
              specify { subject.respond_to?(:to_xml) }
         | 
| 12 | 
            +
              specify { subject.respond_to?(:cubes) }
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              context 'when parsed from a valid hash' do
         | 
| 15 | 
            +
                subject { described_class.new_from_hash(schema_hash) }
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                it { should be_valid }
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                its(:to_hash) { should have_key('cubes') }
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                it 'has a cube' do
         | 
| 22 | 
            +
                  subject.cubes.length.should eq 1
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                it 'has a Rubiks::Cube' do
         | 
| 26 | 
            +
                  subject.cubes.first.should be_kind_of(::Rubiks::Cube)
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                it 'has no values' do
         | 
| 30 | 
            +
                  subject.values.should eq([])
         | 
| 31 | 
            +
                end
         | 
| 32 | 
            +
              end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
              context 'when parsed from an invalid (empty) hash' do
         | 
| 35 | 
            +
                subject { described_class.new_from_hash({}) }
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                it { should_not be_valid }
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                describe '#to_xml' do
         | 
| 40 | 
            +
                  it 'renders XML' do
         | 
| 41 | 
            +
                    subject.to_xml.should be_like <<-XML
         | 
| 42 | 
            +
                    <?xml version="1.0" encoding="UTF-8"?>
         | 
| 43 | 
            +
                    <Schema>
         | 
| 44 | 
            +
                    </Schema>
         | 
| 45 | 
            +
                    XML
         | 
| 46 | 
            +
                  end
         | 
| 47 | 
            +
                end
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                describe '#to_json' do
         | 
| 50 | 
            +
                  it 'renders JSON' do
         | 
| 51 | 
            +
                    subject.to_json.should be_like <<-JSON
         | 
| 52 | 
            +
                    {}
         | 
| 53 | 
            +
                    JSON
         | 
| 54 | 
            +
                  end
         | 
| 55 | 
            +
                end
         | 
| 56 | 
            +
             | 
| 57 | 
            +
              end
         | 
| 58 | 
            +
             | 
| 59 | 
            +
            end
         | 
| @@ -0,0 +1,49 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            class NodeWithValidation < ::Rubiks::ValidatedNode
         | 
| 4 | 
            +
              validates :something
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              def something
         | 
| 7 | 
            +
                errors << 'Something is required'
         | 
| 8 | 
            +
              end
         | 
| 9 | 
            +
            end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            class SubNodeWithValidation < NodeWithValidation
         | 
| 12 | 
            +
            end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            class NodeWithAdditionalValidation < NodeWithValidation
         | 
| 15 | 
            +
              validates :something_else
         | 
| 16 | 
            +
            end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
             | 
| 19 | 
            +
             | 
| 20 | 
            +
             | 
| 21 | 
            +
            describe NodeWithValidation do
         | 
| 22 | 
            +
              subject { described_class }
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              it 'has a validator' do
         | 
| 25 | 
            +
                subject.validators.length.should eq 1
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              context 'when parsed from an invalid (empty) hash' do
         | 
| 29 | 
            +
                subject { described_class.new }
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                it { should_not be_valid }
         | 
| 32 | 
            +
              end
         | 
| 33 | 
            +
            end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            describe SubNodeWithValidation do
         | 
| 36 | 
            +
              subject { described_class }
         | 
| 37 | 
            +
             | 
| 38 | 
            +
              it 'inherits the validator of the super class' do
         | 
| 39 | 
            +
                subject.validators.length.should eq 1
         | 
| 40 | 
            +
              end
         | 
| 41 | 
            +
            end
         | 
| 42 | 
            +
             | 
| 43 | 
            +
            describe NodeWithAdditionalValidation do
         | 
| 44 | 
            +
              subject { described_class }
         | 
| 45 | 
            +
             | 
| 46 | 
            +
              it 'has 2 validators' do
         | 
| 47 | 
            +
                subject.validators.length.should eq 2
         | 
| 48 | 
            +
              end
         | 
| 49 | 
            +
            end
         | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            lib_path = File.expand_path("../../lib", __FILE__)
         | 
| 2 | 
            +
            $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            begin
         | 
| 5 | 
            +
              require 'simplecov'
         | 
| 6 | 
            +
              SimpleCov.start do
         | 
| 7 | 
            +
                add_filter '/spec/'
         | 
| 8 | 
            +
              end
         | 
| 9 | 
            +
            rescue LoadError
         | 
| 10 | 
            +
            end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            require 'bundler'
         | 
| 13 | 
            +
            Bundler.require(:default, :development, :test)
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            require 'rubiks'
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            require 'support/schema_context'
         | 
| 18 | 
            +
            require 'support/matchers/be_like'
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            RSpec.configure do |config|
         | 
| 21 | 
            +
              config.include Matchers
         | 
| 22 | 
            +
            end
         | 
| @@ -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
         | 
| @@ -0,0 +1,46 @@ | |
| 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 | 
            +
                }
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              def dimension_hash
         | 
| 18 | 
            +
                {
         | 
| 19 | 
            +
                  'name' => 'fake_dimension',
         | 
| 20 | 
            +
                  'hierarchies' => [hierarchy_hash.deep_dup]
         | 
| 21 | 
            +
                }
         | 
| 22 | 
            +
              end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              def hierarchy_hash
         | 
| 25 | 
            +
                {
         | 
| 26 | 
            +
                  'name' => 'fake_hierarchy',
         | 
| 27 | 
            +
                  'levels' => [level_hash.deep_dup]
         | 
| 28 | 
            +
                }
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
              def level_hash
         | 
| 32 | 
            +
                {
         | 
| 33 | 
            +
                  'name' => 'fake_level'
         | 
| 34 | 
            +
                }
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
              def measure_hash
         | 
| 38 | 
            +
                {
         | 
| 39 | 
            +
                  'name' => 'fake_measure',
         | 
| 40 | 
            +
                  'column' => 'amount',
         | 
| 41 | 
            +
                  'aggregator' => 'count',
         | 
| 42 | 
            +
                  'format_string' => '$#,###'
         | 
| 43 | 
            +
                }
         | 
| 44 | 
            +
              end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rubiks
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,10 +9,10 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 12 | 
            +
            date: 2013-04-03 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 | 
            -
              name:  | 
| 15 | 
            +
              name: rltk
         | 
| 16 16 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                none: false
         | 
| 18 18 | 
             
                requirements:
         | 
| @@ -28,126 +28,14 @@ dependencies: | |
| 28 28 | 
             
                  - !ruby/object:Gem::Version
         | 
| 29 29 | 
             
                    version: '0'
         | 
| 30 30 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 31 | 
            -
              name:  | 
| 31 | 
            +
              name: activesupport
         | 
| 32 32 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 33 33 | 
             
                none: false
         | 
| 34 34 | 
             
                requirements:
         | 
| 35 35 | 
             
                - - ! '>='
         | 
| 36 36 | 
             
                  - !ruby/object:Gem::Version
         | 
| 37 37 | 
             
                    version: '0'
         | 
| 38 | 
            -
              type: : | 
| 39 | 
            -
              prerelease: false
         | 
| 40 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 41 | 
            -
                none: false
         | 
| 42 | 
            -
                requirements:
         | 
| 43 | 
            -
                - - ! '>='
         | 
| 44 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 45 | 
            -
                    version: '0'
         | 
| 46 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 47 | 
            -
              name: guard
         | 
| 48 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 49 | 
            -
                none: false
         | 
| 50 | 
            -
                requirements:
         | 
| 51 | 
            -
                - - ! '>='
         | 
| 52 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 53 | 
            -
                    version: '0'
         | 
| 54 | 
            -
              type: :development
         | 
| 55 | 
            -
              prerelease: false
         | 
| 56 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 57 | 
            -
                none: false
         | 
| 58 | 
            -
                requirements:
         | 
| 59 | 
            -
                - - ! '>='
         | 
| 60 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: '0'
         | 
| 62 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 63 | 
            -
              name: guard-minitest
         | 
| 64 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 65 | 
            -
                none: false
         | 
| 66 | 
            -
                requirements:
         | 
| 67 | 
            -
                - - ! '>='
         | 
| 68 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 69 | 
            -
                    version: '0'
         | 
| 70 | 
            -
              type: :development
         | 
| 71 | 
            -
              prerelease: false
         | 
| 72 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 73 | 
            -
                none: false
         | 
| 74 | 
            -
                requirements:
         | 
| 75 | 
            -
                - - ! '>='
         | 
| 76 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 77 | 
            -
                    version: '0'
         | 
| 78 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 79 | 
            -
              name: minitest
         | 
| 80 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 81 | 
            -
                none: false
         | 
| 82 | 
            -
                requirements:
         | 
| 83 | 
            -
                - - ! '>='
         | 
| 84 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 85 | 
            -
                    version: '0'
         | 
| 86 | 
            -
              type: :development
         | 
| 87 | 
            -
              prerelease: false
         | 
| 88 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 89 | 
            -
                none: false
         | 
| 90 | 
            -
                requirements:
         | 
| 91 | 
            -
                - - ! '>='
         | 
| 92 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 93 | 
            -
                    version: '0'
         | 
| 94 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 95 | 
            -
              name: pry
         | 
| 96 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 97 | 
            -
                none: false
         | 
| 98 | 
            -
                requirements:
         | 
| 99 | 
            -
                - - ! '>='
         | 
| 100 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 101 | 
            -
                    version: '0'
         | 
| 102 | 
            -
              type: :development
         | 
| 103 | 
            -
              prerelease: false
         | 
| 104 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 105 | 
            -
                none: false
         | 
| 106 | 
            -
                requirements:
         | 
| 107 | 
            -
                - - ! '>='
         | 
| 108 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 109 | 
            -
                    version: '0'
         | 
| 110 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 111 | 
            -
              name: rake
         | 
| 112 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 113 | 
            -
                none: false
         | 
| 114 | 
            -
                requirements:
         | 
| 115 | 
            -
                - - ! '>='
         | 
| 116 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 117 | 
            -
                    version: '0'
         | 
| 118 | 
            -
              type: :development
         | 
| 119 | 
            -
              prerelease: false
         | 
| 120 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 121 | 
            -
                none: false
         | 
| 122 | 
            -
                requirements:
         | 
| 123 | 
            -
                - - ! '>='
         | 
| 124 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 125 | 
            -
                    version: '0'
         | 
| 126 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 127 | 
            -
              name: rb-fsevent
         | 
| 128 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 129 | 
            -
                none: false
         | 
| 130 | 
            -
                requirements:
         | 
| 131 | 
            -
                - - ! '>='
         | 
| 132 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 133 | 
            -
                    version: '0'
         | 
| 134 | 
            -
              type: :development
         | 
| 135 | 
            -
              prerelease: false
         | 
| 136 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 137 | 
            -
                none: false
         | 
| 138 | 
            -
                requirements:
         | 
| 139 | 
            -
                - - ! '>='
         | 
| 140 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 141 | 
            -
                    version: '0'
         | 
| 142 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 143 | 
            -
              name: simplecov
         | 
| 144 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 145 | 
            -
                none: false
         | 
| 146 | 
            -
                requirements:
         | 
| 147 | 
            -
                - - ! '>='
         | 
| 148 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 149 | 
            -
                    version: '0'
         | 
| 150 | 
            -
              type: :development
         | 
| 38 | 
            +
              type: :runtime
         | 
| 151 39 | 
             
              prerelease: false
         | 
| 152 40 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 153 41 | 
             
                none: false
         | 
| @@ -156,14 +44,14 @@ dependencies: | |
| 156 44 | 
             
                  - !ruby/object:Gem::Version
         | 
| 157 45 | 
             
                    version: '0'
         | 
| 158 46 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 159 | 
            -
              name:  | 
| 47 | 
            +
              name: builder
         | 
| 160 48 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 161 49 | 
             
                none: false
         | 
| 162 50 | 
             
                requirements:
         | 
| 163 51 | 
             
                - - ! '>='
         | 
| 164 52 | 
             
                  - !ruby/object:Gem::Version
         | 
| 165 53 | 
             
                    version: '0'
         | 
| 166 | 
            -
              type: : | 
| 54 | 
            +
              type: :runtime
         | 
| 167 55 | 
             
              prerelease: false
         | 
| 168 56 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 169 57 | 
             
                none: false
         | 
| @@ -171,7 +59,7 @@ dependencies: | |
| 171 59 | 
             
                - - ! '>='
         | 
| 172 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 173 61 | 
             
                    version: '0'
         | 
| 174 | 
            -
            description:  | 
| 62 | 
            +
            description: Define an OLAP schema
         | 
| 175 63 | 
             
            email:
         | 
| 176 64 | 
             
            - johnnyt@moneydesktop.com
         | 
| 177 65 | 
             
            executables: []
         | 
| @@ -179,28 +67,36 @@ extensions: [] | |
| 179 67 | 
             
            extra_rdoc_files: []
         | 
| 180 68 | 
             
            files:
         | 
| 181 69 | 
             
            - .gitignore
         | 
| 182 | 
            -
            - . | 
| 70 | 
            +
            - .rspec
         | 
| 71 | 
            +
            - .travis.yml
         | 
| 183 72 | 
             
            - Gemfile
         | 
| 184 73 | 
             
            - Guardfile
         | 
| 185 74 | 
             
            - LICENSE.txt
         | 
| 186 75 | 
             
            - README.md
         | 
| 187 76 | 
             
            - Rakefile
         | 
| 188 | 
            -
            - examples/finance/.rvmrc
         | 
| 189 | 
            -
            - examples/finance/Gemfile
         | 
| 190 | 
            -
            - examples/finance/app.rb
         | 
| 191 | 
            -
            - examples/finance/database.yml
         | 
| 192 | 
            -
            - examples/finance/domain.rb
         | 
| 193 | 
            -
            - examples/finance/setup
         | 
| 194 77 | 
             
            - lib/rubiks.rb
         | 
| 195 | 
            -
            - lib/rubiks/ | 
| 196 | 
            -
            - lib/rubiks/ | 
| 197 | 
            -
            - lib/rubiks/ | 
| 198 | 
            -
            - lib/rubiks/ | 
| 78 | 
            +
            - lib/rubiks/nodes/annotated_node.rb
         | 
| 79 | 
            +
            - lib/rubiks/nodes/cube.rb
         | 
| 80 | 
            +
            - lib/rubiks/nodes/dimension.rb
         | 
| 81 | 
            +
            - lib/rubiks/nodes/hierarchy.rb
         | 
| 82 | 
            +
            - lib/rubiks/nodes/level.rb
         | 
| 83 | 
            +
            - lib/rubiks/nodes/measure.rb
         | 
| 84 | 
            +
            - lib/rubiks/nodes/schema.rb
         | 
| 85 | 
            +
            - lib/rubiks/nodes/validated_node.rb
         | 
| 199 86 | 
             
            - lib/rubiks/version.rb
         | 
| 200 87 | 
             
            - rubiks.gemspec
         | 
| 201 | 
            -
            -  | 
| 202 | 
            -
            -  | 
| 203 | 
            -
            -  | 
| 88 | 
            +
            - spec/examples/mondrian_xml_example_spec.rb
         | 
| 89 | 
            +
            - spec/rubiks/nodes/annotated_node_spec.rb
         | 
| 90 | 
            +
            - spec/rubiks/nodes/cube_spec.rb
         | 
| 91 | 
            +
            - spec/rubiks/nodes/dimension_spec.rb
         | 
| 92 | 
            +
            - spec/rubiks/nodes/hierarchy_spec.rb
         | 
| 93 | 
            +
            - spec/rubiks/nodes/level_spec.rb
         | 
| 94 | 
            +
            - spec/rubiks/nodes/measure_spec.rb
         | 
| 95 | 
            +
            - spec/rubiks/nodes/schema_spec.rb
         | 
| 96 | 
            +
            - spec/rubiks/nodes/validated_node_spec.rb
         | 
| 97 | 
            +
            - spec/spec_helper.rb
         | 
| 98 | 
            +
            - spec/support/matchers/be_like.rb
         | 
| 99 | 
            +
            - spec/support/schema_context.rb
         | 
| 204 100 | 
             
            homepage: https://github.com/moneydesktop/rubiks
         | 
| 205 101 | 
             
            licenses: []
         | 
| 206 102 | 
             
            post_install_message: 
         | 
| @@ -213,25 +109,30 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 213 109 | 
             
              - - ! '>='
         | 
| 214 110 | 
             
                - !ruby/object:Gem::Version
         | 
| 215 111 | 
             
                  version: '0'
         | 
| 216 | 
            -
                  segments:
         | 
| 217 | 
            -
                  - 0
         | 
| 218 | 
            -
                  hash: -2306503118888220795
         | 
| 219 112 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 220 113 | 
             
              none: false
         | 
| 221 114 | 
             
              requirements:
         | 
| 222 115 | 
             
              - - ! '>='
         | 
| 223 116 | 
             
                - !ruby/object:Gem::Version
         | 
| 224 117 | 
             
                  version: '0'
         | 
| 225 | 
            -
                  segments:
         | 
| 226 | 
            -
                  - 0
         | 
| 227 | 
            -
                  hash: -2306503118888220795
         | 
| 228 118 | 
             
            requirements: []
         | 
| 229 119 | 
             
            rubyforge_project: 
         | 
| 230 120 | 
             
            rubygems_version: 1.8.24
         | 
| 231 121 | 
             
            signing_key: 
         | 
| 232 122 | 
             
            specification_version: 3
         | 
| 233 | 
            -
            summary:  | 
| 123 | 
            +
            summary: Rubiks is a Ruby gem that defines an OLAP schema and can output the schema
         | 
| 124 | 
            +
              as XML and JSON.
         | 
| 234 125 | 
             
            test_files:
         | 
| 235 | 
            -
            -  | 
| 236 | 
            -
            -  | 
| 237 | 
            -
            -  | 
| 126 | 
            +
            - spec/examples/mondrian_xml_example_spec.rb
         | 
| 127 | 
            +
            - spec/rubiks/nodes/annotated_node_spec.rb
         | 
| 128 | 
            +
            - spec/rubiks/nodes/cube_spec.rb
         | 
| 129 | 
            +
            - spec/rubiks/nodes/dimension_spec.rb
         | 
| 130 | 
            +
            - spec/rubiks/nodes/hierarchy_spec.rb
         | 
| 131 | 
            +
            - spec/rubiks/nodes/level_spec.rb
         | 
| 132 | 
            +
            - spec/rubiks/nodes/measure_spec.rb
         | 
| 133 | 
            +
            - spec/rubiks/nodes/schema_spec.rb
         | 
| 134 | 
            +
            - spec/rubiks/nodes/validated_node_spec.rb
         | 
| 135 | 
            +
            - spec/spec_helper.rb
         | 
| 136 | 
            +
            - spec/support/matchers/be_like.rb
         | 
| 137 | 
            +
            - spec/support/schema_context.rb
         | 
| 138 | 
            +
            has_rdoc: 
         | 
    
        data/.simplecov
    DELETED
    
    
    
        data/examples/finance/.rvmrc
    DELETED
    
    | @@ -1 +0,0 @@ | |
| 1 | 
            -
            rvm use jruby-1.7.0
         | 
    
        data/examples/finance/Gemfile
    DELETED
    
    
    
        data/examples/finance/app.rb
    DELETED
    
    | @@ -1,14 +0,0 @@ | |
| 1 | 
            -
            require 'bundler'
         | 
| 2 | 
            -
            Bundler.require
         | 
| 3 | 
            -
            require 'pry'
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            ActiveRecord::Base.establish_connection(YAML.load_file('./database.yml'))
         | 
| 6 | 
            -
            require './domain'
         | 
| 7 | 
            -
             | 
| 8 | 
            -
            query = "SELECT {[Measures].[Balance]} ON COLUMNS, {[Customers].children} ON ROWS FROM [CubeAccountSnapshots] WHERE ([Date].[2012].[4])"
         | 
| 9 | 
            -
             | 
| 10 | 
            -
            cas = CubeAccountSnapshot.last
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            binding.pry
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            cas.mdx query
         |