resume_exporter 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/bin/resume_exporter +4 -2
  3. data/lib/exporters/html.rb +33 -0
  4. data/lib/exporters/pdf.rb +13 -0
  5. data/lib/extractors/html/linkedin.rb +145 -169
  6. data/lib/extractors/html/stackoverflow.rb +60 -72
  7. data/lib/extractors/html/xing.rb +46 -60
  8. data/lib/extractors/html.rb +1 -1
  9. data/lib/extractors/json/fresh.rb +196 -233
  10. data/lib/extractors/json/json_resume.rb +107 -127
  11. data/lib/extractors/json/prtflio.rb +20 -24
  12. data/lib/extractors/json.rb +7 -6
  13. data/lib/resume_exporter.rb +6 -0
  14. data/lib/templates/default.json.jbuilder +162 -229
  15. data/lib/templates/default.md.erb +99 -244
  16. data/lib/templates/default.txt.erb +99 -224
  17. data/lib/templates/default.xml.builder +162 -227
  18. data/lib/templates/fresh.json.jbuilder +149 -155
  19. data/lib/templates/html/_affiliation.liquid +53 -0
  20. data/lib/templates/html/_basics.liquid +19 -0
  21. data/lib/templates/html/_contact.liquid +27 -0
  22. data/lib/templates/html/_css.liquid +324 -0
  23. data/lib/templates/html/_disposition.liquid +13 -0
  24. data/lib/templates/html/_education.liquid +56 -0
  25. data/lib/templates/html/_employment.liquid +67 -0
  26. data/lib/templates/html/_extracurricular.liquid +53 -0
  27. data/lib/templates/html/_footer.liquid +1 -0
  28. data/lib/templates/html/_governance.liquid +52 -0
  29. data/lib/templates/html/_image.liquid +7 -0
  30. data/lib/templates/html/_interests.liquid +23 -0
  31. data/lib/templates/html/_languages.liquid +22 -0
  32. data/lib/templates/html/_open_source.liquid +53 -0
  33. data/lib/templates/html/_patents.liquid +50 -0
  34. data/lib/templates/html/_projects.liquid +53 -0
  35. data/lib/templates/html/_qualifications.liquid +53 -0
  36. data/lib/templates/html/_reading.liquid +52 -0
  37. data/lib/templates/html/_recognition.liquid +54 -0
  38. data/lib/templates/html/_references.liquid +28 -0
  39. data/lib/templates/html/_resume.liquid +49 -0
  40. data/lib/templates/html/_service.liquid +53 -0
  41. data/lib/templates/html/_skills.liquid +35 -0
  42. data/lib/templates/html/_social.liquid +25 -0
  43. data/lib/templates/html/_speaking.liquid +53 -0
  44. data/lib/templates/html/_writing.liquid +52 -0
  45. data/lib/templates/html/default.liquid +1 -0
  46. data/lib/templates/json_resume.json.jbuilder +72 -72
  47. metadata +119 -20
@@ -9,8 +9,8 @@ module Extractor
9
9
 
10
10
  def basics
11
11
  {
12
- name: name,
13
- image: image
12
+ "name" => name,
13
+ "image" => image
14
14
  }
15
15
  end
16
16
 
@@ -23,83 +23,69 @@ module Extractor
23
23
  end
24
24
 
25
25
  def employment
26
- {
27
- history: @doc.css('#work-experience li').map do |item|
28
- experience = {}
29
- experience[:position] = item.at_css(".job-title").text if item.at_css(".job-title")
30
- experience[:employer] = item.at_css(".job-company-name").text.gsub(/\s+/, ' ').strip if item.at_css(".job-company-name")
31
- experience[:url] = item.at_css(".company-url a")["href"] if item.at_css(".company-url a")
32
- dates = item.css(".additional.top").text.gsub(/\s+/, ' ').strip.split(" - ")
33
- experience[:startDate] = dates[0] if dates[0]
34
- experience[:endDate] = dates[1] if dates[1]
35
- experience[:endDate] ||= "Present"
36
- experience
37
- end
38
- }
26
+ @doc.css('#work-experience li').map do |item|
27
+ experience = {}
28
+ experience["position"] = item.at_css(".job-title").text if item.at_css(".job-title")
29
+ experience["employer"] = item.at_css(".job-company-name").text.gsub(/\s+/, ' ').strip if item.at_css(".job-company-name")
30
+ experience["url"] = item.at_css(".company-url a")["href"] if item.at_css(".company-url a")
31
+ dates = item.css(".additional.top").text.gsub(/\s+/, ' ').strip.split(" - ")
32
+ experience["startDate"] = dates[0] if dates[0]
33
+ experience["endDate"] = dates[1] if dates[1]
34
+ experience["endDate"] ||= "Present"
35
+ experience
36
+ end
39
37
  end
40
38
 
41
39
  def education
42
- {
43
- history: @doc.css('#education .item-list li').map do |item|
44
- education = {}
45
- education[:institution] = item.at_css(".education-title").text if item.at_css(".education-title")
46
- education[:fieldOfStudy] = item.at_css(".education-description").text.gsub(/\s+/, ' ').strip if item.at_css(".education-description")
47
- education[:summary] = item.at_css(".meta").text.gsub(/\s+/, ' ').strip if item.at_css(".meta")
40
+ @doc.css('#education .item-list li').map do |item|
41
+ education = {}
42
+ education["institution"] = item.at_css(".education-title").text if item.at_css(".education-title")
43
+ education["fieldOfStudy"] = item.at_css(".education-description").text.gsub(/\s+/, ' ').strip if item.at_css(".education-description")
44
+ education["summary"] = item.at_css(".meta").text.gsub(/\s+/, ' ').strip if item.at_css(".meta")
48
45
 
49
- dates = item.css(".additional.top").text.gsub(/\s+/, ' ').strip.split(" - ")
50
- education[:startDate] = dates[0] if dates[0]
51
- education[:endDate] = dates[1] if dates[1]
52
- education[:endDate] ||= "Present"
53
- education
54
- end
55
- }
46
+ dates = item.css(".additional.top").text.gsub(/\s+/, ' ').strip.split(" - ")
47
+ education["startDate"] = dates[0] if dates[0]
48
+ education["endDate"] = dates[1] if dates[1]
49
+ education["endDate"] ||= "Present"
50
+ education
51
+ end
56
52
  end
57
53
 
58
54
  def languages
59
- {
60
- list: @doc.css('#language-skills .language').map do |item|
61
- language = {}
62
- language[:language] = item.at_css("h3 text()").text.gsub(/\s+/, ' ').strip if item.at_css("h3")
63
- language[:level] = item.at_css(".language-level-name").text.gsub(/[()]/, "") if item.at_css(".language-level-name")
64
- language
65
- end
66
- }
55
+ @doc.css('#language-skills .language').map do |item|
56
+ language = {}
57
+ language["language"] = item.at_css("h3 text()").text.gsub(/\s+/, ' ').strip if item.at_css("h3")
58
+ language["level"] = item.at_css(".language-level-name").text.gsub(/[()]/, "") if item.at_css(".language-level-name")
59
+ language
60
+ end
67
61
  end
68
62
 
69
63
  def qualifications
70
- {
71
- history: @doc.css('#qualifications li .title').map do |item|
72
- { title: item.text.gsub(/\s+/, ' ').strip }
73
- end
74
- }
64
+ @doc.css('#qualifications li .title').map do |item|
65
+ { "title" => item.text.gsub(/\s+/, ' ').strip }
66
+ end
75
67
  end
76
68
 
77
69
  def recognition
78
- {
79
- history: @doc.css('#awards li').map do |item|
80
- award = {}
81
- award[:title] = item.at_css(".title text()").text.gsub(/\s+/, ' ').strip if item.at_css(".title")
82
- award[:startDate] = item.at_css(".additional.top").text if item.at_css(".additional.top")
83
- award[:url] = item.at_css(".additional a")["href"] if item.at_css(".additional a")
84
- award
85
- end
86
- }
70
+ @doc.css('#awards li').map do |item|
71
+ award = {}
72
+ award["title"] = item.at_css(".title text()").text.gsub(/\s+/, ' ').strip if item.at_css(".title")
73
+ award["startDate"] = item.at_css(".additional.top").text if item.at_css(".additional.top")
74
+ award["url"] = item.at_css(".additional a")["href"] if item.at_css(".additional a")
75
+ award
76
+ end
87
77
  end
88
78
 
89
79
  def affiliations
90
- {
91
- history: @doc.css('#organizations li .title').map do |item|
92
- { organization: item.text.gsub(/\s+/, ' ').strip }
93
- end
94
- }
80
+ @doc.css('#organizations li .title').map do |item|
81
+ { "organization" => item.text.gsub(/\s+/, ' ').strip }
82
+ end
95
83
  end
96
84
 
97
85
  def interests
98
- {
99
- list: @doc.css('#interests li').map do |item|
100
- { name: item.text.gsub(/\s+/, ' ').strip }
101
- end
102
- }
86
+ @doc.css('#interests li').map do |item|
87
+ { "name" => item.text.gsub(/\s+/, ' ').strip }
88
+ end
103
89
  end
104
90
  end
105
91
  end
@@ -20,7 +20,7 @@ module Extractor
20
20
  end
21
21
 
22
22
  attributes.reduce({}) do |hash, attr|
23
- hash[attr.to_sym] = extractor.send(attr.to_sym) if extractor.respond_to?(attr.to_sym)
23
+ hash[attr] = extractor.send(attr) if extractor.respond_to?(attr)
24
24
  hash
25
25
  end
26
26
  end