epilotto_curriculum 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62b5079fdf0e7c7a150c4b6c311490e6262edc21
4
- data.tar.gz: 8d7ad5c47fb6ebc1f0244478807bbd7127f971d1
3
+ metadata.gz: '01863d7dd7e2aa80ac725d700421e270790ab1fc'
4
+ data.tar.gz: 7234a98269dc504445a3ed3da0576e2d864660f4
5
5
  SHA512:
6
- metadata.gz: '06684fbc712f3077b0b3a50755ec2b3a5b9c205c73072fb7f034b6953d2387754d3e7bb5c53fdcc0a83a863bdbb192766ec0fa1622ec42fff465329185710763'
7
- data.tar.gz: 52e1be0e27bcbf0ac17fe825f939043a50804ff3f772d06eaa4307780885aa096f3fedb3786d198701b2265f2cb1b549832a4fef1ce37bcf6342a03d1f09b4c6
6
+ metadata.gz: 396c478762cb2ba288e4638e08a06cd04b6cb4c8795029865313512ceed6cc0b3a454742b46a658dd16c168ae62a2880710d02cf3b0c753231161216209baa3b
7
+ data.tar.gz: a9524dc1ebce9dd6bee0572bee465b76fed743de77d58f23ca4da3e8ff69bb2b75a54c6aeb977a7c4d92fbbedf127a80734196f97725d34f6d7e8d6a89e847d3
data/lib/cv.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  name: Enrico Pilotto
2
+ updated_at: 2 March 2017
2
3
  Personal Information:
3
4
  Name: Enrico
4
5
  Surname: Pilotto
@@ -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 = "#{title} (last update 1 March 2017)".center(width)
80
- s.gsub!(title, bold(red(title)))
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
 
@@ -1,3 +1,3 @@
1
1
  module EpilottoCurriculum
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epilotto_curriculum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pioz