degree_parse 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7ca70aef73bb065e20fa3ef12681207b3a80e36
4
- data.tar.gz: 2b81f4c08df93c7366a340b5cb7af1cafce183a0
3
+ metadata.gz: 25ba6954c75438f36baaa83927bc41d9684a967c
4
+ data.tar.gz: 314107cb563372ecbcf0ebd7ead5f7795dc976f6
5
5
  SHA512:
6
- metadata.gz: 987fe8dc43e936ba5fd9b9a29505fb817529681915e8875cca0966486c193d7bbac529492ac699313c52febffaa3922dab8d7d665c9be858b6e93dd290d8317f
7
- data.tar.gz: d23711a180bfe9474d87a173df50846e2b9446fb2ae0a3d783532aa0ee83cffb649e7cd4c7360988ce6139893526cee246fe2a2bfa4bebf7455ffbfbab1c5477
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
- TODO: Write usage instructions here
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
- checked << { name => match(taken, courses, hours: requirements["hours"], take: requirements["take"]) }
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
@@ -1,3 +1,3 @@
1
1
  module DegreeParse
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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.3
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