simple_cv 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2122f0135e950639721e5ac138d2275ec3d225e361f128e2f14cdb5e6a3c3a02
4
- data.tar.gz: 9d547764e63ff462777e65ffa645625705f8d224f26a1f1df358e7c1c84ae765
3
+ metadata.gz: 8617afb70ab82deafd776cb77f7d3da27a828894144ab18f97aab865343b60b6
4
+ data.tar.gz: 1422ccb0ac28d440a24aedab1d893011ef723d0f37dfc79d3a3e4b5dd89cdfb9
5
5
  SHA512:
6
- metadata.gz: b5174e134bb05b847662d825f831fb363e416f78301ecac6654d73c38c680ba4bc0b88b48652f92b619f0bd406bf88a09e055cb348575365247b75a83837735d
7
- data.tar.gz: 669e343e393a246ad65cf6a37048e3b6dc24db5ad9df5d2389b30008ad187556cb2ed9295e96eb5750c38a54d951284d81783aff61d696d0ed27fcdce4219c4f
6
+ metadata.gz: 9daef9d7d75b7ac2ac09f7ccfa8a741df423b677d53581ea1d0d6a320e3e81b2eefe4805b8ddee9d2e8ddea90936dd5a3a5d33804ce646cfca13976fb17db244
7
+ data.tar.gz: 12b2980ddfe97a60155c99940007b064b7e2a28bb9e3af6f4a2f22644f2229aa55959c6bd1730b527d13b8f27a2f5d3ee648355e110cf23fdf20dca26d4b691b
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ ruby "3.2.2"
5
+
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,56 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ simple_cv (0.1.0)
5
+ prawn
6
+ prawn-table
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ coderay (1.1.3)
12
+ diff-lcs (1.5.0)
13
+ method_source (1.0.0)
14
+ pdf-core (0.9.0)
15
+ prawn (2.4.0)
16
+ pdf-core (~> 0.9.0)
17
+ ttfunk (~> 1.7)
18
+ prawn-table (0.2.2)
19
+ prawn (>= 1.3.0, < 3.0.0)
20
+ pry (0.14.1)
21
+ coderay (~> 1.1)
22
+ method_source (~> 1.0)
23
+ pry-nav (1.0.0)
24
+ pry (>= 0.9.10, < 0.15)
25
+ rake (13.1.0)
26
+ rspec (3.11.0)
27
+ rspec-core (~> 3.11.0)
28
+ rspec-expectations (~> 3.11.0)
29
+ rspec-mocks (~> 3.11.0)
30
+ rspec-core (3.11.0)
31
+ rspec-support (~> 3.11.0)
32
+ rspec-expectations (3.11.1)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.11.0)
35
+ rspec-mocks (3.11.1)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.11.0)
38
+ rspec-support (3.11.1)
39
+ ttfunk (1.7.0)
40
+
41
+ PLATFORMS
42
+ aarch64-linux-musl
43
+
44
+ DEPENDENCIES
45
+ bundler
46
+ pry
47
+ pry-nav
48
+ rake
49
+ rspec
50
+ simple_cv!
51
+
52
+ RUBY VERSION
53
+ ruby 3.2.2p53
54
+
55
+ BUNDLED WITH
56
+ 2.3.7
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake"
5
+
6
+ desc "Load environment"
7
+ task :environment do
8
+ $LOAD_PATH.unshift(".")
9
+ end
10
+
11
+ desc "Ruby console with loaded env"
12
+ task console: :environment do
13
+ require "irb"
14
+ require "lib/simple_cv.rb"
15
+
16
+ ARGV.clear
17
+ IRB.start
18
+ end
@@ -0,0 +1,79 @@
1
+ {
2
+ "title": "SimpleCV",
3
+ "author": "Suzanne Shaw",
4
+ "profile": {
5
+ "name": "Suzanne Shaw",
6
+ "job": "Art Director"
7
+ },
8
+ "contact": {
9
+ "address": "Santa Monica, USA",
10
+ "phone": "(916)-209-3856",
11
+ "email": "suzanne.showh@example.com",
12
+ "web": "https://example.com"
13
+ },
14
+ "intro": {
15
+ "text": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
16
+ "receiver": {
17
+ "name": "John Doe",
18
+ "position": "Managing Director"
19
+ }
20
+ },
21
+ "experience": [
22
+ {
23
+ "job": "Art Director",
24
+ "company": "Creative Lab",
25
+ "location": "Santa Monica",
26
+ "date": "2016 - Present",
27
+ "description_list": [
28
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr",
29
+ "Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat",
30
+ "At vero eos et accusam et justo duo dolores et ea rebum",
31
+ "Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
32
+ ]
33
+ },
34
+ {
35
+ "job": "Senior UI & UX Designer",
36
+ "company": "Creative Media",
37
+ "location": "Santa Monica",
38
+ "date": "2015 - 2016",
39
+ "description_list": [
40
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr",
41
+ "Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat",
42
+ "At vero eos et accusam et justo duo dolores et ea rebum",
43
+ "Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
44
+ ]
45
+ },
46
+ {
47
+ "job": "Junior UI & UX Designer",
48
+ "company": "Creative Media",
49
+ "location": "Santa Monica",
50
+ "date": "2012 - 2015",
51
+ "description_list": [
52
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr",
53
+ "Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat",
54
+ "At vero eos et accusam et justo duo dolores et ea rebum",
55
+ "Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
56
+ ]
57
+ }
58
+ ],
59
+ "education": [
60
+ {
61
+ "subject": "Master in Media",
62
+ "institution": "Media University",
63
+ "date": "2013 - 2015"
64
+ },
65
+ {
66
+ "subject": "Bachelor of Fine Arts",
67
+ "institution": "University of Arts",
68
+ "date": "2010 - 2013"
69
+ }
70
+ ],
71
+ "certification": [
72
+ {
73
+ "subject": "AWS Certified Cloud Practitioner",
74
+ "institution": "Amazon Web Services (AWS)",
75
+ "date": "Jan 2020",
76
+ "expiration": "Jan 2020 - Jan 2023"
77
+ }
78
+ ]
79
+ }
@@ -0,0 +1,61 @@
1
+ title: SimpleCV
2
+ author: Suzanne Shaw
3
+ profile:
4
+ name: "Suzanne Shaw"
5
+ job: Art Director
6
+ contact:
7
+ address: Santa Monica, USA
8
+ phone: (916)-209-3856
9
+ email: suzanne.showh@example.com
10
+ web: https://example.com
11
+ intro:
12
+ text: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
13
+ receiver:
14
+ name": John Doe
15
+ position": Managing Director
16
+ experience:
17
+ -
18
+ job: Art Director
19
+ company: Creative Lab
20
+ location: Santa Monica
21
+ date: 2016 - Present
22
+ description_list:
23
+ - Lorem ipsum dolor sit amet, consetetur sadipscing elitr
24
+ - Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat
25
+ - At vero eos et accusam et justo duo dolores et ea rebum
26
+ - Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
27
+ -
28
+ job: Senior UI & UX Designer
29
+ company: Creative Media
30
+ location: Santa Monica
31
+ date: 2015 - 2016
32
+ description_list:
33
+ - Lorem ipsum dolor sit amet, consetetur sadipscing elitr
34
+ - Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat
35
+ - At vero eos et accusam et justo duo dolores et ea rebum
36
+ - Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
37
+ -
38
+ job: Junior UI & UX Designer
39
+ company: Creative Media
40
+ location: Santa Monica
41
+ date: 2012 - 2015
42
+ description_list:
43
+ - Lorem ipsum dolor sit amet, consetetur sadipscing elitr
44
+ - Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat
45
+ - At vero eos et accusam et justo duo dolores et ea rebum
46
+ - Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
47
+ education:
48
+ -
49
+ subject: Master in Media
50
+ institution: Media University
51
+ date: 2013 - 2015
52
+ -
53
+ subject: Bachelor of Fine Arts
54
+ institution: University of Arts
55
+ date: 2010 - 2013
56
+ certification:
57
+ -
58
+ subject: AWS Certified Cloud Practitioner
59
+ institution: Amazon Web Services (AWS)
60
+ date: Jan 2020
61
+ expiration: Jan 2020 - Jan 2023
Binary file
Binary file
Binary file
@@ -0,0 +1,48 @@
1
+ Copyright (c) 2010-2014, Łukasz Dziedzic (dziedzic@typoland.com),
2
+ with Reserved Font Name Lato.
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is copied below, and is also available with a FAQ at:
6
+ http://scripts.sil.org/OFL
7
+
8
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
9
+ This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
10
+
11
+ -----------------------------------------------------------
12
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
13
+ -----------------------------------------------------------
14
+
15
+ PREAMBLE
16
+ The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
19
+
20
+ DEFINITIONS
21
+ "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
22
+
23
+ "Reserved Font Name" refers to any names specified as such after the copyright statement(s).
24
+
25
+ "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
26
+
27
+ "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
28
+
29
+ "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
30
+
31
+ PERMISSION & CONDITIONS
32
+ Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
33
+
34
+ 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
35
+
36
+ 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
37
+
38
+ 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
39
+
40
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
41
+
42
+ 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
43
+
44
+ TERMINATION
45
+ This license becomes null and void if any of the above conditions are not met.
46
+
47
+ DISCLAIMER
48
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lib/simple_cv/layout"
4
+ require "json"
5
+ require "yaml"
6
+
7
+ module SimpleCV
8
+ class Basic
9
+ attr_reader :config
10
+
11
+ def initialize(config_path)
12
+ @config = parse_config_file(config_path)
13
+ end
14
+
15
+ # Render file
16
+ #
17
+ # With given path and filename, pdf can be rendered to a specific
18
+ # location. If no arguments are given, filename will be set to
19
+ # SimpleCV.pdf and pdf will be rendered to current working dir.
20
+
21
+ def render_file(filename: "SimpleCV", path: nil)
22
+ output_path = File.join(path || Dir.pwd, "#{filename.chomp('.pdf')}.pdf")
23
+ Layout.new(config).render_file(output_path)
24
+ output_path
25
+ end
26
+
27
+ private
28
+
29
+ def parse_config_file(config_path)
30
+ File.open(config_path, "r") do |file|
31
+ case File.extname(file).delete(".")
32
+ when "json" then JSON.parse(file.read)
33
+ when "yml" then YAML.load_file(file)
34
+ else
35
+ file.close
36
+ raise LoadError, "Type of file is not supported."
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,222 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "prawn"
4
+
5
+ module SimpleCV
6
+ class Layout < ::Prawn::Document
7
+ attr_reader :config, :black, :dark_gray, :light_gray
8
+
9
+ def initialize(config = {})
10
+ @config = config
11
+
12
+ @black = "000000"
13
+ @dark_gray = "6c6c6c"
14
+ @light_gray = "A2A2A2"
15
+
16
+ super({
17
+ page_size: "A4",
18
+ info: {
19
+ Title: config["title"],
20
+ Author: config["author"],
21
+ Creator: config["author"],
22
+ Producer: config["author"],
23
+ CreationDate: Time.now
24
+ }
25
+ })
26
+
27
+ font_families.update "Default" => default_font_files
28
+ font "Default"
29
+ stroke_color "000000"
30
+ main
31
+
32
+ if page_count > 1
33
+ options = { start_count_at: 1, at: [0, -10], size: 7, style: :light, color: light_gray, align: :right }
34
+ number_pages("Page <page> of <total>", options)
35
+ end
36
+ end
37
+
38
+ def main
39
+ header
40
+ if config["intro"]
41
+ intro
42
+ start_new_page
43
+ end
44
+ experience
45
+ education
46
+ certification
47
+ end
48
+
49
+ def header
50
+ text(config.dig("profile", "name")&.upcase, size: 20, leading: 3, character_spacing: 1.9)
51
+ move_down(2)
52
+ text(config.dig("profile", "job")&.upcase, style: :light, size: 12, leading: 3, character_spacing: 1.9, color: dark_gray)
53
+ move_down(10)
54
+ stroke_color(black)
55
+ line_width(1)
56
+ line([0, cursor], [523, cursor])
57
+ stroke
58
+
59
+ line_pointer = 770
60
+ text_box(config.dig("contact", "address"), size: 8, at: [240, line_pointer], align: :right, style: :light)
61
+
62
+ fill_color(dark_gray)
63
+
64
+ config["contact"]&.each do |k,v|
65
+ line_pointer -= 10
66
+ text_box("<color rgb='#{black}'>#{k.capitalize}:</color> #{v}", size: 8, at: [240, line_pointer], align: :right, inline_format: true, style: :light)
67
+ end
68
+
69
+ fill_color(black)
70
+ move_down(20)
71
+ end
72
+
73
+ def intro
74
+ text_box(DateTime.now.strftime("%d.%m.%Y"), at: [0, cursor], align: :right, size: 7)
75
+ text(config.dig("intro", "receiver", "name")&.upcase, size: 7, color: black)
76
+ text(config.dig("intro", "receiver", "position")&.upcase, size: 7, color: dark_gray)
77
+
78
+ move_down(30)
79
+ text(config.dig("intro", "text"), size: 9, color: dark_gray, style: :light)
80
+
81
+ # move_down(20)
82
+ # stroke_color(light_gray)
83
+ # line_width(0.5)
84
+ # line([0, cursor], [523, cursor])
85
+ # stroke
86
+ # move_down(30)
87
+ end
88
+
89
+ def experience
90
+ h2("work experience")
91
+ last_cursor = start_cursor = cursor
92
+
93
+ config["experience"]&.each do |elem|
94
+ bounding_box([0, last_cursor], width: 523) do
95
+ bounding_box([15, 0], width: 165) do
96
+ fill_color(light_gray)
97
+ stroke_color("ffffff")
98
+ text_box("•", at: [-19, cursor+2], size: 13, color: light_gray, mode: :fill_stroke)
99
+ fill_color(black)
100
+ text(elem["company"], size: 9, style: :light)
101
+ text(elem["date"], size: 7.5, color: dark_gray, style: :light)
102
+ end
103
+
104
+ bounding_box([180, bounds.top], width: 353, background_color: light_gray) do
105
+ text(elem["job"], size: 9, leading: 7)
106
+
107
+ elem["description_list"]&.each do |item|
108
+ text_box("•", at: [0, cursor], size: 8, color: dark_gray)
109
+ indent(10) { text(item, size: 8, color: dark_gray, style: :light) }
110
+ end
111
+
112
+ move_down(10)
113
+ last_cursor -= bounds.top
114
+ end
115
+ end
116
+ end
117
+
118
+ end_cursor = cursor
119
+ stroke_color(light_gray)
120
+ line_width(0.5)
121
+ line([0, start_cursor + 5], [0, end_cursor + 10])
122
+ stroke
123
+
124
+ move_down(10)
125
+ stroke_color(light_gray)
126
+ line_width(0.5)
127
+ line([0, cursor], [523, cursor])
128
+ stroke
129
+ move_down(20)
130
+ end
131
+
132
+ def education
133
+ h2("education")
134
+ start_cursor = cursor
135
+
136
+ config["education"]&.each_with_index do |elem, index|
137
+ bounding_box([12 + (index * 180), start_cursor], width: 180) do
138
+ text(elem["subject"], size: 9)
139
+ text(elem["institution"], size: 9, style: :light)
140
+ text(elem["date"], size: 7.5, color: dark_gray, style: :light)
141
+ move_down(10)
142
+ end
143
+
144
+ stroke_color(black)
145
+ line_width(3)
146
+ line([index * 180, start_cursor], [index * 180, cursor + 10])
147
+ stroke
148
+ end
149
+
150
+ move_down(20)
151
+ stroke_color(light_gray)
152
+ line_width(0.5)
153
+ line([0, cursor], [523, cursor])
154
+ stroke
155
+ move_down(20)
156
+ end
157
+
158
+ def certification
159
+ h2("certification")
160
+ last_cursor = start_cursor = cursor
161
+
162
+ config["certification"]&.each do |elem|
163
+ bounding_box([15, cursor], width: 523) do
164
+ text(elem["subject"], size: 9)
165
+ text(elem["institution"], size: 9, style: :light)
166
+ text(elem["date"], size: 7.5, color: dark_gray, style: :light)
167
+ move_down(20)
168
+ end
169
+
170
+ stroke_color(black)
171
+ line_width(3)
172
+ line([2, start_cursor], [2, cursor + 20])
173
+ stroke
174
+ end
175
+ end
176
+
177
+ private
178
+
179
+ def default_font_files
180
+ {
181
+ light: File.join("lib", "font", "Lato-Light.ttf"),
182
+ normal: File.join("lib", "font", "Lato-Medium.ttf"),
183
+ bold: File.join("lib", "font", "Lato-Bold.ttf")
184
+ }
185
+ end
186
+
187
+ def h2(title)
188
+ text(title&.upcase, style: :bold, size: 10, leading: 7, character_spacing: 1.9)
189
+ line_width(1)
190
+ stroke_color("000000")
191
+ line([0, cursor], [35, cursor])
192
+ move_down(15)
193
+ stroke
194
+ move_down(10)
195
+ end
196
+
197
+ # Shrink svg images
198
+ #
199
+ # Helper method to resize given svg images to a specific width and height range.
200
+
201
+ def svg_fit file, width, height
202
+ viewBox = file[/(viewBox=)[\-\".0-9 ]*/]
203
+ return { height: height } unless viewBox
204
+
205
+ metric = viewBox.tr("viewBox=", "").tr("\"", "").split(" ")
206
+ scale = metric.third.to_i / metric.fourth.to_i
207
+
208
+ if (scale * height) > width
209
+ { width: width }
210
+ else
211
+ { height: height }
212
+ end
213
+ end
214
+
215
+ def print_current_bounds
216
+ text("top: #{bounds.top}")
217
+ text("left: #{bounds.left}")
218
+ text("right: #{bounds.right}")
219
+ text("bottom: #{bounds.bottom}")
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,3 @@
1
+ module SimpleCV
2
+ VERSION = "0.2.1"
3
+ end
data/lib/simple_cv.rb ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "prawn"
4
+ require "prawn/table"
5
+
6
+ require "lib/simple_cv/version"
7
+ require "lib/simple_cv/basic"
8
+
9
+ module SimpleCV
10
+ end
data/simple_cv.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+
3
+ $LOAD_PATH.unshift(".")
4
+
5
+ require "lib/simple_cv/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "simple_cv"
9
+ spec.version = SimpleCV::VERSION
10
+ spec.authors = ["Frederic Walch"]
11
+ spec.email = ["github@frederic.tech"]
12
+
13
+ spec.summary = %q{This Gem helps you to generate a awesome CV!}
14
+ spec.homepage = "https://github.com/freder1c"
15
+ spec.license = "MIT"
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
+ f.match(%r{^(test|spec|features)/})
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_dependency "prawn"
27
+ spec.add_dependency "prawn-table"
28
+
29
+ spec.add_development_dependency "bundler"
30
+ spec.add_development_dependency "rake"
31
+ spec.add_development_dependency "rspec"
32
+
33
+ spec.add_development_dependency "pry"
34
+ spec.add_development_dependency "pry-nav"
35
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_cv
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
  - Frederic Walch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-20 00:00:00.000000000 Z
11
+ date: 2023-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -108,19 +108,34 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description:
111
+ description:
112
112
  email:
113
113
  - github@frederic.tech
114
114
  executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
- files: []
117
+ files:
118
+ - ".rspec"
119
+ - Gemfile
120
+ - Gemfile.lock
121
+ - Rakefile
122
+ - examples/example.json
123
+ - examples/example.yml
124
+ - lib/font/Lato-Bold.ttf
125
+ - lib/font/Lato-Light.ttf
126
+ - lib/font/Lato-Medium.ttf
127
+ - lib/font/SIL Open Font License.txt
128
+ - lib/simple_cv.rb
129
+ - lib/simple_cv/basic.rb
130
+ - lib/simple_cv/layout.rb
131
+ - lib/simple_cv/version.rb
132
+ - simple_cv.gemspec
118
133
  homepage: https://github.com/freder1c
119
134
  licenses:
120
135
  - MIT
121
136
  metadata:
122
137
  allowed_push_host: https://rubygems.org
123
- post_install_message:
138
+ post_install_message:
124
139
  rdoc_options: []
125
140
  require_paths:
126
141
  - lib
@@ -135,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
150
  - !ruby/object:Gem::Version
136
151
  version: '0'
137
152
  requirements: []
138
- rubygems_version: 3.4.10
139
- signing_key:
153
+ rubygems_version: 3.0.3.1
154
+ signing_key:
140
155
  specification_version: 4
141
156
  summary: This Gem helps you to generate a awesome CV!
142
157
  test_files: []