curricula 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/curricula/version.rb +1 -1
- data/lib/curricula.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 535c26d72e09f06da00b2d9681a32b8d9682681a
|
4
|
+
data.tar.gz: 99bdd3c672f529fa7d1e8727c116c28167304c0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc3b1188949dd8ece80157e47817a5d19d53f4617f425d5183a440b7f13431f1925c98bf8e2ab61e905d59efca34f27753b2c9b2123bd890729c37ffc6bd0aee
|
7
|
+
data.tar.gz: 741724f95920ef73e5b0232f215f5c1749057b8b80907c3fb1746a67473ae4047428550f6242f3937a7f87bceb15cd86fddfd0926e727fe9aaa1e435c42c15c8
|
data/lib/curricula/version.rb
CHANGED
data/lib/curricula.rb
CHANGED
@@ -69,7 +69,7 @@ module Curricula
|
|
69
69
|
Spreadsheet.open(@spreadsheet).worksheets.first.each do |row|
|
70
70
|
if row[1]
|
71
71
|
@courses[row.last].prereqs << @courses[row.first]
|
72
|
-
increase_cruciality
|
72
|
+
increase_cruciality row.first, row.last
|
73
73
|
else
|
74
74
|
@courses[row.first] = Course.new row.first, row.last
|
75
75
|
end
|
@@ -82,9 +82,9 @@ module Curricula
|
|
82
82
|
course.hours + course.prereqs.map{ |prereq| course_hours(prereq, visited).to_i }.reduce(:+).to_i
|
83
83
|
end
|
84
84
|
|
85
|
-
def increase_cruciality
|
86
|
-
prerequisite.cruciality += course.hours
|
87
|
-
prerequisite.prereqs.each { |prereq| increase_cruciality
|
85
|
+
def increase_cruciality prerequisite, course
|
86
|
+
@courses[prerequisite].cruciality += @courses[course].hours
|
87
|
+
@courses[prerequisite].prereqs.each { |prereq| increase_cruciality prereq, course }
|
88
88
|
end
|
89
89
|
|
90
90
|
def error name
|