Sha256: 0d6cec14a83963b6cd4e4b397addc689f1924821652a3ea5cca409ebe25f211e

Contents?: true

Size: 886 Bytes

Versions: 3

Compression:

Stored size: 886 Bytes

Contents

paths = Dir[File.expand_path('../trackler/**/*.rb', __FILE__)]
paths.each { |path| require path }

module Trackler
  def self.reset
    @path = nil
    @implementations = nil
    @problems = nil
    @tracks = nil
  end

  def self.path
    @path ||= Trackler::Path.root
  end

  def self.use_real_data
    reset
    @path = Trackler::Path.root
  end

  def self.use_fixture_data
    reset
    @path = Trackler::Path.fixtures
  end

  def self.problems
    @problems ||= Problems.new(path)
  end

  def self.tracks
    @tracks ||= Tracks.new(path)
  end

  def self.implementations
    return @implementations if !!@implementations

    @implementations = Hash.new { |h, k| h[k] = [] }
    tracks.each do |track|
      track.implementations.each do |implementation|
        @implementations[implementation.problem.slug] << implementation
      end
    end
    @implementations
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trackler-1.0.3.0 lib/trackler.rb
trackler-1.0.2.1 lib/trackler.rb
trackler-1.0.2.0 lib/trackler.rb