unm 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unm/version.rb +1 -1
- data/lib/unm.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cdb84e72e5b16e51bcdcfabcce42c30986ef308
|
4
|
+
data.tar.gz: 2121cac304a996833e29af84a7a1c0537996668b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5089838bba96ed4ab8284f3ace747c74c005a45c10df07ba17b88cfbc03a8a756ce62e756267ca79f69688b8d5f9a0cc25f344b3d74f06f7e8d9c763e03f7028
|
7
|
+
data.tar.gz: c8d6fca778825dd862ea7d0a467994fb430afd6ff537794c4e25174816afa578cf401f1762aa7e082cd353c4fda6f6d4985b52cd40c4799637c96a4a1e6b2430
|
data/lib/unm/version.rb
CHANGED
data/lib/unm.rb
CHANGED
@@ -47,7 +47,7 @@ module Unm
|
|
47
47
|
|
48
48
|
def self.get
|
49
49
|
return @catalog if @catalog
|
50
|
-
subjects = HTTParty.get("http://catalog
|
50
|
+
subjects = HTTParty.get("http://catalog.unm.edu/catalogs/2015-2016/subjects-and-courses.xml")["data"]["subjects"]["subject"]
|
51
51
|
@catalog = subjects.map do |subject|
|
52
52
|
courses = subject["course"]
|
53
53
|
name = subject["subjectName"]
|
@@ -56,7 +56,7 @@ module Unm
|
|
56
56
|
course_page = Nokogiri::HTML.parse(HTTParty.get(URI.escape course["path"])) rescue course["path"]
|
57
57
|
description = course_page.css('.content > p').first.text rescue "Error loading description. Check #{course["path"]}."
|
58
58
|
prerequisites = find_prerequisites(course_page) rescue "Error loading prerequisites. Check #{course["path"]}."
|
59
|
-
hours = course_page.css('b').text.match(/\(\D*(\d).*\)/)[1].to_i rescue
|
59
|
+
hours = course_page.css('b').text.match(/\(\D*(\d).*\)/)[1].to_i rescue "Error loading hours. Check #{course["path"]}."
|
60
60
|
{ "name" => course_name, "description" => description, "prerequisites" => prerequisites, "hours" => hours }
|
61
61
|
end }
|
62
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Piro-Rael
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.4.
|
105
|
+
rubygems_version: 2.4.8
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Utilities to interact with UNM Interfaces.
|