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.
- checksums.yaml +4 -4
- data/bin/resume_exporter +4 -2
- data/lib/exporters/html.rb +33 -0
- data/lib/exporters/pdf.rb +13 -0
- data/lib/extractors/html/linkedin.rb +145 -169
- data/lib/extractors/html/stackoverflow.rb +60 -72
- data/lib/extractors/html/xing.rb +46 -60
- data/lib/extractors/html.rb +1 -1
- data/lib/extractors/json/fresh.rb +196 -233
- data/lib/extractors/json/json_resume.rb +107 -127
- data/lib/extractors/json/prtflio.rb +20 -24
- data/lib/extractors/json.rb +7 -6
- data/lib/resume_exporter.rb +6 -0
- data/lib/templates/default.json.jbuilder +162 -229
- data/lib/templates/default.md.erb +99 -244
- data/lib/templates/default.txt.erb +99 -224
- data/lib/templates/default.xml.builder +162 -227
- data/lib/templates/fresh.json.jbuilder +149 -155
- data/lib/templates/html/_affiliation.liquid +53 -0
- data/lib/templates/html/_basics.liquid +19 -0
- data/lib/templates/html/_contact.liquid +27 -0
- data/lib/templates/html/_css.liquid +324 -0
- data/lib/templates/html/_disposition.liquid +13 -0
- data/lib/templates/html/_education.liquid +56 -0
- data/lib/templates/html/_employment.liquid +67 -0
- data/lib/templates/html/_extracurricular.liquid +53 -0
- data/lib/templates/html/_footer.liquid +1 -0
- data/lib/templates/html/_governance.liquid +52 -0
- data/lib/templates/html/_image.liquid +7 -0
- data/lib/templates/html/_interests.liquid +23 -0
- data/lib/templates/html/_languages.liquid +22 -0
- data/lib/templates/html/_open_source.liquid +53 -0
- data/lib/templates/html/_patents.liquid +50 -0
- data/lib/templates/html/_projects.liquid +53 -0
- data/lib/templates/html/_qualifications.liquid +53 -0
- data/lib/templates/html/_reading.liquid +52 -0
- data/lib/templates/html/_recognition.liquid +54 -0
- data/lib/templates/html/_references.liquid +28 -0
- data/lib/templates/html/_resume.liquid +49 -0
- data/lib/templates/html/_service.liquid +53 -0
- data/lib/templates/html/_skills.liquid +35 -0
- data/lib/templates/html/_social.liquid +25 -0
- data/lib/templates/html/_speaking.liquid +53 -0
- data/lib/templates/html/_writing.liquid +52 -0
- data/lib/templates/html/default.liquid +1 -0
- data/lib/templates/json_resume.json.jbuilder +72 -72
- metadata +119 -20
@@ -6,27 +6,27 @@ module Extractor
|
|
6
6
|
|
7
7
|
def meta
|
8
8
|
{
|
9
|
-
version
|
9
|
+
"version" => @doc.dig("meta", "version")
|
10
10
|
}
|
11
11
|
end
|
12
12
|
|
13
13
|
def basics
|
14
14
|
{
|
15
|
-
name
|
16
|
-
label
|
17
|
-
image
|
18
|
-
summary
|
19
|
-
location
|
20
|
-
contact
|
21
|
-
email
|
22
|
-
phone
|
23
|
-
website
|
24
|
-
location
|
25
|
-
social
|
15
|
+
"name" => @doc.dig("basics", "name"),
|
16
|
+
"label" => @doc.dig("basics", "label"),
|
17
|
+
"image" => @doc.dig("basics", "image"),
|
18
|
+
"summary" => @doc.dig("basics", "summary"),
|
19
|
+
"location" => @doc.dig("basics", "location"),
|
20
|
+
"contact" => {
|
21
|
+
"email" => @doc.dig("basics", "email"),
|
22
|
+
"phone" => @doc.dig("basics", "phone"),
|
23
|
+
"website" => @doc.dig("basics", "url"),
|
24
|
+
"location" => @doc.dig("basics", "location", "address"),
|
25
|
+
"social" => @doc.dig("basics", "profiles").map do |p|
|
26
26
|
{
|
27
|
-
network
|
28
|
-
user
|
29
|
-
url
|
27
|
+
"network" => p["network"],
|
28
|
+
"user" => p["username"],
|
29
|
+
"url" => p["url"]
|
30
30
|
}
|
31
31
|
end
|
32
32
|
}
|
@@ -34,145 +34,125 @@ module Extractor
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def employment
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
}
|
37
|
+
@doc.dig("work").map do |job|
|
38
|
+
{
|
39
|
+
"employer" => job["name"],
|
40
|
+
"position" => job["position"],
|
41
|
+
"description" => job["description"],
|
42
|
+
"url" => job["url"],
|
43
|
+
"startDate" => job["startDate"],
|
44
|
+
"endDate" => job["endDate"],
|
45
|
+
"summary" => job["summary"],
|
46
|
+
"highlights" => job["highlights"]
|
47
|
+
}
|
48
|
+
end
|
51
49
|
end
|
52
50
|
|
53
51
|
def education
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
end
|
66
|
-
}
|
52
|
+
@doc.dig("education").map do |education|
|
53
|
+
{
|
54
|
+
"institution" => education["institution"],
|
55
|
+
"fieldOfStudy" => education["area"],
|
56
|
+
"degree" => education["studyType"],
|
57
|
+
"startDate" => education["startDate"],
|
58
|
+
"endDate" => education["endDate"],
|
59
|
+
"grade" => education["gpa"],
|
60
|
+
"curriculum" => education["courses"]
|
61
|
+
}
|
62
|
+
end
|
67
63
|
end
|
68
64
|
|
69
65
|
def projects
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
85
|
-
}
|
66
|
+
@doc.dig("projects").map do |project|
|
67
|
+
{
|
68
|
+
"title" => project["name"],
|
69
|
+
"summary" => project["description"],
|
70
|
+
"url" => project["url"],
|
71
|
+
"startDate" => project["startDate"],
|
72
|
+
"endDate" => project["endDate"],
|
73
|
+
"roles" => project["roles"],
|
74
|
+
"category" => project["type"],
|
75
|
+
"entity" => project["entity"],
|
76
|
+
"highlights" => project["highlights"],
|
77
|
+
"keywords" => project["keywords"]
|
78
|
+
}
|
79
|
+
end
|
86
80
|
end
|
87
81
|
|
88
82
|
def skills
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
end
|
97
|
-
}
|
83
|
+
@doc.dig("skills").map do |skill|
|
84
|
+
{
|
85
|
+
"name" => skill["name"],
|
86
|
+
"level" => skill["level"],
|
87
|
+
"keywords" => skill["keywords"]
|
88
|
+
}
|
89
|
+
end
|
98
90
|
end
|
99
91
|
|
100
92
|
def recognition
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
end
|
111
|
-
}
|
93
|
+
@doc.dig("awards").map do |award|
|
94
|
+
{
|
95
|
+
"title" => award["title"],
|
96
|
+
"category" => "Award",
|
97
|
+
"startDate" => award["date"],
|
98
|
+
"from" => award["awarder"],
|
99
|
+
"summary" => award["summary"]
|
100
|
+
}
|
101
|
+
end
|
112
102
|
end
|
113
103
|
|
114
104
|
def writing
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
end
|
125
|
-
}
|
105
|
+
@doc.dig("publications").map do |publication|
|
106
|
+
{
|
107
|
+
"title" => publication["name"],
|
108
|
+
"publisher" => publication["publisher"],
|
109
|
+
"date" => publication["releaseDate"],
|
110
|
+
"url" => publication["url"],
|
111
|
+
"summary" => publication["summary"]
|
112
|
+
}
|
113
|
+
end
|
126
114
|
end
|
127
115
|
|
128
116
|
def languages
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
end
|
136
|
-
}
|
117
|
+
@doc.dig("languages").map do |language|
|
118
|
+
{
|
119
|
+
"language" => language["language"],
|
120
|
+
"level" => language["fluency"]
|
121
|
+
}
|
122
|
+
end
|
137
123
|
end
|
138
124
|
|
139
125
|
def interests
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
end
|
147
|
-
}
|
126
|
+
@doc.dig("interests").map do |interest|
|
127
|
+
{
|
128
|
+
"name" => interest["name"],
|
129
|
+
"keywords" => interest["keywords"]
|
130
|
+
}
|
131
|
+
end
|
148
132
|
end
|
149
133
|
|
150
134
|
def service
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
end
|
164
|
-
}
|
135
|
+
@doc.dig("volunteer").map do |volunteer|
|
136
|
+
{
|
137
|
+
"category" => "Volunteer Work",
|
138
|
+
"organization" => volunteer["organization"],
|
139
|
+
"roles" => [volunteer["position"]],
|
140
|
+
"url" => volunteer["url"],
|
141
|
+
"startDate" => volunteer["startDate"],
|
142
|
+
"endDate" => volunteer["endDate"],
|
143
|
+
"summary" => volunteer["summary"],
|
144
|
+
"highlights" => volunteer["highlights"]
|
145
|
+
}
|
146
|
+
end
|
165
147
|
end
|
166
148
|
|
167
149
|
def references
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
end
|
175
|
-
}
|
150
|
+
@doc.dig("references").map do |reference|
|
151
|
+
{
|
152
|
+
"name" => reference["name"],
|
153
|
+
"summary" => reference["reference"]
|
154
|
+
}
|
155
|
+
end
|
176
156
|
end
|
177
157
|
end
|
178
158
|
end
|
@@ -5,87 +5,83 @@ module Extractor
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def meta
|
8
|
-
@doc.dig(
|
8
|
+
@doc.dig("meta")
|
9
9
|
end
|
10
10
|
|
11
11
|
def basics
|
12
|
-
@doc.dig(
|
12
|
+
@doc.dig("basics")
|
13
13
|
end
|
14
14
|
|
15
15
|
def employment
|
16
|
-
@doc.dig(
|
16
|
+
@doc.dig("employment")
|
17
17
|
end
|
18
18
|
|
19
19
|
def education
|
20
|
-
@doc.dig(
|
20
|
+
@doc.dig("education")
|
21
21
|
end
|
22
22
|
|
23
23
|
def projects
|
24
|
-
@doc.dig(
|
24
|
+
@doc.dig("projects")
|
25
25
|
end
|
26
26
|
|
27
27
|
def openSource
|
28
|
-
@doc.dig(
|
28
|
+
@doc.dig("openSource")
|
29
29
|
end
|
30
30
|
|
31
31
|
def skills
|
32
|
-
@doc.dig(
|
32
|
+
@doc.dig("skills")
|
33
33
|
end
|
34
34
|
|
35
35
|
def qualifications
|
36
|
-
@doc.dig(
|
36
|
+
@doc.dig("qualifications")
|
37
37
|
end
|
38
38
|
|
39
39
|
def recognition
|
40
|
-
@doc.dig(
|
40
|
+
@doc.dig("recognition")
|
41
41
|
end
|
42
42
|
|
43
43
|
def writing
|
44
|
-
@doc.dig(
|
44
|
+
@doc.dig("writing")
|
45
45
|
end
|
46
46
|
|
47
47
|
def reading
|
48
|
-
@doc.dig(
|
48
|
+
@doc.dig("reading")
|
49
49
|
end
|
50
50
|
|
51
51
|
def speaking
|
52
|
-
@doc.dig(
|
52
|
+
@doc.dig("speaking")
|
53
53
|
end
|
54
54
|
|
55
55
|
def patents
|
56
|
-
@doc.dig(
|
56
|
+
@doc.dig("patents")
|
57
57
|
end
|
58
58
|
|
59
59
|
def languages
|
60
|
-
@doc.dig(
|
60
|
+
@doc.dig("languages")
|
61
61
|
end
|
62
62
|
|
63
63
|
def interests
|
64
|
-
@doc.dig(
|
64
|
+
@doc.dig("interests")
|
65
65
|
end
|
66
66
|
|
67
67
|
def extracurriculars
|
68
|
-
@doc.dig(
|
68
|
+
@doc.dig("extracurriculars")
|
69
69
|
end
|
70
70
|
|
71
71
|
def affiliations
|
72
|
-
@doc.dig(
|
72
|
+
@doc.dig("affiliations")
|
73
73
|
end
|
74
74
|
|
75
75
|
def governance
|
76
|
-
@doc.dig(
|
76
|
+
@doc.dig("governance")
|
77
77
|
end
|
78
78
|
|
79
79
|
def service
|
80
|
-
@doc.dig(
|
80
|
+
@doc.dig("service")
|
81
81
|
end
|
82
82
|
|
83
83
|
def references
|
84
|
-
@doc.dig(
|
85
|
-
end
|
86
|
-
|
87
|
-
def disposition
|
88
|
-
@doc.dig(:disposition)
|
84
|
+
@doc.dig("references")
|
89
85
|
end
|
90
86
|
end
|
91
87
|
end
|
data/lib/extractors/json.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "json"
|
2
|
+
require "safe_yaml"
|
2
3
|
require "extractors/base"
|
3
4
|
require "extractors/json/json_resume"
|
4
5
|
require "extractors/json/fresh"
|
@@ -7,7 +8,7 @@ require "extractors/json/prtflio"
|
|
7
8
|
module Extractor
|
8
9
|
class Json < Base
|
9
10
|
def initialize(file_path)
|
10
|
-
@doc = File.open(file_path) { |f|
|
11
|
+
@doc = File.open(file_path) { |f| SafeYAML.load(f.read) }
|
11
12
|
end
|
12
13
|
|
13
14
|
def extract
|
@@ -20,19 +21,19 @@ module Extractor
|
|
20
21
|
end
|
21
22
|
|
22
23
|
attributes.reduce({}) do |hash, attr|
|
23
|
-
hash[attr
|
24
|
+
hash[attr] = extractor.send(attr) if extractor.respond_to?(attr)
|
24
25
|
hash
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
def is_prtflio?
|
29
|
-
@doc.dig(
|
30
|
-
@doc.dig(
|
30
|
+
@doc.dig("meta", "format") &&
|
31
|
+
@doc.dig("meta", "format").downcase.include?("prtflio")
|
31
32
|
end
|
32
33
|
|
33
34
|
def is_fresh?
|
34
|
-
@doc.dig(
|
35
|
-
@doc.dig(
|
35
|
+
@doc.dig("meta", "format") &&
|
36
|
+
@doc.dig("meta", "format").downcase.include?("fresh")
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end
|
data/lib/resume_exporter.rb
CHANGED
@@ -2,6 +2,8 @@ require "extractors/factory"
|
|
2
2
|
require "exporters/json"
|
3
3
|
require "exporters/xml"
|
4
4
|
require "exporters/md"
|
5
|
+
require "exporters/html"
|
6
|
+
require "exporters/pdf"
|
5
7
|
require "exporters/txt"
|
6
8
|
require "exporters/yaml"
|
7
9
|
|
@@ -27,6 +29,10 @@ class ResumeExporter
|
|
27
29
|
Exporter::Json.export(data: @data, template: "json_resume")
|
28
30
|
when "xml"
|
29
31
|
Exporter::Xml.export(data: @data)
|
32
|
+
when "html"
|
33
|
+
Exporter::Html.export(data: @data)
|
34
|
+
when "pdf"
|
35
|
+
Exporter::Pdf.export(data: @data)
|
30
36
|
when "md"
|
31
37
|
Exporter::Md.export(data: @data)
|
32
38
|
when "yaml"
|