degree_parse 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -12
- data/degree_parse-0.0.3.gem +0 -0
- data/lib/degree_parse.rb +2 -1
- data/lib/degree_parse/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ba6954c75438f36baaa83927bc41d9684a967c
|
4
|
+
data.tar.gz: 314107cb563372ecbcf0ebd7ead5f7795dc976f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4c68795878b6a8e0f9e82328a58d0d154c9d52b5ec9c193a6d9822dc9ef292c45cf4bb9fa2e90311211ce44b054deca9cc6ca15f414f23d824e1ac4c73687cb
|
7
|
+
data.tar.gz: 2c6cad17ede7dd7b1e371dd53b8b62ceb0ce5d723dd2a19eee8975e60c904ee08bf308d30d51424f72a2b9c10416f81ffc265c4786ba0164436d3bf76564a50a
|
data/README.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# DegreeParse
|
2
2
|
|
3
|
-
TODO: Write a gem description
|
4
|
-
|
5
3
|
## Installation
|
6
4
|
|
7
5
|
Add this line to your application's Gemfile:
|
@@ -20,7 +18,19 @@ Or install it yourself as:
|
|
20
18
|
|
21
19
|
## Usage
|
22
20
|
|
23
|
-
|
21
|
+
Require and include this module to use it
|
22
|
+
|
23
|
+
``` ruby
|
24
|
+
require 'degree_parse'
|
25
|
+
|
26
|
+
include DegreeParse
|
27
|
+
|
28
|
+
student = Student.new(YAML.load(File.read("student.yml")), "requirements.yml.erb")
|
29
|
+
|
30
|
+
puts student.check
|
31
|
+
```
|
32
|
+
|
33
|
+
This returns a hash of requirement names and whether or not they are satisfied.
|
24
34
|
|
25
35
|
## Contributing
|
26
36
|
|
@@ -35,13 +45,4 @@ This format allows us to specify degree plans in YAML format, and parse a
|
|
35
45
|
student to check this student against degree requirements. The next phase is to
|
36
46
|
make this parser produce Prolog code, and use that for reasoning.
|
37
47
|
|
38
|
-
# Getting started
|
39
|
-
|
40
|
-
To use this, first install the `yaml` and `erb` gems.
|
41
|
-
|
42
|
-
``` bash
|
43
|
-
gem install yaml
|
44
|
-
gem install erb
|
45
|
-
```
|
46
48
|
|
47
|
-
Next,
|
Binary file
|
data/lib/degree_parse.rb
CHANGED
@@ -35,7 +35,8 @@ module DegreeParse
|
|
35
35
|
requirements.each do |key, value|
|
36
36
|
if key == "courses"
|
37
37
|
courses = value.map { |name, attr| Course.new(name, hours: get_hours(name), grade: attr["grade"]) }
|
38
|
-
|
38
|
+
take = requirements["take"] || (0 if requirements["hours"])
|
39
|
+
checked << { name => match(taken, courses, hours: requirements["hours"], take: take) }
|
39
40
|
else
|
40
41
|
check(taken, requirements[key], key, checked) unless key == "hours" || key == "take"
|
41
42
|
end
|
data/lib/degree_parse/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: degree_parse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Piro-Rael
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- LICENSE.txt
|
52
52
|
- README.md
|
53
53
|
- Rakefile
|
54
|
+
- degree_parse-0.0.3.gem
|
54
55
|
- degree_parse.gemspec
|
55
56
|
- lib/degree_parse.rb
|
56
57
|
- lib/degree_parse/version.rb
|