thu_course 0.2.1 → 0.2.3

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: 544545f984455ba04e1205085ae35c250e79e740
4
- data.tar.gz: b52295ae35d5ace8e2a1db94b4275b5bc6171ff4
3
+ metadata.gz: 536dd28365d31635ae21a6db882ed15cbb977a60
4
+ data.tar.gz: 6d9825479c297fda7188c84d06886040512d3ff1
5
5
  SHA512:
6
- metadata.gz: 0911451676a4f32cdf99c3dc7b58d25c49e0a286a9f6524568747e3f29fa6e48f4f31630c5e5fbfdf59251c7a0890c4f5e71a1ad68bf4cf5e1d07982f7308d69
7
- data.tar.gz: 3f09481c4981845cea976ac274b5bef1672e4aa270c1493bfe8981fc241e529e6d2ce1f6813479e2e2f7ceb4b048c14f3f055cb4ff545a00b09d8767d859aab5
6
+ metadata.gz: a00d57b40499fdf1696a1412cf2e22ebb2e652663e8d6cd2eba0d726a6b5caeb42c885ecc98ed438284e0258e25b42228014b869bee4c8280f75a9a7a598395c
7
+ data.tar.gz: c0ac47208461a94ca6a2f7b54a7f726abba7928d6be884ad06130b3234e7d3e747369484989322407b3cfe97cf3a79a80760b703eb4d65c074db4a01ae243259
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- thu_course (0.2.0)
4
+ thu_course (0.2.2)
5
5
  nokogiri (~> 1.6.0)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module ThuCourse
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
data/lib/thu_course.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'thu_course/version'
2
+ require 'thu_course/date'
2
3
 
3
4
  require 'open-uri'
4
5
  require 'nokogiri'
@@ -63,12 +64,14 @@ module ThuCourse
63
64
  name = td_tag[1].text.strip
64
65
  credit = td_tag[2].text.strip
65
66
  date = td_tag[3].text.strip
67
+ date = date_change(date)
66
68
  teacher = []
67
69
  teacher_data = td_tag[4].css('a')
68
70
  teacher_data.each do |td|
69
- teacher_id = td['href'].split('/').last
71
+ teacher_id = ''
72
+ teacher_id = td['href'].split('/').last if td['href'].split('/').last != 'view-teacher-profile'
70
73
  teacher_name = td.text.strip
71
- teacher << {teacher_id: teacher_id,teacher_name: teacher_name}
74
+ teacher << { teacher_id: teacher_id, teacher_name: teacher_name }
72
75
  end
73
76
  num = td_tag[5].text.strip.gsub(/\s+/, '')
74
77
  note = td_tag[6].text.strip
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thu_course
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - herber523