Sha256: d11b27489973ad2f18fc3bf09da5547ff39e8882fe4ac2927cd6c4201d1c2463

Contents?: true

Size: 679 Bytes

Versions: 20

Compression:

Stored size: 679 Bytes

Contents

class TestTrack::Fake::SplitRegistry
  Split = Struct.new(:name, :registry)

  def self.instance
    @instance ||= new
  end

  def to_h
    if test_track_schema_yml.present?
      test_track_schema_yml[:splits]
    else
      {}
    end
  end

  def splits
    to_h.map do |split, registry|
      Split.new(split, registry)
    end
  end

  private

  def test_track_schema_yml
    unless instance_variable_defined?(:@test_track_schema_yml)
      @test_track_schema_yml = _test_track_schema_yml
    end
    @test_track_schema_yml
  end

  def _test_track_schema_yml
    YAML.load_file("#{Rails.root}/db/test_track_schema.yml").with_indifferent_access
  rescue
    nil
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
test_track_rails_client-0.9.19 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.18 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.17 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.16 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.15 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.14 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.13 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.12 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.11 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.10 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.9 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.8 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.7 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.6 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.5 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.4 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.3 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.2 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.1 app/models/test_track/fake/split_registry.rb
test_track_rails_client-0.9.0 app/models/test_track/fake/split_registry.rb