lib/epilotto_curriculum.rb in epilotto_curriculum-0.2.1 vs lib/epilotto_curriculum.rb in epilotto_curriculum-0.2.2
- old
+ new
@@ -6,10 +6,11 @@
def build_from_yaml(yaml_file, width: 80, left_column_max_width_percent: 30)
cv = YAML.load_file(yaml_file)
name = cv.delete('name')
updated_at = cv.delete('updated_at')
+ about_me = cv.delete('about_me')
left_column_max_width = (width * (left_column_max_width_percent/100.0)).round
max_paragraph_width = cv.values.map(&:keys).flatten.max{|x,y| x.size <=> y.size}.size
lc_w = (max_paragraph_width <= left_column_max_width ? max_paragraph_width : left_column_max_width) + 1
rc_w = width - 3 - lc_w
@@ -28,10 +29,11 @@
i += 1
end
end
end
end
+ s << draw_about_me(name, about_me, width)
return s.join("\n")
end
private
@@ -84,8 +86,15 @@
def draw_section(s, width)
lw = width - s.size - 4
lw = lw < 0 ? 0 : lw
return bold(yellow("#{'â'*2} #{s} #{'â'*lw}"))
+ end
+
+ def draw_about_me(name, link, width)
+ if link.present?
+ s = "âšī¸ Really more info about #{name} here: #{link}"
+ return "\n#{s}\n"
+ end
end
end