uniara_virtual_parser 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f3c65c50bde758a6c7e73532ec617d33544ab33
4
- data.tar.gz: 96440f34f06787951907ea6fc83621a84604cf80
3
+ metadata.gz: e3a5dacf4b3d8ecbfe10299f706e6bf4bf247cc1
4
+ data.tar.gz: e56b6449a5c3a19f56806779b0435c41838cc437
5
5
  SHA512:
6
- metadata.gz: 1f1e1ed94c16960881310060b51d16d6178915df50e909c9c3d094cfcc0c88445b2bdf8a6f1c32a1721bcb5c6ba704363ef5818373677669feafe48470557342
7
- data.tar.gz: a45993ebd77a8d19fe13af4805b324a408e2e3964ed3a7f2555660d72b66242cbce8a501844f4b47784f555729d87e1da72e7008d53241525fe2e4f959edd0f5
6
+ metadata.gz: f677077d6583cfe11673d21a36abf31e86fa40bb5bb8b1bdb84829420df52e7f03ede346e13c83360b6614c7efe53f6e3120ac56401cd4193d2039c1458d06dd
7
+ data.tar.gz: 6551cdc7d15c4d0312950086e65a2137a6e81a85b697dbe119fffb5010bf81d127015765373bd87a706ee3a635356933bbcbcb07c18b85a8eca57c669c2f0a74
@@ -1,3 +1,4 @@
1
+ require 'pry'
1
2
  module UniaraVirtualParser
2
3
  module Services
3
4
  module Student
@@ -9,9 +10,11 @@ module UniaraVirtualParser
9
10
  private
10
11
 
11
12
  def parse_student_profile(html)
12
- return '' if html.empty?
13
13
  doc = Nokogiri::HTML(html)
14
- student = Models::Student.new(name: name.text.match(/Bo[am] [Dia|Tarde|Noite], (.*)/)[1])
14
+ name = doc.css("b:contains('Bom Dia')").first ||
15
+ doc.css("b:contains('Boa Tarde')").first || doc.css("b:contains('Boa Noite')").first
16
+ return '' unless name
17
+ student = Models::Student.new(name: name.text.match(/Bo[am] (Dia|Tarde|Noite), (.*)/)[2])
15
18
  student
16
19
  end
17
20
  end
@@ -1,3 +1,3 @@
1
1
  module UniaraVirtualParser
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniara_virtual_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Ribeiro