resumerb 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rspec", "~> 2.1.0"
10
+ gem "yard", "~> 0.6.0"
11
+ gem "bundler", "~> 1.0.0"
12
+ gem "jeweler", "~> 1.5.1"
13
+ gem "rcov", ">= 0"
14
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Micah Wylde
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # Resume.rb
2
+
3
+ Resume.rb provides a DSL for creating resumes, with flexible
4
+ output. Currently supported is PDF (via LaTeX), but Markdown and HTML
5
+ backends are planned. Look in
6
+ [example/](https://github.com/mwylde/resume.rb/tree/master/example)
7
+ for a full example, which generates
8
+ [this pdf](https://github.com/mwylde/resume.rb/raw/master/example/my_resume.pdf).
data/Rakefile ADDED
@@ -0,0 +1,43 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "resumerb"
16
+ gem.homepage = "http://github.com/mwylde/resume.rb"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{Generates resumes in HTML and PDF (via LaTeX)}
19
+ gem.description = %Q{Resume provides a DSL for defining resume data, which can be rendered via various backends (LaTeX currently supported, with Markdown and HTML planned).}
20
+ gem.email = "mwylde@wesleyan.edu"
21
+ gem.authors = ["Micah Wylde"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ gem.add_runtime_dependency 'erubis', '> 2.6.5'
25
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
28
+
29
+ require 'rspec/core'
30
+ require 'rspec/core/rake_task'
31
+ RSpec::Core::RakeTask.new(:spec) do |spec|
32
+ spec.pattern = FileList['spec/**/*_spec.rb']
33
+ end
34
+
35
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
36
+ spec.pattern = 'spec/**/*_spec.rb'
37
+ spec.rcov = true
38
+ end
39
+
40
+ task :default => :spec
41
+
42
+ require 'yard'
43
+ YARD::Rake::YardocTask.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
Binary file
@@ -0,0 +1,96 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'resumerb'
3
+ require 'tempfile'
4
+ require 'date'
5
+
6
+ resume = Resume::Resume.new do |r|
7
+ r.name "Micah Wylde"
8
+ r.email "mwylde@wesleyan.edu"
9
+ r.address ["Wesleyan University",
10
+ "45 Wyllys Ave. #93026",
11
+ "Middletown, CT 06459"]
12
+ r.url "http://www.micahw.com/"
13
+ r.phone "(xxx) xxx-xxxx"
14
+
15
+ r.education do |ed|
16
+ ed.school "Wesleyan University"
17
+ ed.will_finish "May 2012"
18
+ ed.degree "B.A. in Computer Science"
19
+ ed.city "Middletown, CT"
20
+ end
21
+
22
+ r.education do |ed|
23
+ ed.school "Georgiana Bruce Kirby"
24
+ ed.finished "June 2008"
25
+ ed.degree "H.S."
26
+ ed.city "Santa Cruz, CA"
27
+ end
28
+
29
+ r.job do |j|
30
+ j.position "Researcher"
31
+ j.employer "Washington University CS Department REU"
32
+ j.city "St. Louis, MO"
33
+ j.date "Summer 2010"
34
+ j.description "Designed and evaluated real-time scheduling algorithms for utility-aware non-preemtable, stochastic task sets using machine learning in C++. Worked under Dr. Chris Gill."
35
+ end
36
+
37
+ r.job do |j|
38
+ j.position "Programming manager"
39
+ j.employer "Instructional Media Services, Wesleyan University"
40
+ j.city "Middletown, CT"
41
+ j.date "2008-present"
42
+ j.description "Maintained classroom multimedia technology and academic computing labs. Programmed and designed AMX-based integrated controllers and touch panels. Implemented a touchscreen-based classroomcontrol system in ruby and javascript. Managed other student programmers."
43
+ end
44
+
45
+ r.job do |j|
46
+ j.position "Crew chief"
47
+ j.employer "Center for the Arts, Wesleyan University"
48
+ j.city "Middletown, CT"
49
+ j.date "2008-present"
50
+ j.description "Live mixing for shows in Wesleyan's Crowell Concert and World Music halls. Managed other student sound techs."
51
+ end
52
+
53
+ r.job do |j|
54
+ j.position "Research assistant"
55
+ j.employer "Space Science, NASA Ames Research Center"
56
+ j.city "Moffet Field, CA"
57
+ j.date "Summer 2007"
58
+ j.description "Created theoretical models of interference, noise and compression artifacts in Cassini CIRS (Composite Infrared Spectrometer) data and wrote software to try to eliminate them, using IDL. Worked under Dr. Jeffrey Cuzzi of NASA Ames."
59
+ end
60
+
61
+ r.job do |j|
62
+ j.position "Web developer"
63
+ j.employer "Georgiana Bruce Kirby Preparatory School"
64
+ j.city "Santa Cruz, CA"
65
+ j.date "2007-2008"
66
+ j.description "Redesigned the school's website using CSS and XHTML using a custom Ruby on Rails content management system designed such that non-proficient computer users could maintain and update the site. Additionally, integrated with the Schoolweb student portal (see software projects, below)."
67
+ end
68
+
69
+ r.section do |s|
70
+ s.name "Skills"
71
+ s.bullets ["Ruby, Javascript, Haskell, Lisp, C, C++, Python, Java, PHP, HTML, CSS, LaTeX",
72
+ "Linux, OS X, Windows"]
73
+ end
74
+
75
+ r.section do |s|
76
+ s.name "Software Projects"
77
+ s.bullets ["Roomtrol (Ruby, Javascript, HTML5): Designed and built a classroom automation and control system with a Ruby backend and an HTML5 touchscreen interface written with Sproutcore and Node.js. Created a domain-specific language for writing drivers for classroom devices like projectors and video switchers. Allows professors to control multi-media equipment easily while improving remote support and monitoring. Currently in use at Wesleyan University (2009-present).",
78
+ "Schoolweb (Ruby, Javascript, XHTML, SQL): Wrote a Ruby on Rails based portal designed to ease communication between students, faculty, and parents at high schools. Features include user customizable widgets which can include polls, html, file uploads, and other information and a calendar customized to users’ clubs, courses, and grade. Integrates with school’s grading system, to allow for quick access to students’ grades. Allows teachers to input homework for viewing by students and parents. In use at Georgiana Bruce Kirby from 2007 to the present (2006-2008)."]
79
+ end
80
+
81
+ r.section do |s|
82
+ s.name "Research Interests"
83
+ s.bullets ["AI, crowd simulation, robot navigation, machine learning, real-time scheduling."]
84
+ end
85
+
86
+ end
87
+
88
+
89
+ dir = File.dirname(Tempfile.new("resume").path)
90
+ path = dir + "/resume.#{Date.today.strftime("%Y.%m.%d")}"
91
+
92
+ File.open("#{path}.tex", "w+") do |f|
93
+ f.write Resume::LatexBackend.render resume
94
+ end
95
+
96
+ system %Q$pdflatex -output-directory #{dir} #{path}.tex && mv #{path}.pdf .$
@@ -0,0 +1,100 @@
1
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
+ %% Document template and style file created by %%
3
+ %% Miklos Csuros. More information here: %%
4
+ %% http://www.iro.umontreal.ca/~csuros/latex.html %%
5
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6
+
7
+ \documentclass{/Users/mwylde/.rvm/gems/ruby-1.9.2-p0/gems/resume-0.1.0/lib/resume/templates/resume}
8
+
9
+ \renewcommand{\categoryfont}{\sc}
10
+
11
+ %
12
+ % set the space used for category titles here:
13
+ % use the same value for oddsidemargin and marginparwidth [the latter
14
+ % will be reset to account for marginparsep]
15
+ %
16
+ \setlength{\oddsidemargin}{1in}
17
+ \setlength{\marginparwidth}{1in}
18
+ %
19
+ % calculate other dimensions [textwidth and evensidemargin]
20
+ % in function of oddsidemargin and marginparwidth:
21
+ % would be nicer to put in the class file...
22
+ %
23
+ \addtolength{\marginparwidth}{-\marginparsep}
24
+ \setlength{\evensidemargin}{\oddsidemargin}
25
+ \setlength{\textwidth}{\paperwidth}
26
+ \addtolength{\textwidth}{-2in}
27
+ \addtolength{\textwidth}{-2\oddsidemargin}
28
+ \addtolength{\textwidth}{\marginparwidth}
29
+ \addtolength{\textwidth}{\marginparsep}
30
+ %
31
+ %
32
+ \setlength{\topmargin}{-0.5in}
33
+ %
34
+ %
35
+ \renewcommand{\labelcitem}{$\diamond$}
36
+ \renewcommand{\labelitemi}{$\cdot$}
37
+ \newcommand{\first}{$1^{\mbox{\scriptsize st}}$\ }
38
+ \newcommand{\second}{$2^{\mbox{\scriptsize nd}}$\ }
39
+ \newcommand{\third}{$3^{\mbox{\scriptsize rd}}$\ }
40
+
41
+ \author{Micah Wylde}
42
+ % ------ Address --------------------------------------------------------
43
+
44
+ \address{Wesleyan University\\
45
+ 45 Wyllys Ave. \#93026\\
46
+ Middletown, CT 06459 \\
47
+ (xxx) xxx-xxxx \\
48
+ }{
49
+ mwylde@wesleyan.edu \\
50
+ http://micahw.com/}
51
+
52
+ \begin{document}
53
+ \maketitle
54
+
55
+ % ------- Education ---------------------------------------------------
56
+
57
+ \begin{category}{Education}
58
+ \citem{Wesleyan University}, Middletown, CT
59
+ \\B.A. in Computer Science,
60
+ expected graduation: May 2012
61
+ \citem{Georgiana Bruce Kirby}, Santa Cruz, CA
62
+
63
+ June 2008
64
+ \end{category}
65
+
66
+ % -------- Work experience --------------------------------------------
67
+
68
+ \begin{category}{Work \\experience}
69
+
70
+ \citem{Researcher}, Washington University CS Dept. REU (Summer 2010)\\
71
+ Designed and evaluated real-time scheduling algorithms for utility-aware non-preemtable, stochastic task sets using machine learning techniques in C++. Worked under Dr. Chris Gill.
72
+ \citem{Programming manager}, Instructional Media Services, Wesleyan University (2008-present)\\
73
+ Maintained classroom multimedia technology and academic computing labs. Programmed and designed AMX-based integrated controllers and touch panels. Implemented a touchscreen-based classroomcontrol system in ruby and javascript.
74
+ \citem{Crew Chief}, Center for the Arts, Wesleyan University (2008-present)\\
75
+ Live mixing for shows in Wesleyan's Crowell Concert and World Music halls. Managed other student sound techs.
76
+ \citem{Researcher}, Space Science, NASA Ames Research Center (Summer 2007)\\
77
+ Created theoretical models for interference, noise and compression artifacts in Cassini CIRS (Composite Infrared Spectrometer) data, and wrote software to try to eliminate them, using IDL. Worked under Dr. Jeffrey Cuzzi of NASA Ames.
78
+ \citem{Web Developer}, Georgiana Bruce Kirby Preparatory School (2007-2008)\\
79
+ Redesigned the school’s website using CSS and XHTML, built on a heavily-modified RubyOnRails content management system, with an administrative side designed such that non-proficient computer users could maintain and update the site. Additionally, integrated with the Schoolweb student portal.
80
+ \end{category}
81
+
82
+ % ------- Custom Sections --------------------------------------------
83
+
84
+ \begin{category}{Skills}
85
+ \citembullet Ruby, Javascript, Haskell, Lisp, C, C++, Python, Java, PHP, \LaTeX
86
+ \citembullet Linux, OS X, Windows
87
+
88
+ \end{category}
89
+ \begin{category}{Research}
90
+ \citembullet AI, crowd simulation, robot navigation, machine learning, real-time scheduling.
91
+
92
+ \end{category}
93
+ \begin{category}{Software Projects}
94
+ \citembullet Roomtrol (Ruby, Javascript, HTML5): classroom automation and control system with a ruby backend and HTML5 touchscreen interface built with Sproutcore and Node.js. Allows professors to control all multi-media equipment easily, while improving remote support and monitoring. Currently in use at Wesleyan University.
95
+ \citembullet Schoolweb (Ruby, Javascript, XHTML, SQL): RubyOnRails based portal designed to ease communication be- tween students, faculty, and parents at high schools. Features include user customizable “widgets” which can have polls, html, file uploads, or information about sports teams or theater produ
96
+ ctions and a calendar customized to users’ clubs, courses, and grade. Integrates with school’s grading system, to allow for quick access to students’ grades. Allows for teachers to input homework for viewing by students and parents. In use at Georgiana Bruce Kirby from 2007 to the present.
97
+
98
+ \end{category}
99
+
100
+ \end{document}
@@ -0,0 +1,71 @@
1
+ module Resume
2
+ class LatexBackend
3
+ class << self
4
+ ESCAPING_RULES = {
5
+ "&" => '\&',
6
+ # "TeX" => '\TeX',
7
+ "LaTeX" => '\LaTeX',
8
+ "$" => '\textdollar',
9
+ "#" => '\#',
10
+ "%" => '\%',
11
+ "^" => '\^',
12
+ "_" => '\_',
13
+ "{" => '\{',
14
+ "}" => '\}',
15
+ "<" => '\textless',
16
+ ">" => '\textgreater',
17
+ "~" => '\textasciitilde'
18
+ }
19
+
20
+ # Returns a LaTeX document for the supplied resume and options
21
+ # @param [resume] The resume information
22
+ # @param [Hash] options Options
23
+ # @return [String] A LaTeX document
24
+ def render resume
25
+ context = {:resume_class => File.dirname(__FILE__) + "/templates/resume"}
26
+
27
+ vars = [:about, :schools, :jobs, :sections]
28
+ vars.each do |name|
29
+ var = nil
30
+ if values = resume.send(name)
31
+ if values.is_a? Array
32
+ var = []
33
+ values.each do |a|
34
+ var << {}
35
+ a.each do |k, v|
36
+ var[-1][k] = escape v
37
+ end
38
+ end
39
+ else
40
+ var = {}
41
+ values.each do |k, v|
42
+ var[k] = escape v
43
+ end
44
+ end
45
+ context[name] = var
46
+ end
47
+ end
48
+ template = File.open(File.dirname(__FILE__) + "/templates/latex.tex.erb").read
49
+
50
+ Erubis::Eruby.new(template).evaluate(context)
51
+ end
52
+
53
+ private
54
+ def escape s
55
+ ESCAPING_RULES.each do |from, to|
56
+ if s.is_a? Array
57
+ s.map{|x| x.gsub!(from, to)}
58
+ else
59
+ s.gsub!(from, to)
60
+ end
61
+ end
62
+ s
63
+ end
64
+
65
+ class BindingObject
66
+ attr_accessor :about, :schools, :jobs, :sections
67
+ def get_binding; binding; end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,51 @@
1
+ module Resume
2
+ class PlainTextBackend
3
+ class << self
4
+ RN = "\r\n"
5
+ def render r
6
+ result = ""
7
+
8
+ # Name
9
+ result << r.about[:name].upcase << RN << RN
10
+
11
+ # Adress
12
+ result << r.about[:address].join(RN) << RN
13
+ result << r.about[:email] << RN
14
+ result << r.about[:phone] << RN << RN
15
+
16
+ # Education
17
+ result << "EDUCATION" << RN << RN
18
+ r.schools.each do |ed|
19
+ result << ed[:school] << ", " << ed[:city] << RN
20
+ result << ed[:degree] << ", " if ed[:degree]
21
+ result << (ed[:will_finish] ? "expected graduation: #{ed[:will_finish]}" :
22
+ ed[:finished]) << RN << RN
23
+ end
24
+
25
+ # Jobs
26
+ result << "WORK EXPERIENCE" << RN << RN
27
+ r.jobs.each do |job|
28
+ date = job[:date] ? "(#{job[:date]})" : ""
29
+ result << job[:position] << ", " << job[:employer] << date << RN
30
+ result << " " << job[:description] << RN << RN
31
+ end
32
+
33
+ # Sections
34
+ r.sections.each do |sec|
35
+ result << sec[:name].upcase << RN << RN
36
+ if sec[:text]
37
+ result << sec[:text] << RN
38
+ end
39
+ if sec[:bullets]
40
+ sec[:bullets].each do |b|
41
+ result << " - " << b << RN
42
+ end
43
+ end
44
+ result << RN
45
+ end
46
+
47
+ result
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,87 @@
1
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
+ %% Document template and style file created by %%
3
+ %% Miklos Csuros. More information here: %%
4
+ %% http://www.iro.umontreal.ca/~csuros/latex.html %%
5
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6
+
7
+ \documentclass{<%= @resume_class %>}
8
+
9
+ \renewcommand{\categoryfont}{\sc}
10
+
11
+ %
12
+ % set the space used for category titles here:
13
+ % use the same value for oddsidemargin and marginparwidth [the latter
14
+ % will be reset to account for marginparsep]
15
+ %
16
+ \setlength{\oddsidemargin}{1in}
17
+ \setlength{\marginparwidth}{1in}
18
+ %
19
+ % calculate other dimensions [textwidth and evensidemargin]
20
+ % in function of oddsidemargin and marginparwidth:
21
+ % would be nicer to put in the class file...
22
+ %
23
+ \addtolength{\marginparwidth}{-\marginparsep}
24
+ \setlength{\evensidemargin}{\oddsidemargin}
25
+ \setlength{\textwidth}{\paperwidth}
26
+ \addtolength{\textwidth}{-2in}
27
+ \addtolength{\textwidth}{-2\oddsidemargin}
28
+ \addtolength{\textwidth}{\marginparwidth}
29
+ \addtolength{\textwidth}{\marginparsep}
30
+ %
31
+ %
32
+ \setlength{\topmargin}{-0.5in}
33
+ %
34
+ %
35
+ \renewcommand{\labelcitem}{$\diamond$}
36
+ \renewcommand{\labelitemi}{$\cdot$}
37
+ \newcommand{\first}{$1^{\mbox{\scriptsize st}}$\ }
38
+ \newcommand{\second}{$2^{\mbox{\scriptsize nd}}$\ }
39
+ \newcommand{\third}{$3^{\mbox{\scriptsize rd}}$\ }
40
+
41
+ \author{<%= @about[:name] %>}
42
+ % ------ Address --------------------------------------------------------
43
+
44
+ \address{<%= @about[:address].join("\\\\ \n") %> \\
45
+ <%= @about[:phone] %> \\
46
+ }{
47
+ <%= @about[:email] %> \\
48
+ <%= @about[:url] %>}
49
+
50
+ \begin{document}
51
+ \maketitle
52
+
53
+ % ------- Education ---------------------------------------------------
54
+
55
+ \begin{category}{Education}
56
+ <% @schools.each do |ed| %>
57
+ \citem{<%= ed[:school] %>}, <%= ed[:city] %>
58
+ <% if ed[:degree] %>\\<%= ed[:degree] %>,<% end %>
59
+ <%= ed[:will_finish] ? "expected graduation: #{ed[:will_finish]}" : ed[:finished] %>
60
+ <% end %>
61
+ \end{category}
62
+
63
+ % -------- Work experience --------------------------------------------
64
+
65
+ \begin{category}{Work \\experience}
66
+
67
+ <% @jobs.each do |job| %>
68
+ \citem{<%= job[:position] %>}, <%= job[:employer] %> (<%= job[:date] %>)\\
69
+ <%= job[:description] %>
70
+ <% end %>
71
+ \end{category}
72
+
73
+ % ------- Custom Sections --------------------------------------------
74
+
75
+ <% @sections.each do |s| %>
76
+ \begin{category}{<%= s[:name] %>}
77
+ <% if s[:text] %>
78
+ \citemnobullet <%= s[:text] %>
79
+ <% end %>
80
+ <% if s[:bullets] %>
81
+ <%= s[:bullets].map{|b| '\citembullet ' + b}.join("\n") %>
82
+ <% end %>
83
+
84
+ \end{category}
85
+ <% end %>
86
+
87
+ \end{document}
@@ -0,0 +1,155 @@
1
+ % resume class v1.1
2
+ % 02/07/1997
3
+ % written by Miklos Csuros csuros@cs.yale.edu
4
+ %
5
+ % features
6
+ %
7
+ % 1 \address[2] command for home and office address
8
+ %
9
+ % 2 category environment for resume sections
10
+ %
11
+ % \citem[1] for items of the section with argument emphasized
12
+ % \citemnobullet for items of the section without a bullet
13
+ % \citembullet for items of the section with bullet & no emphasis
14
+ %
15
+
16
+ \NeedsTeXFormat{LaTeX2e}
17
+ \ProvidesClass{resume}[1997/02/07 v1.1 resume class]
18
+
19
+ \newif\if@wideadress\@wideadressfalse
20
+ \DeclareOption{wideadress}{\@wideadresstrue}
21
+ \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
22
+ \ProcessOptions
23
+ \LoadClass{article}
24
+
25
+
26
+
27
+ % -------------------------------------------------------
28
+ % The following definitions can be changed in the LaTeX
29
+ % file for a different look but the same structure. The
30
+ % rest of this file defines the structure and the
31
+ % commands.
32
+ % -------------------------------------------------------
33
+
34
+ \newcommand{\titlenamefont}{\bf\LARGE} % the font used to print the name
35
+ % on the top of the 1st page
36
+ \newcommand{\categoryfont}{\sl} % font used to print the category
37
+ % names
38
+ \newcommand{\labelcitem}{\labelitemi} % the bullet produced by \citem or
39
+ % \citembullet
40
+ \reversemarginpar % so that category names are on the
41
+ % left for one-sided document and
42
+ % left-right-left-... for two-sided
43
+
44
+ % -------------------------------------------------------
45
+ % - changing lengths
46
+ % -------------------------------------------------------
47
+
48
+ \setlength{\topmargin}{0in}
49
+ \setlength{\textheight}{9.0in}
50
+ \setlength{\oddsidemargin}{1.5in} % left margin on first page
51
+ \setlength{\evensidemargin}{\oddsidemargin}
52
+
53
+ \newlength{\titlewidth}
54
+ \newlength{\addresswidth}
55
+ % -------------------------------------------------------
56
+ % - new commands
57
+ % -------------------------------------------------------
58
+
59
+ %%%%%%% \address
60
+ \gdef\@addressA{\ClassWarning{resume}{%
61
+ No address given.\MessageBreak
62
+ Use \protect\address.}}
63
+ \newcommand{\address}[2]{\gdef\@addressA{#1}\gdef\@addressB{#2}}
64
+
65
+ %%%%%%% \author
66
+ \gdef\@author{\ClassError{resume}{%
67
+ No author given.}{%
68
+ Use \protect\author\space to specify it.}}
69
+
70
+ %%%%%% category environment
71
+ \newif{\if@firstitem}
72
+ \newenvironment{category}[1]%
73
+ {\@firstitemtrue
74
+ \def\makecategorytitle{%
75
+ \marginpar{\categoryfont\raggedright #1}}
76
+ \par
77
+ \begin{list}{}{%
78
+ \setlength{\leftmargin}{0in} % no extra left margin before bullets
79
+ \setlength{\parsep}{0in}
80
+ }}
81
+ {\end{list}}
82
+
83
+
84
+ %%%%%%% \citem
85
+ \newcommand*{\citem}[1]{%
86
+ \if@firstitem
87
+ {\item[\labelcitem]{\bf #1}\makecategorytitle}%
88
+ \else
89
+ {\item[\labelcitem]{\bf #1}}%
90
+ \fi
91
+ \@firstitemfalse}
92
+
93
+ %%%%%%% \citemnobullet
94
+ \newcommand{\citemnobullet}{%
95
+ \if@firstitem
96
+ \item[] \leavevmode\makecategorytitle
97
+ \else
98
+ \item[]
99
+ \fi
100
+ \@firstitemfalse}
101
+
102
+ %%%%%%% \citembullet
103
+ \newcommand{\citembullet}{%
104
+ \if@firstitem
105
+ \item[\labelcitem] \leavevmode\makecategorytitle
106
+ \else
107
+ \item[\labelcitem]
108
+ \fi
109
+ \@firstitemfalse}
110
+
111
+ %%%%%%% \maketitle
112
+ \renewcommand{\maketitle}{%
113
+ \setlength{\titlewidth}{\textwidth}
114
+ \setlength{\addresswidth}{.5\textwidth}
115
+ \begingroup
116
+ \if@twocolumn
117
+ \ifnum \col@number=\@ne
118
+ \@makeresumetitle
119
+ \else
120
+ \twocolumn[\@makeresumetitle]%
121
+ \fi
122
+ \else
123
+ \newpage
124
+ \global\@topnum\z@ % Prevents figures from going at top of page.
125
+ \@makeresumetitle
126
+ \fi
127
+ \thispagestyle{empty}
128
+ \endgroup
129
+ \if@twoside
130
+ \markboth{\@author}{\@author}
131
+ \else
132
+ \markright{\hfill\@author\hfill}
133
+ \fi
134
+ \pagestyle{myheadings}
135
+ \renewcommand{\thepage}{} % because only the name is
136
+ % needed in the heading and no pagenumbers
137
+
138
+ \setcounter{footnote}{0}%
139
+ \let\thanks\relax
140
+ \let\maketitle\relax\let\@makeresumetitle\relax
141
+ \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
142
+
143
+ \def\@makeresumetitle{%
144
+ \newpage
145
+ \null
146
+ \def\@moveleft{\hspace*{-\marginparwidth}\hspace*{-\marginparsep}}
147
+ \@moveleft\makebox[\titlewidth]{\titlenamefont\@author}\\
148
+ \@moveleft
149
+ \parbox[t]{\addresswidth}{\begin{flushleft}\@addressA\end{flushleft}}\hfill%
150
+ \parbox[t]{\addresswidth}{\begin{flushright}\@addressB\end{flushright}}
151
+ \par
152
+ \vskip 1.5em}
153
+
154
+ \endinput
155
+
data/lib/resume.rb ADDED
@@ -0,0 +1,81 @@
1
+ libdir = File.dirname(__FILE__)
2
+ $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
3
+
4
+ require 'erubis'
5
+ require 'resume/latex'
6
+ require 'resume/plain_text'
7
+
8
+ # Ruby class that lets you define resumes that can be rendered
9
+ # to various backends. Currently planned is Markdown and LaTex,
10
+ # which give HTML and PDF when compiled with their respective
11
+ # tools.
12
+ #
13
+ module Resume
14
+ class Resume
15
+ attr_reader :about, :schools, :jobs, :sections
16
+ # Starts a resume definition block
17
+ def initialize &block
18
+ rh = ResumeHandler.new
19
+ block.arity < 1 ? rh.instance_eval(&block) : block.call(rh)
20
+ @about = rh.about
21
+ @schools = rh.schools
22
+ @jobs = rh.jobs
23
+ @sections = rh.sections
24
+ end
25
+
26
+ private
27
+ # @private
28
+ class ResumeHandler
29
+ attr_reader :about, :schools, :jobs, :sections
30
+
31
+ def initialize
32
+ @about = {}
33
+ @schools = []
34
+ @jobs = []
35
+ @sections = []
36
+
37
+ [:name, :email, :address, :url, :phone].each do |field|
38
+ self.class.class_eval do
39
+ define_method field do |value|
40
+ @about[field] = value
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ def education &block
47
+ sh = sub_handler [:school, :finished, :will_finish, :degree, :city]
48
+ block.arity < 1 ? sh.instance_eval(&block) : block.call(sh)
49
+ @schools << sh.data
50
+ end
51
+
52
+ def job &block
53
+ sh = sub_handler [:position, :employer, :city, :date, :description]
54
+ block.arity < 1 ? sh.instance_eval(&block) : block.call(sh)
55
+ @jobs << sh.data
56
+ end
57
+
58
+ def section &block
59
+ sh = sub_handler [:name, :text, :bullets]
60
+ block.arity < 1 ? sh.instance_eval(&block) : block.call(sh)
61
+ @sections << sh.data
62
+ end
63
+
64
+ private
65
+ # @private
66
+ def sub_handler fields
67
+ s = Class.new
68
+ s.class_eval do
69
+ attr_reader :data
70
+ def initialize; @data = {}; end
71
+ fields.each do |field|
72
+ define_method field do |value|
73
+ @data[field] = value
74
+ end
75
+ end
76
+ end
77
+ s.new
78
+ end
79
+ end
80
+ end
81
+ end
data/resume.gemspec ADDED
@@ -0,0 +1,76 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{resume}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Micah Wylde"]
12
+ s.date = %q{2011-01-07}
13
+ s.description = %q{Resume provides a DSL for defining resume data, which can be rendered via various backends (LaTeX currently supported, with Markdown and HTML planned).}
14
+ s.email = %q{mwylde@wesleyan.edu}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rspec",
22
+ "Gemfile",
23
+ "LICENSE.txt",
24
+ "README.md",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "example/my_resume.pdf",
28
+ "example/my_resume.rb",
29
+ "example/my_resume.tex",
30
+ "lib/resume.rb",
31
+ "lib/resume/latex.rb",
32
+ "lib/resume/plain_text.rb",
33
+ "lib/resume/templates/latex.tex.erb",
34
+ "lib/resume/templates/resume.cls",
35
+ "spec/resume.rb_spec.rb",
36
+ "spec/spec_helper.rb"
37
+ ]
38
+ s.homepage = %q{http://github.com/mwylde/resume.rb}
39
+ s.licenses = ["MIT"]
40
+ s.require_paths = ["lib"]
41
+ s.rubygems_version = %q{1.3.7}
42
+ s.summary = %q{Generates resumes in HTML and PDF (via LaTeX)}
43
+ s.test_files = [
44
+ "spec/resume.rb_spec.rb",
45
+ "spec/spec_helper.rb"
46
+ ]
47
+
48
+ if s.respond_to? :specification_version then
49
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
50
+ s.specification_version = 3
51
+
52
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
+ s.add_development_dependency(%q<rspec>, ["~> 2.1.0"])
54
+ s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
55
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
56
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
57
+ s.add_development_dependency(%q<rcov>, [">= 0"])
58
+ s.add_runtime_dependency(%q<erubis>, ["> 2.6.5"])
59
+ else
60
+ s.add_dependency(%q<rspec>, ["~> 2.1.0"])
61
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
62
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
63
+ s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
64
+ s.add_dependency(%q<rcov>, [">= 0"])
65
+ s.add_dependency(%q<erubis>, ["> 2.6.5"])
66
+ end
67
+ else
68
+ s.add_dependency(%q<rspec>, ["~> 2.1.0"])
69
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
70
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
71
+ s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
72
+ s.add_dependency(%q<rcov>, [">= 0"])
73
+ s.add_dependency(%q<erubis>, ["> 2.6.5"])
74
+ end
75
+ end
76
+
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Resume.rb" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'resume.rb'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
metadata ADDED
@@ -0,0 +1,171 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: resumerb
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
10
+ platform: ruby
11
+ authors:
12
+ - Micah Wylde
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-07 00:00:00 -08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 1
30
+ - 0
31
+ version: 2.1.0
32
+ type: :development
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: yard
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ - 6
45
+ - 0
46
+ version: 0.6.0
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: bundler
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 1
59
+ - 0
60
+ - 0
61
+ version: 1.0.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: jeweler
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ~>
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 1
74
+ - 5
75
+ - 1
76
+ version: 1.5.1
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: rcov
82
+ requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: *id005
93
+ - !ruby/object:Gem::Dependency
94
+ name: erubis
95
+ requirement: &id006 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">"
99
+ - !ruby/object:Gem::Version
100
+ segments:
101
+ - 2
102
+ - 6
103
+ - 5
104
+ version: 2.6.5
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: *id006
108
+ description: Resume provides a DSL for defining resume data, which can be rendered via various backends (LaTeX currently supported, with Markdown and HTML planned).
109
+ email: mwylde@wesleyan.edu
110
+ executables: []
111
+
112
+ extensions: []
113
+
114
+ extra_rdoc_files:
115
+ - LICENSE.txt
116
+ - README.md
117
+ files:
118
+ - .document
119
+ - .rspec
120
+ - Gemfile
121
+ - LICENSE.txt
122
+ - README.md
123
+ - Rakefile
124
+ - VERSION
125
+ - example/my_resume.pdf
126
+ - example/my_resume.rb
127
+ - example/my_resume.tex
128
+ - lib/resume.rb
129
+ - lib/resume/latex.rb
130
+ - lib/resume/plain_text.rb
131
+ - lib/resume/templates/latex.tex.erb
132
+ - lib/resume/templates/resume.cls
133
+ - resume.gemspec
134
+ - spec/resume.rb_spec.rb
135
+ - spec/spec_helper.rb
136
+ has_rdoc: true
137
+ homepage: http://github.com/mwylde/resume.rb
138
+ licenses:
139
+ - MIT
140
+ post_install_message:
141
+ rdoc_options: []
142
+
143
+ require_paths:
144
+ - lib
145
+ required_ruby_version: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ hash: -3560557437108115605
151
+ segments:
152
+ - 0
153
+ version: "0"
154
+ required_rubygems_version: !ruby/object:Gem::Requirement
155
+ none: false
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ segments:
160
+ - 0
161
+ version: "0"
162
+ requirements: []
163
+
164
+ rubyforge_project:
165
+ rubygems_version: 1.3.7
166
+ signing_key:
167
+ specification_version: 3
168
+ summary: Generates resumes in HTML and PDF (via LaTeX)
169
+ test_files:
170
+ - spec/resume.rb_spec.rb
171
+ - spec/spec_helper.rb