epilotto_curriculum 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cv.yml +1 -0
- data/lib/epilotto_curriculum.rb +6 -5
- data/lib/epilotto_curriculum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '01863d7dd7e2aa80ac725d700421e270790ab1fc'
|
4
|
+
data.tar.gz: 7234a98269dc504445a3ed3da0576e2d864660f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 396c478762cb2ba288e4638e08a06cd04b6cb4c8795029865313512ceed6cc0b3a454742b46a658dd16c168ae62a2880710d02cf3b0c753231161216209baa3b
|
7
|
+
data.tar.gz: a9524dc1ebce9dd6bee0572bee465b76fed743de77d58f23ca4da3e8ff69bb2b75a54c6aeb977a7c4d92fbbedf127a80734196f97725d34f6d7e8d6a89e847d3
|
data/lib/cv.yml
CHANGED
data/lib/epilotto_curriculum.rb
CHANGED
@@ -7,12 +7,13 @@ module EpilottoCurriculum
|
|
7
7
|
def build_from_yaml(yaml_file, width: 80, left_column_max_width_percent: 30)
|
8
8
|
cv = YAML.load_file(yaml_file)
|
9
9
|
name = cv.delete('name')
|
10
|
+
updated_at = cv.delete('updated_at')
|
10
11
|
left_column_max_width = (width * (left_column_max_width_percent/100.0)).round
|
11
12
|
max_paragraph_width = cv.values.map(&:keys).flatten.max{|x,y| x.size <=> y.size}.size
|
12
13
|
lc_w = (max_paragraph_width <= left_column_max_width ? max_paragraph_width : left_column_max_width) + 1
|
13
14
|
rc_w = width - 3 - lc_w
|
14
15
|
|
15
|
-
s = [draw_title(name, width)]
|
16
|
+
s = [draw_title(name, width, updated_at)]
|
16
17
|
cv.each do |section, data|
|
17
18
|
if section != :name
|
18
19
|
s << draw_section(section, width) # lc_w - 1
|
@@ -29,7 +30,6 @@ module EpilottoCurriculum
|
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
32
|
-
s << ''
|
33
33
|
return s.join("\n")
|
34
34
|
end
|
35
35
|
|
@@ -74,10 +74,11 @@ module EpilottoCurriculum
|
|
74
74
|
return r.join("\n")
|
75
75
|
end
|
76
76
|
|
77
|
-
def draw_title(name, width)
|
77
|
+
def draw_title(name, width, updated_at = nil)
|
78
78
|
title = "#{name.upcase}'s curriculum vitæ"
|
79
|
-
s =
|
80
|
-
s
|
79
|
+
s = title
|
80
|
+
s = "#{title} (last update #{updated_at})" if updated_at
|
81
|
+
s = s.center(width).gsub(title, bold(red(title)))
|
81
82
|
return "\n#{s}\n"
|
82
83
|
end
|
83
84
|
|