Module: Trackler
- Defined in:
- lib/trackler.rb,
lib/trackler/path.rb,
lib/trackler/track.rb,
lib/trackler/tracks.rb,
lib/trackler/problem.rb,
lib/trackler/version.rb,
lib/trackler/problems.rb,
lib/trackler/file_bundle.rb,
lib/trackler/implementation.rb,
lib/trackler/implementations.rb
Defined Under Namespace
Modules: Path
Classes: FileBundle, Implementation, Implementations, Problem, Problems, Track, Tracks
Constant Summary
collapse
- VERSION =
"2.0.0.3"
Class Method Summary
collapse
Class Method Details
.implementations ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/trackler.rb', line 35
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
|
.path ⇒ Object
13
14
15
|
# File 'lib/trackler.rb', line 13
def self.path
@path ||= Trackler::Path.root
end
|
.problems ⇒ Object
27
28
29
|
# File 'lib/trackler.rb', line 27
def self.problems
@problems ||= Problems.new(path)
end
|
.reset ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/trackler.rb', line 5
def self.reset
@path = nil
@implementations = nil
@problems = nil
@tracks = nil
@todos = nil
end
|
.todos ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/trackler.rb', line 47
def self.todos
return @todos if !!@todos
slugs = problems.map(&:slug)
@todos = Hash.new { |h, k| h[k] = [] }
tracks.each do |track|
todos = slugs - track.slugs
@todos[track.id] = problems.select { |problem|
todos.include?(problem.slug)
}.sort_by { |problem|
[implementations[problem.slug].count * -1, problem.name]
}
end
@todos
end
|
.tracks ⇒ Object
31
32
33
|
# File 'lib/trackler.rb', line 31
def self.tracks
@tracks ||= Tracks.new(path)
end
|
.use_fixture_data ⇒ Object
22
23
24
25
|
# File 'lib/trackler.rb', line 22
def self.use_fixture_data
reset
@path = Trackler::Path.fixtures
end
|
.use_real_data ⇒ Object
17
18
19
20
|
# File 'lib/trackler.rb', line 17
def self.use_real_data
reset
@path = Trackler::Path.root
end
|