osu-cc-scraper 1.0.1 → 1.0.2

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: f3a4b341ef148c517c8e0bce60cd66b5626fb5bb
4
- data.tar.gz: be876d5f07610468ae75ea6c96d864faeeb42cef
3
+ metadata.gz: 249521473c390b840b723d3addd3cdbe65c4f88f
4
+ data.tar.gz: a6209d7b623c86def354ccd106426d07a4072c32
5
5
  SHA512:
6
- metadata.gz: b33d730a9e4dccbe85477dbbd02137cdbd23feea22b67d1355eb6003d3ab066fe7da2d46a9a1a6fa94f878dc696595ea33146bac8d9ef7b296f460758d6cd728
7
- data.tar.gz: 8073fa241a16ffd2553e0e9a5049c394fef00ddf5c2b8aa7091856e00a04ca0ffb6d500a47deec7439c2208a6a8e932fb1bd3148ac8156584997595bdcbcb38d
6
+ metadata.gz: 7b10d2b470cb85feaec5c92d3c7b0b8720021c72dc4d0e5ada2db76b8088c6523c2401ee53e06766173420adca1f3265cd36038dcbca1bd56066b53ceb2ea325
7
+ data.tar.gz: 2234e682072400a0cce797c35b82fa391221a00dfd109ea01cdae7bd7db1479c7aae6b24c023c27fb534be94a49637f000784ca5ea31400bfd3c1f66a0440ffc
@@ -1,4 +1,4 @@
1
- class OsuCcScraper
1
+ module OsuCcScraper
2
2
  ENDPOINT = "http://catalog.oregonstate.edu"
3
3
  end
4
4
 
@@ -3,15 +3,19 @@ require "nokogiri"
3
3
  require "osu-cc-scraper/section"
4
4
 
5
5
  class OsuCcScraper::Course
6
+ # @return [String]
6
7
  attr_accessor :subject_code
8
+ # @return [String]
7
9
  attr_accessor :course_number
8
10
 
11
+ # @return [OsuCcScraper::Course]
9
12
  def initialize(args)
10
13
  args.each do |k,v|
11
14
  instance_variable_set("@#{k}", v) unless v.nil?
12
15
  end
13
16
  end
14
17
 
18
+ # @return [Array<OsuCcScraper::Section>]
15
19
  def sections
16
20
  html = OsuCcScraper::Section::fetch(self.subject_code, self.course_number)
17
21
  OsuCcScraper::Section::parse(html)
@@ -3,19 +3,23 @@ require "nokogiri"
3
3
  require "osu-cc-scraper/course"
4
4
 
5
5
  class OsuCcScraper::Department
6
+ # @return [String]
6
7
  attr_accessor :subject_code
7
8
 
9
+ # @return [OsuCcScraper::Department]
8
10
  def initialize(args)
9
11
  args.each do |k,v|
10
12
  instance_variable_set("@#{k}", v) unless v.nil?
11
13
  end
12
14
  end
13
15
 
16
+ # @return [Array<OsuCcScraper::Department>]
14
17
  def self.all
15
18
  html = OsuCcScraper::Department::fetch
16
19
  OsuCcScraper::Department::parse(html)
17
20
  end
18
21
 
22
+ # @return [Array<OsuCcScraper::Course>]
19
23
  def courses
20
24
  html = OsuCcScraper::Course::fetch(self.subject_code)
21
25
  OsuCcScraper::Course::parse(html)
@@ -2,23 +2,35 @@ require "open-uri"
2
2
  require "nokogiri"
3
3
 
4
4
  class OsuCcScraper::Section
5
+ # @return [String]
5
6
  attr_accessor :department
7
+ # @return [String]
6
8
  attr_accessor :number
9
+ # @return [String]
7
10
  attr_accessor :name
11
+ # @return [String]
8
12
  attr_accessor :term
13
+ # @return [String]
9
14
  attr_accessor :section
15
+ # @return [String]
10
16
  attr_accessor :instructor
17
+ # @return [String]
11
18
  attr_accessor :type
19
+ # @return [String]
12
20
  attr_accessor :status
21
+ # @return [String]
13
22
  attr_accessor :capacity
23
+ # @return [String]
14
24
  attr_accessor :availability
15
25
 
26
+ # @return [OsuCcScraper::Section]
16
27
  def initialize(args)
17
28
  args.each do |k,v|
18
29
  instance_variable_set("@#{k}", v) unless v.nil?
19
30
  end
20
31
  end
21
32
 
33
+ # @return [Array]
22
34
  def to_a
23
35
  [@department, @number, @name, @term, @section, @instructor, @type, @status, @capacity, @availability]
24
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osu-cc-scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonah George
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-10 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -26,12 +26,10 @@ dependencies:
26
26
  version: 1.6.6.2
27
27
  description: A script to gather course data from Oregon State's Course Catalog.
28
28
  email: jonah.george@me.com
29
- executables:
30
- - osu-cc-scraper
29
+ executables: []
31
30
  extensions: []
32
31
  extra_rdoc_files: []
33
32
  files:
34
- - bin/osu-cc-scraper
35
33
  - lib/osu-cc-scraper.rb
36
34
  - lib/osu-cc-scraper/course.rb
37
35
  - lib/osu-cc-scraper/department.rb
@@ -61,3 +59,4 @@ signing_key:
61
59
  specification_version: 4
62
60
  summary: OSU Course Catalog Scraper
63
61
  test_files: []
62
+ has_rdoc:
data/bin/osu-cc-scraper DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "osu-cc-scraper"
4
- require "csv"
5
-
6
- OsuCcScraper::Department.all.each do |department|
7
- department.courses.each do |course|
8
- course.sections.each do |section|
9
- $stdout.puts(section.to_a.to_csv)
10
- end
11
- end
12
- end