cajun-resume 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +49 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/bin/resume +51 -0
- data/examples/ruby_coder.rb +10 -0
- data/lib/pdf_printer.rb +67 -0
- data/lib/resume.rb +157 -0
- data/resume.gemspec +50 -0
- data/spec/resume_spec.rb +270 -0
- metadata +67 -0
data/.document
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 cajun
|
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.rdoc
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
== The Ruby Based Ruby Resume' Generator
|
2
|
+
This is a fun little project for defining your resume in Ruby. You say your a Rubyist, but is your resume written in a DSL? I didn't think so! Using the Ruby Resume' Generator, you too can be a total geek!
|
3
|
+
|
4
|
+
== Example
|
5
|
+
# ruby_coder.rb
|
6
|
+
class RubyCoder
|
7
|
+
include Resume
|
8
|
+
contact :email => %w(ruby coder net), :phone => %w(800 444 3333)
|
9
|
+
attended "XYZU", :in => "Gemology", :with => "PHD", :graduated => "1999"
|
10
|
+
worked :at => "Gem Cutting, Inc.", :description => "cut all kinds of rubies", :position => "cuter", :tenure => 2008
|
11
|
+
built %w(ruby-cuts.tv)
|
12
|
+
using %w(ruby haml datamapper)
|
13
|
+
practicing %w(agile bdd juggling)
|
14
|
+
story %w(I'm a ruby coder of some skill and whatnot. You should hire be because I'm cool.)
|
15
|
+
end
|
16
|
+
|
17
|
+
Then, with this gem installed you can pop out a slick little resume'
|
18
|
+
|
19
|
+
> resume ruby_coder.rb
|
20
|
+
|
21
|
+
Ruby Coder
|
22
|
+
ruby@coder.net 800.444.3333
|
23
|
+
--------------------------------------------------------------------------------
|
24
|
+
Attended XYZU Gemology for PHD
|
25
|
+
--------------------------------------------------------------------------------
|
26
|
+
Worked at Gem Cutting, Inc. as a cuter 2008
|
27
|
+
cut all kinds of rubies
|
28
|
+
--------------------------------------------------------------------------------
|
29
|
+
Sites
|
30
|
+
ruby-cuts.tv
|
31
|
+
--------------------------------------------------------------------------------
|
32
|
+
Technologies
|
33
|
+
ruby - haml - datamapper
|
34
|
+
--------------------------------------------------------------------------------
|
35
|
+
Practices
|
36
|
+
agile - bdd - juggling
|
37
|
+
--------------------------------------------------------------------------------
|
38
|
+
I'm a ruby coder of some skill and whatnot. You should hire be because I'm cool.
|
39
|
+
|
40
|
+
You can also write a PDF file by supplying the -pdf parameter
|
41
|
+
|
42
|
+
> resume examples/ruby_coder.rb -pdf
|
43
|
+
Printing PDF to RubyCoder.pdf
|
44
|
+
|
45
|
+
== Notes
|
46
|
+
Feel free to leave any and all of the various sections out. You can call most methods multiple times and the data
|
47
|
+
will simply get added to the list of items.
|
48
|
+
|
49
|
+
If you want a different format, feel free to hack away. If you can't you probably shouldn't be using this anyway.
|
data/Rakefile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "resume"
|
8
|
+
gem.summary = %Q{cool resume}
|
9
|
+
gem.email = "zac@kleinpeter.org"
|
10
|
+
gem.homepage = "http://github.com/cajun/resume"
|
11
|
+
gem.authors = ["cajun"]
|
12
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
13
|
+
end
|
14
|
+
|
15
|
+
rescue LoadError
|
16
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
17
|
+
end
|
18
|
+
|
19
|
+
require 'spec/rake/spectask'
|
20
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
21
|
+
spec.libs << 'lib' << 'spec'
|
22
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
23
|
+
end
|
24
|
+
|
25
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
26
|
+
spec.libs << 'lib' << 'spec'
|
27
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
28
|
+
spec.rcov = true
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
task :default => :spec
|
33
|
+
|
34
|
+
require 'rake/rdoctask'
|
35
|
+
Rake::RDocTask.new do |rdoc|
|
36
|
+
if File.exist?('VERSION.yml')
|
37
|
+
config = YAML.load(File.read('VERSION.yml'))
|
38
|
+
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
39
|
+
else
|
40
|
+
version = ""
|
41
|
+
end
|
42
|
+
|
43
|
+
rdoc.rdoc_dir = 'rdoc'
|
44
|
+
rdoc.title = "foo #{version}"
|
45
|
+
rdoc.rdoc_files.include('README*')
|
46
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.1
|
data/bin/resume
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- mode: ruby -*-
|
3
|
+
|
4
|
+
require 'optparse'
|
5
|
+
require 'open-uri'
|
6
|
+
require File.join(File.dirname(__FILE__), '../lib/resume')
|
7
|
+
require File.join(File.dirname(__FILE__), '../lib/pdf_printer')
|
8
|
+
|
9
|
+
options = {}
|
10
|
+
opts = OptionParser.new do |opts|
|
11
|
+
opts.banner = "Usage: resume [options] <resume location>"
|
12
|
+
|
13
|
+
opts.on("-pdf", "Create a PDF") do |pdf|
|
14
|
+
options[:pdf] = pdf
|
15
|
+
end
|
16
|
+
|
17
|
+
opts.on("-ruby", "Shows the Ruby code to create this resume") do |ruby|
|
18
|
+
options[:ruby] = ruby
|
19
|
+
end
|
20
|
+
|
21
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
22
|
+
puts opts
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
opts.parse!
|
26
|
+
opts
|
27
|
+
end
|
28
|
+
|
29
|
+
if(ARGV.last =~ /^-/ or ARGV.empty?)
|
30
|
+
puts opts
|
31
|
+
puts "Resume to print must be supplied."
|
32
|
+
exit
|
33
|
+
end
|
34
|
+
|
35
|
+
resume_class_string = open(ARGV.last).read
|
36
|
+
eval(resume_class_string)
|
37
|
+
resume_class_name = resume_class_string.match(/class\s(.*)/)[1]
|
38
|
+
resume_class = eval("#{resume_class_name}.new.class")
|
39
|
+
|
40
|
+
if(options[:ruby])
|
41
|
+
puts resume_class_string
|
42
|
+
end
|
43
|
+
|
44
|
+
if(options[:pdf])
|
45
|
+
printer = PDFPrinter.new(resume_class)
|
46
|
+
puts "Printing PDF to #{printer.filename}"
|
47
|
+
printer.print
|
48
|
+
else
|
49
|
+
resume_class.pretty_print
|
50
|
+
end
|
51
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class RubyCoder
|
2
|
+
include Resume
|
3
|
+
contact :email => %w(ruby coder net), :phone => %w(800 444 3333)
|
4
|
+
attended "XYZU", :in => "Gemology", :with => "PHD", :graduated => "1999"
|
5
|
+
worked :at => "Gem Cutting, Inc.", :description => "cut all kinds of rubies", :position => "cuter", :tenure => 2008
|
6
|
+
built %w(ruby-cuts.tv)
|
7
|
+
using %w(ruby haml datamapper)
|
8
|
+
practicing %w(agile bdd juggling)
|
9
|
+
story %w(I'm a ruby coder of some skill and whatnot. You should hire be because I'm cool.)
|
10
|
+
end
|
data/lib/pdf_printer.rb
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'prawn'
|
3
|
+
require 'prawn/layout'
|
4
|
+
|
5
|
+
class PDFPrinter
|
6
|
+
attr_accessor :resume
|
7
|
+
|
8
|
+
def initialize(resume)
|
9
|
+
self.resume = resume
|
10
|
+
end
|
11
|
+
|
12
|
+
def filename
|
13
|
+
"#{self.resume.name}.pdf"
|
14
|
+
end
|
15
|
+
|
16
|
+
def print
|
17
|
+
resume = self.resume
|
18
|
+
Prawn::Document.generate filename do
|
19
|
+
font "Helvetica"
|
20
|
+
header margin_box.top_left do
|
21
|
+
text resume.my_name, :align => :center, :size => 32
|
22
|
+
text resume.print_contact, :align => :center
|
23
|
+
stroke_horizontal_rule
|
24
|
+
end
|
25
|
+
move_down(50)
|
26
|
+
if(resume.has_schools?)
|
27
|
+
text "Education", :align => :right, :style => :bold_italic
|
28
|
+
text resume.print_schools, :align => :left
|
29
|
+
stroke_horizontal_rule
|
30
|
+
end
|
31
|
+
if(resume.has_jobs?)
|
32
|
+
text "Employment", :align => :right, :style => :bold_italic
|
33
|
+
text resume.print_jobs, :align => :left
|
34
|
+
stroke_horizontal_rule
|
35
|
+
end
|
36
|
+
|
37
|
+
if(resume.has_applications?)
|
38
|
+
text "Sites", :align => :right, :style => :bold_italic
|
39
|
+
text resume.print_array(resume.applications), :align => :center
|
40
|
+
stroke_horizontal_rule
|
41
|
+
end
|
42
|
+
|
43
|
+
if(resume.has_technologies?)
|
44
|
+
text "Technologies", :align => :right, :style => :bold_italic
|
45
|
+
text resume.print_array(resume.technologies), :align => :center
|
46
|
+
stroke_horizontal_rule
|
47
|
+
end
|
48
|
+
|
49
|
+
if(resume.has_practices?)
|
50
|
+
text "Practices", :align => :right, :style => :bold_italic
|
51
|
+
text resume.print_array(resume.practices), :align => :center
|
52
|
+
stroke_horizontal_rule
|
53
|
+
end
|
54
|
+
|
55
|
+
if(resume.has_story?)
|
56
|
+
text resume.story_text
|
57
|
+
end
|
58
|
+
|
59
|
+
footer margin_box.bottom_left do
|
60
|
+
font "Courier"
|
61
|
+
fill_color "999999"
|
62
|
+
|
63
|
+
text "gem install cajun-resume; resume #{$*}", :align => :center, :size => 8
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
data/lib/resume.rb
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'facets/ansicode'
|
3
|
+
module Resume
|
4
|
+
|
5
|
+
def self.included(base)
|
6
|
+
base.extend(ANSICode)
|
7
|
+
base.extend(ClassMethods)
|
8
|
+
(base.methods - Object.methods).each do |method|
|
9
|
+
base.send(method, Array.new) if method =~ /=$/
|
10
|
+
end
|
11
|
+
base.contact_info = Hash.new
|
12
|
+
base.width = 80 # default width
|
13
|
+
end
|
14
|
+
|
15
|
+
module ClassMethods
|
16
|
+
attr_accessor :contact_info, :schools, :jobs, :applications, :technologies, :practices, :width, :story_text
|
17
|
+
|
18
|
+
def my_name
|
19
|
+
self.to_s.gsub(/([A-Z]+)([A-Z][a-z])/,'\1 \2').gsub(/([a-z\d])([A-Z])/,'\1 \2')
|
20
|
+
end
|
21
|
+
|
22
|
+
def contact(opts = {})
|
23
|
+
if(email = opts[:email])
|
24
|
+
self.contact_info[:email] = email.is_a?(Array) ? email.to_email : (raise Exception.new('Please use an array to define your email address'))
|
25
|
+
end
|
26
|
+
|
27
|
+
if(phone = opts[:phone])
|
28
|
+
self.contact_info[:phone] = phone.is_a?(Array) ? phone.to_phone : (raise Exception.new('Please use an array to define your phone number'))
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def story(story)
|
34
|
+
self.story_text = story.join(" ")
|
35
|
+
end
|
36
|
+
|
37
|
+
# attended "XYZU", :in => "Basket Weaving", :with => "PHD", :graduated => "1999"
|
38
|
+
def attended(school, opts = {})
|
39
|
+
self.schools << {:name => school, :curriculum => opts[:in], :degree => opts[:with], :graduated => opts[:graduated]}
|
40
|
+
end
|
41
|
+
|
42
|
+
# worked :at => "Acme, Inc.", :description => "bored out of skull", :position => "Monkey", :tenure => 2008
|
43
|
+
def worked(opts = {})
|
44
|
+
self.jobs << {:company => opts[:at], :project => opts[:project], :description => opts[:description], :position => opts[:position], :tenure => opts[:tenure]}
|
45
|
+
end
|
46
|
+
|
47
|
+
{"built" => "applications", "using" => "technologies", "practicing" => "practices"}.each do |name, accessor|
|
48
|
+
class_eval <<-EOV
|
49
|
+
def #{name}(args)
|
50
|
+
self.#{accessor} = self.#{accessor} + (args.is_a?(Array) ? args : [args])
|
51
|
+
end
|
52
|
+
EOV
|
53
|
+
end
|
54
|
+
|
55
|
+
def line(width = @width)
|
56
|
+
"-".center(width, "-")
|
57
|
+
end
|
58
|
+
|
59
|
+
def pretty_print(out = $>, width = @width)
|
60
|
+
print(my_name, out, width, :center)
|
61
|
+
print_contact(out, width)
|
62
|
+
print(line, out, width)
|
63
|
+
print(line, out, width) if print_schools(out, width)
|
64
|
+
print(line, out, width) if print_jobs(out, width)
|
65
|
+
print(line, out, width) if print_array(applications, "Sites", out, width)
|
66
|
+
print(line, out, width) if print_array(technologies, "Technologies", out, width)
|
67
|
+
print(line, out, width) if print_array(practices, "Practices", out, width)
|
68
|
+
print(story_text, out, width)
|
69
|
+
out << "\n"
|
70
|
+
end
|
71
|
+
|
72
|
+
def has_contact_info?
|
73
|
+
!contact_info[:email].nil? or !contact_info[:phone].nil?
|
74
|
+
end
|
75
|
+
|
76
|
+
def has_story?
|
77
|
+
self.story_text and !self.story_text.empty?
|
78
|
+
end
|
79
|
+
|
80
|
+
%w(schools jobs applications technologies practices story_).each do |name|
|
81
|
+
class_eval <<-EOV
|
82
|
+
def has_#{name}?
|
83
|
+
self.#{name} and !self.#{name}.empty?
|
84
|
+
end
|
85
|
+
EOV
|
86
|
+
end
|
87
|
+
|
88
|
+
def print_contact(out = "", width = @width)
|
89
|
+
row = ""
|
90
|
+
row << contact_info[:email] if contact_info[:email]
|
91
|
+
row << " " if contact_info[:email] and contact_info[:phone]
|
92
|
+
row << contact_info[:phone] if contact_info[:phone]
|
93
|
+
print(row, out, width, :center)
|
94
|
+
end
|
95
|
+
|
96
|
+
def print_schools(out = "", width = @width)
|
97
|
+
schools.collect { |s|
|
98
|
+
row = ""
|
99
|
+
row << "Attended #{s[:name]}" if s[:name]
|
100
|
+
row << " #{s[:curriculum]}" if s[:curriculum]
|
101
|
+
row << " for #{s[:degree]}" if s[:degree]
|
102
|
+
row << "; Graduated #{s[:graduated]}" if s[:graduated]
|
103
|
+
print(row, out, width, :right)
|
104
|
+
}.join("\n")
|
105
|
+
end
|
106
|
+
|
107
|
+
def print_jobs(out = "", width = @width)
|
108
|
+
jobs.collect { |j|
|
109
|
+
row = ""
|
110
|
+
row << "Worked at #{j[:company]}" if j[:company]
|
111
|
+
row << " as a #{j[:position]}" if j[:position]
|
112
|
+
row << " (#{j[:tenure]})" if j[:tenure]
|
113
|
+
row << "\n On #{j[:project]}" if j[:project]
|
114
|
+
result = print(row, out, width, :right)
|
115
|
+
result += "\n " + print(j[:description], out, width) if j[:description]
|
116
|
+
}.join("\n\n")
|
117
|
+
end
|
118
|
+
|
119
|
+
def print_array(array, title = "", out = "", width = @width)
|
120
|
+
unless(array.empty?)
|
121
|
+
print(title, out, width, :right)
|
122
|
+
print(array.join(" - "), out, width)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def print(str, out, width, justify = :left)
|
127
|
+
if(str.length > width)
|
128
|
+
i = str.rindex(' ', width)
|
129
|
+
print(str[0, i], out, width, justify) + ' ' +print(str[i+1, str.length], out, width, justify)
|
130
|
+
elsif(!str.empty?)
|
131
|
+
line = str.justify(width, justify)
|
132
|
+
out << "\n#{line}"
|
133
|
+
line.strip
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
class String
|
140
|
+
def justify(width, justify)
|
141
|
+
case justify
|
142
|
+
when :center: center(width)
|
143
|
+
when :left: ljust(width)
|
144
|
+
when :right: rjust(width)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
class Array
|
150
|
+
def to_email
|
151
|
+
"#{self.first}@#{self[1,size].join('.')}"
|
152
|
+
end
|
153
|
+
|
154
|
+
def to_phone(delimiter = ".")
|
155
|
+
self.join(delimiter)
|
156
|
+
end
|
157
|
+
end
|
data/resume.gemspec
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{resume}
|
5
|
+
s.version = "0.1.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["cajun"]
|
9
|
+
s.date = %q{2009-09-22}
|
10
|
+
s.default_executable = %q{resume}
|
11
|
+
s.email = %q{zac@kleinpeter.org}
|
12
|
+
s.executables = ["resume"]
|
13
|
+
s.extra_rdoc_files = [
|
14
|
+
"LICENSE",
|
15
|
+
"README.rdoc"
|
16
|
+
]
|
17
|
+
s.files = [
|
18
|
+
".document",
|
19
|
+
".gitignore",
|
20
|
+
"LICENSE",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"bin/resume",
|
25
|
+
"examples/ruby_coder.rb",
|
26
|
+
"lib/pdf_printer.rb",
|
27
|
+
"lib/resume.rb",
|
28
|
+
"resume.gemspec",
|
29
|
+
"spec/resume_spec.rb"
|
30
|
+
]
|
31
|
+
s.homepage = %q{http://github.com/cajun/resume}
|
32
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
+
s.require_paths = ["lib"]
|
34
|
+
s.rubygems_version = %q{1.3.5}
|
35
|
+
s.summary = %q{cool resume}
|
36
|
+
s.test_files = [
|
37
|
+
"spec/resume_spec.rb",
|
38
|
+
"examples/ruby_coder.rb"
|
39
|
+
]
|
40
|
+
|
41
|
+
if s.respond_to? :specification_version then
|
42
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
+
s.specification_version = 3
|
44
|
+
|
45
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
|
+
else
|
47
|
+
end
|
48
|
+
else
|
49
|
+
end
|
50
|
+
end
|
data/spec/resume_spec.rb
ADDED
@@ -0,0 +1,270 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/resume')
|
2
|
+
|
3
|
+
describe Resume do
|
4
|
+
before(:each) do
|
5
|
+
@empty = EmptyResume
|
6
|
+
@resume = DummyResume
|
7
|
+
@alternate = AlternateDummyResume
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should do the simplest thing possible" do
|
11
|
+
@resume.should_not be_nil
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should have a name based on the class its included in" do
|
15
|
+
@resume.my_name.should == "Dummy Resume"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should even do middle names and more" do
|
19
|
+
@alternate.my_name.should == "Alternate Dummy Resume"
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "schools" do
|
23
|
+
it "should have no schools if there are none" do
|
24
|
+
@empty.schools.should be_empty
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should say its got no schools if there are none" do
|
28
|
+
@empty.has_schools?.should be_false
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should include a school if there is one" do
|
32
|
+
@resume.schools.first[:name].should == "XYZU"
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should say it has schools if it does" do
|
36
|
+
@resume.has_schools?.should be_true
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should include year if supplied" do
|
40
|
+
@resume.schools.first[:graduated].should == "1999"
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should include degree if supplied" do
|
44
|
+
@resume.schools.first[:degree].should == "PHD"
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should include curriculum if supplied" do
|
48
|
+
@resume.schools.first[:curriculum].should == "Basket Weaving"
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should have 1 school if said school is supplied" do
|
52
|
+
@resume.schools.size == 1
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should have 2 schools if said schools are supplied" do
|
56
|
+
@alternate.schools.size == 2
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "jobs" do
|
61
|
+
it "should have no jobs if there are none" do
|
62
|
+
@empty.jobs.should be_empty
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should say it has not jobs if there are none" do
|
66
|
+
@empty.has_jobs?.should be_false
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should include a job if there is one" do
|
70
|
+
@resume.jobs.first[:company].should == "Acme, Inc."
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should say it has jobs if there are some" do
|
74
|
+
@resume.has_jobs?.should be_true
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should include a description if there is one" do
|
78
|
+
@resume.jobs.first[:description].should == "bored out of skull"
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should include a position if there is one" do
|
82
|
+
@resume.jobs.first[:position].should == "Monkey"
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should include a tenure if there is one" do
|
86
|
+
@resume.jobs.first[:tenure].should == 2008
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "applications" do
|
91
|
+
it "should have no applications if there are none" do
|
92
|
+
@empty.applications.should be_empty
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should say it has not apps if there are none" do
|
96
|
+
@empty.has_applications?.should be_false
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should have applications if there are some" do
|
100
|
+
@resume.applications.should == ["foo.com", "bar.net", "baz.org"]
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should say it has apps if there are some" do
|
104
|
+
@resume.has_applications?.should be_true
|
105
|
+
end
|
106
|
+
|
107
|
+
it "should also add applications if there are multiples" do
|
108
|
+
@alternate.applications.should == ["biz.gov", "buzz.biz"]
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
describe "technologies" do
|
113
|
+
it "should have no technologies if there are none" do
|
114
|
+
@empty.technologies.should be_empty
|
115
|
+
end
|
116
|
+
|
117
|
+
it "should say it has no tech if there is none" do
|
118
|
+
@empty.has_technologies?.should be_false
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should have technologies if there are some" do
|
122
|
+
@resume.technologies.should == ["countin", "readin", "spellin", "typin"]
|
123
|
+
end
|
124
|
+
|
125
|
+
it "should say it has tech if there is some" do
|
126
|
+
@resume.has_technologies?.should be_true
|
127
|
+
end
|
128
|
+
|
129
|
+
|
130
|
+
it "should also add technologies if there are multiples" do
|
131
|
+
@alternate.technologies.should == ["countin", "readin"]
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
describe "practices" do
|
136
|
+
it "should have no practices if there are none" do
|
137
|
+
@empty.practices.should be_empty
|
138
|
+
end
|
139
|
+
|
140
|
+
it "should say it has no practices if there is none" do
|
141
|
+
@empty.has_practices?.should be_false
|
142
|
+
end
|
143
|
+
|
144
|
+
it "should have practices if there are some" do
|
145
|
+
@resume.practices.should == ["law", "surgery", "juggling", "golf"]
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should say it has practices if there are some" do
|
149
|
+
@resume.has_practices?.should be_true
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should also add practices if there are multiples" do
|
153
|
+
@alternate.practices.should == ["law", "surgery"]
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
describe "contact" do
|
158
|
+
it "should include email" do
|
159
|
+
@resume.contact_info[:email].should == "foo@bar.com"
|
160
|
+
end
|
161
|
+
|
162
|
+
it "should say it has contact_info if there are some" do
|
163
|
+
@resume.has_contact_info?.should be_true
|
164
|
+
end
|
165
|
+
|
166
|
+
it "should include phone" do
|
167
|
+
@resume.contact_info[:phone].should == "800.444.3333"
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
describe "story" do
|
172
|
+
it "should include a story" do
|
173
|
+
@resume.story_text.should == "some story that this resume has and it does too"
|
174
|
+
end
|
175
|
+
|
176
|
+
it "should say there is a story" do
|
177
|
+
@resume.has_story?.should be_true
|
178
|
+
end
|
179
|
+
|
180
|
+
it "should not include a story if there isn't one" do
|
181
|
+
@empty.story_text.should be_empty
|
182
|
+
end
|
183
|
+
|
184
|
+
it "should not say there is a story" do
|
185
|
+
@empty.has_story?.should be_false
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
describe "pretty_print" do
|
190
|
+
before(:each) do
|
191
|
+
@print = ""
|
192
|
+
@resume.pretty_print(@print)
|
193
|
+
@alt_print = ""
|
194
|
+
@alternate.pretty_print(@alt_print)
|
195
|
+
end
|
196
|
+
|
197
|
+
it "should have a line" do
|
198
|
+
@resume.line.length.should == @resume.width
|
199
|
+
end
|
200
|
+
|
201
|
+
it "should use the name" do
|
202
|
+
@print.should match(/Dummy Resume/)
|
203
|
+
end
|
204
|
+
|
205
|
+
it "should use with a line" do
|
206
|
+
@print.should be_include(@resume.line)
|
207
|
+
end
|
208
|
+
|
209
|
+
it "should use the email" do
|
210
|
+
@print.should match(/foo@bar.com/)
|
211
|
+
end
|
212
|
+
|
213
|
+
it "should use the phone" do
|
214
|
+
@print.should match(/800.444.3333/)
|
215
|
+
end
|
216
|
+
|
217
|
+
it "should print schools out" do
|
218
|
+
@alt_print.should match(/Bachelor's/)
|
219
|
+
@alt_print.should match(/PHD/)
|
220
|
+
end
|
221
|
+
|
222
|
+
it "should print jobs" do
|
223
|
+
@print.should match(/Acme, Inc./)
|
224
|
+
@print.should match(/bored out of skull/)
|
225
|
+
@print.should match(/Monkey/)
|
226
|
+
@print.should match(/2008/)
|
227
|
+
end
|
228
|
+
|
229
|
+
it "should print websites" do
|
230
|
+
@print.should match(/foo.com/)
|
231
|
+
@print.should match(/bar.net/)
|
232
|
+
@print.should match(/baz.org/)
|
233
|
+
end
|
234
|
+
|
235
|
+
it "should print the story" do
|
236
|
+
@print.should match(/some story that this resume has and it does too/)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
class EmptyResume
|
242
|
+
include Resume
|
243
|
+
end
|
244
|
+
|
245
|
+
class DummyResume
|
246
|
+
include Resume
|
247
|
+
contact :email => %w(foo bar com), :phone => %w(800 444 3333)
|
248
|
+
attended "XYZU", :in => "Basket Weaving", :with => "PHD", :graduated => "1999"
|
249
|
+
worked :at => "Acme, Inc.", :description => "bored out of skull", :position => "Monkey", :tenure => 2008
|
250
|
+
built %w(foo.com bar.net baz.org)
|
251
|
+
using %w(countin readin spellin typin)
|
252
|
+
practicing %w(law surgery juggling golf)
|
253
|
+
story %w(some story that this resume has and it does too)
|
254
|
+
end
|
255
|
+
|
256
|
+
class AlternateDummyResume
|
257
|
+
include Resume
|
258
|
+
attended "XYZU", :in => "Basket Weaving", :with => "Bachelor's", :graduated => "1908"
|
259
|
+
attended "XYZU", :in => "Basket Weaving", :with => "PHD", :graduated => "1999"
|
260
|
+
worked :at => "Acme, Inc.", :description => "bored out of skull", :position => "Monkey", :tenure => 2008
|
261
|
+
worked :at => "Backnecorp", :description => "bored out of back", :position => "Picker", :tenure => 2004
|
262
|
+
|
263
|
+
built "biz.gov"
|
264
|
+
built "buzz.biz"
|
265
|
+
using "countin"
|
266
|
+
using "readin"
|
267
|
+
practicing "law"
|
268
|
+
practicing "surgery"
|
269
|
+
end
|
270
|
+
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cajun-resume
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- cajun
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-09-22 00:00:00 -07:00
|
13
|
+
default_executable: resume
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: zac@kleinpeter.org
|
18
|
+
executables:
|
19
|
+
- resume
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
files:
|
26
|
+
- .document
|
27
|
+
- .gitignore
|
28
|
+
- LICENSE
|
29
|
+
- README.rdoc
|
30
|
+
- Rakefile
|
31
|
+
- VERSION
|
32
|
+
- bin/resume
|
33
|
+
- examples/ruby_coder.rb
|
34
|
+
- lib/pdf_printer.rb
|
35
|
+
- lib/resume.rb
|
36
|
+
- resume.gemspec
|
37
|
+
- spec/resume_spec.rb
|
38
|
+
has_rdoc: false
|
39
|
+
homepage: http://github.com/cajun/resume
|
40
|
+
licenses:
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options:
|
43
|
+
- --charset=UTF-8
|
44
|
+
require_paths:
|
45
|
+
- lib
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: "0"
|
51
|
+
version:
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
version:
|
58
|
+
requirements: []
|
59
|
+
|
60
|
+
rubyforge_project:
|
61
|
+
rubygems_version: 1.3.5
|
62
|
+
signing_key:
|
63
|
+
specification_version: 3
|
64
|
+
summary: cool resume
|
65
|
+
test_files:
|
66
|
+
- spec/resume_spec.rb
|
67
|
+
- examples/ruby_coder.rb
|