resuby 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9fd599e4cbec4923371bc76965fc672c7d7a8fa3
4
+ data.tar.gz: ce42045b330c1f7b9ce6560b9ab4371a6b94977c
5
+ SHA512:
6
+ metadata.gz: 1b7c7e4171a359fe0c7bd8096a166ba27257cd242d11a48277523db91f952215d889961e6c821d1b2a1c8448f247263aa06cd18b6006cd5964fda95241444ff8
7
+ data.tar.gz: 495ec1437faca54af1073b34081d7b2ebce477b6deb75382da61c02373c9ab67e578d29a59710c7b9084ef8a8d0eb03a3623dbfbc23751dc7149c8fcd77a9ee9
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # Resuby
2
+
3
+ [![Gem](https://img.shields.io/gem/v/resuby.svg?style=flat-square)](https://rubygems.org/gems/resuby)
4
+ [![GitHub issues](https://img.shields.io/github/issues/mardotio/resuby.svg?style=flat-square)](https://github.com/mardotio/resuby/issues)
5
+ [![Gem](https://img.shields.io/gem/dtv/resuby.svg?style=flat-square)](https://rubygems.org/gems/resuby)
6
+
7
+ ## Overview
8
+
9
+ Resuby is a gem that takes a `yaml` configuration file that contains all of your
10
+ resume information, and turns it into a resume you can actually use to find your
11
+ next job. After you generate your resume, you will have an HTML file that you
12
+ can open in your favorite browser (as long as yor favorite browser is Chrome or
13
+ Safari), and view the end result.
14
+
15
+ ## Table of Contents
16
+
17
+ <!-- TOC -->
18
+
19
+ - [Resuby](#resuby)
20
+ - [Overview](#overview)
21
+ - [Table of Contents](#table-of-contents)
22
+ - [Installation](#installation)
23
+ - [Usage](#usage)
24
+ - [Generating Resume](#generating-resume)
25
+ - [Compatibility](#compatibility)
26
+
27
+ <!-- /TOC -->
28
+
29
+ ## Installation
30
+
31
+ To install, simply run `gem install resuby`.
32
+
33
+ In addition to resuby, it will install SASS, which is a common CSS pre-compiler
34
+ that is used by resuby to generate the CSS file for your resume.
35
+
36
+ ## Usage
37
+
38
+ In order for the script to work, you will first need to create a file in the
39
+ root directory of the project called `resume.yaml`. This file should contain
40
+ your name, contact information, and any other information that you want in your
41
+ resume. Below are the keywords that are expected in the yaml file.
42
+
43
+ |Key|Class|Required|Description|
44
+ |---|-----|--------|-----------|
45
+ |`name`|String|True|Your name|
46
+ |`contact`|Array|True|Any contact information (i.e. phone, email)|
47
+ |`profile`|String|False|A small paragraph that describes you|
48
+ |Any other key|Array|False|These will become the headers for your other resume sections (i.e. education -> Education, projects_&_experience -> Projects & Experience|
49
+
50
+ Each array element under the headers you create is expected to be a hash. All of
51
+ the array elements under those sections will become a new row under that header.
52
+ Below are the expected key values for each array element under your headers.
53
+
54
+ |Key|Class|Required|Description|
55
+ |---|-----|--------|-----------|
56
+ |`title`|String|False|Main point for that row, will have slightly larger font than the rest of the values|
57
+ |`desc`|String|True|Description for that section (i.e. dates), will be displayed to the left of that section|
58
+ |`subtitle`|String|False|Will be displayed right under the title, will be in italics|
59
+ |`data`|Array|True|Any other info, such as accomplishments, each array element will be a new bullet|
60
+
61
+ [`default.yaml`](/examples/default.yaml) contains a sample structure.
62
+
63
+ ## Generating Resume
64
+
65
+ Once you have created a `resume.yaml` file, you can run the following command
66
+ from the same directoy:
67
+
68
+ ```
69
+ resuby generate
70
+ ```
71
+
72
+ Running this command will generate a file called `resume.html` in your current
73
+ directory. Now you can simply open this in a browser, and print it (__make sure
74
+ that the printed page has no margins, as the HTML generated will have its
75
+ own margins set__).
76
+
77
+
78
+ ## Compatibility
79
+
80
+ The generated HTML and styling has only been tested in Chrome and Safari.
81
+ This doesn't mean it won't work on other browsers, but it is not guaranteed to
82
+ look as designed.
data/bin/resuby ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'resuby'
4
+
5
+ options = ARGV
6
+
7
+ if options.first == 'generate'
8
+ new_resume = Resuby.new
9
+ resume_data = File.join(Dir.pwd, 'resume.yaml')
10
+ resume = File.join(Dir.pwd, 'resume.html')
11
+ new_resume.read_source(resume_data)
12
+ new_resume.save_resume(resume)
13
+ new_resume.compile_styles
14
+ else
15
+ puts 'Specify an action to create your resume'
16
+ exit 1
17
+ end
@@ -0,0 +1,94 @@
1
+ html {
2
+ font-family: "Muli";
3
+ width: 215.9mm;
4
+ height: 279.4mm;
5
+ border: 1px solid red;
6
+ display: flex;
7
+ align-items: center;
8
+
9
+ @media print {
10
+ border: 0;
11
+ }
12
+ }
13
+
14
+ body, ul, h1, h2, h3 {
15
+ margin: 0;
16
+ font-weight: normal;
17
+ }
18
+
19
+ body {
20
+ padding: 0 1in;
21
+ font-size: 11pt;
22
+ }
23
+
24
+ .header {
25
+ text-align: center;
26
+ ul {
27
+ padding: 0;
28
+ }
29
+
30
+ li {
31
+ display: inline;
32
+ &:after {
33
+ content: '\2022';
34
+ padding-left: 5px;
35
+ }
36
+ }
37
+
38
+ li:last-child {
39
+ &:after {
40
+ content: '';
41
+ }
42
+ }
43
+ }
44
+
45
+ .section-header {
46
+ margin-top: 5px;
47
+ }
48
+
49
+ .section-profile {
50
+ margin-top: 5px;
51
+ margin-bottom: 0;
52
+ }
53
+
54
+ .section-row {
55
+ display: flex;
56
+ margin-top: 5px;
57
+ }
58
+
59
+ .section-desc {
60
+ flex: 1;
61
+ text-align: right;
62
+ padding-right: 10px;
63
+ border-right: 2px solid black;
64
+ ul {
65
+ list-style: none;
66
+ padding: 0;
67
+ }
68
+ }
69
+
70
+ .section-info {
71
+ flex: 5.5;
72
+ padding-left: 10px;
73
+ ul {
74
+ list-style: none;
75
+ padding: 0;
76
+ font-size: 10pt;
77
+
78
+ .info-title, .info-subtitle {
79
+ font-size: 11pt;
80
+ }
81
+
82
+ .info-subtitle {
83
+ font-style: italic;
84
+ }
85
+ }
86
+ }
87
+
88
+ .hr {
89
+ width: 100%;
90
+ height: 2px;
91
+ background-color: black;
92
+ display: block;
93
+ margin-top: 5px;
94
+ }
@@ -0,0 +1,56 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <link rel="stylesheet" href="css/main.css">
5
+ <link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
6
+ <meta charset="UTF-8">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
+ <title>Resume</title>
9
+ </head>
10
+
11
+ <body>
12
+ <div class="header">
13
+ <h1 class="name"><%=@name%></h1>
14
+ <ul>
15
+ <% for @info in @contact_info %>
16
+ <li class="contact-info"><%=@info%></li>
17
+ <% end %>
18
+ </ul>
19
+ </div>
20
+
21
+ <div>
22
+ <% if @profile %>
23
+ <h2 class="section-header">Profile</h2>
24
+ <span class="hr"></span>
25
+ <p class="section-profile">
26
+ <%=@profile%>
27
+ </p>
28
+ <% end %>
29
+
30
+ <% for @section in @sections.keys %>
31
+ <h2 class="section-header"><%=@section.split('_').map { |word| word.capitalize }.join(' ')%></h2>
32
+ <span class="hr"></span>
33
+ <% for @row in @sections[@section] %>
34
+ <div class="section-row">
35
+ <div class="section-desc">
36
+ <%=@row['desc']%>
37
+ </div>
38
+ <div class="section-info">
39
+ <ul>
40
+ <% if @row['title'] %>
41
+ <li class="info-title"><%=@row['title']%></li>
42
+ <% end %>
43
+ <% if @row['subtitle'] %>
44
+ <li class="info-subtitle"><%=@row['subtitle']%></li>
45
+ <% end %>
46
+ <% for @data in @row['data'] %>
47
+ <li><%=@data%></li>
48
+ <% end %>
49
+ </ul>
50
+ </div>
51
+ </div>
52
+ <% end %>
53
+ <% end %>
54
+ </div>
55
+ </body>
56
+ </html>
@@ -0,0 +1,3 @@
1
+ class Resuby
2
+ VERSION = '0.0.1'.freeze
3
+ end
data/lib/resuby.rb ADDED
@@ -0,0 +1,44 @@
1
+ require 'erb'
2
+ require 'yaml'
3
+ require 'sass'
4
+
5
+ class Resuby
6
+ attr_reader :name, :contact_info, :sections, :template, :profile
7
+
8
+ def initialize
9
+ @template = File.read(File.join(File.dirname(__FILE__), 'resuby/templates/resume.erb'))
10
+ end
11
+
12
+ def read_source(source)
13
+ puts "Reading in data from #{source}"
14
+ resume_data = YAML.load_file(source)
15
+ @name = resume_data['name']
16
+ @contact_info = resume_data['contact']
17
+ @profile = resume_data['profile']
18
+ @sections = resume_data.reject { |key, value| ['name', 'contact', 'profile'].include?(key) }
19
+ end
20
+
21
+ def render
22
+ ERB.new(self.template).result( binding )
23
+ end
24
+
25
+ def save_resume(file)
26
+ puts "Saving your resume at #{file}"
27
+ File.open(file, "w+") do |f|
28
+ f.write(render)
29
+ end
30
+ end
31
+
32
+ def compile_styles
33
+ options = {
34
+ cache: true,
35
+ syntax: :scss,
36
+ style: :compressed,
37
+ }
38
+
39
+ scss_file = File.join(File.dirname(__FILE__), 'resuby/css/main.scss')
40
+ render = Sass::Engine.new(File.read(scss_file), options).render
41
+ Dir.mkdir(File.join(Dir.pwd, 'css'), 0755) unless File.directory?(File.join(Dir.pwd, 'css'))
42
+ File.write(File.join(Dir.pwd, 'css/main.css'), render)
43
+ end
44
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: resuby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mario Lopez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.5.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 4.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 3.5.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 4.0.0
33
+ description: |-
34
+ Resuby generates an HTML and CSS resume that you can access with your
35
+ browser. You simply define the content of your resume in a YAML file, and
36
+ resuby will take care of creating a resume that you can use.
37
+ email: lopezrobles.mario@gmail.com
38
+ executables:
39
+ - resuby
40
+ extensions: []
41
+ extra_rdoc_files:
42
+ - README.md
43
+ files:
44
+ - README.md
45
+ - bin/resuby
46
+ - lib/resuby.rb
47
+ - lib/resuby/css/main.scss
48
+ - lib/resuby/templates/resume.erb
49
+ - lib/resuby/version.rb
50
+ homepage: https://github.com/mardotio/resuby
51
+ licenses:
52
+ - MIT
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project:
70
+ rubygems_version: 2.6.14
71
+ signing_key:
72
+ specification_version: 4
73
+ summary: Resume generator
74
+ test_files: []