resumerb 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -16,12 +16,13 @@ Jeweler::Tasks.new do |gem|
16
16
  gem.homepage = "http://github.com/mwylde/resume.rb"
17
17
  gem.license = "MIT"
18
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"
19
+ gem.description = %Q{Resume provides a DSL for defining resume data, which can be rendered via various backends (currently LaTeX, plain text, Markdown and HTML).}
20
+ gem.email = "micah@micahw.com"
21
21
  gem.authors = ["Micah Wylde"]
22
22
  # Include your dependencies below. Runtime dependencies are required when using your gem,
23
23
  # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
24
  gem.add_runtime_dependency 'erubis', '> 2.6.5'
25
+ gem.add_runtime_dependency 'redcarpet', '~> 2.0.0b5'
25
26
  # gem.add_development_dependency 'rspec', '> 1.2.3'
26
27
  end
27
28
  Jeweler::RubygemsDotOrgTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
@@ -0,0 +1,14 @@
1
+ module Resume
2
+ class HTMLBackend
3
+ class << self
4
+ def render r
5
+ md = MarkdownBackend.render r
6
+ markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
7
+ :autolink => true, :space_after_headers => true)
8
+ body = markdown.render md
9
+ template = File.open(File.dirname(__FILE__) + "/templates/template.html.erb").read
10
+ Erubis::Eruby.new(template).evaluate(:about => r.about, :body => body)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,48 @@
1
+ module Resume
2
+ class MarkdownBackend
3
+ class << self
4
+ RN = "\r\n"
5
+ def render r
6
+ result = ""
7
+ result << "# " << r.about[:name] << RN << RN
8
+ result << " * " << r.about[:address].join(", ") << RN if r.about[:address]
9
+ result << " * " << r.about[:email] << RN if r.about[:email]
10
+ result << " * " << r.about[:phone] << RN if r.about[:phone]
11
+ result << " * " << r.about[:url] << RN if r.about[:url]
12
+ result << RN
13
+
14
+ result << "## Education" << RN << RN
15
+ r.schools.each do |ed|
16
+ result << ed[:school] << ", " << ed[:city] << " " << RN if ed[:school]
17
+ result << ed[:degree] << ", " if ed[:degree]
18
+ result << (ed[:will_finish] ? "expected graduation: #{ed[:will_finish]}" :
19
+ ed[:finished]) << RN << RN
20
+ end
21
+
22
+ result << "## Work Experience" << RN << RN
23
+ r.jobs.each do |job|
24
+ date = job[:date] ? " (#{job[:date]})" : ""
25
+ result << "### " << job[:position] << ", "
26
+ result << job[:employer] << date << RN << RN
27
+ result << job[:description] << RN << RN
28
+ end
29
+
30
+ # Sections
31
+ r.sections.each do |sec|
32
+ result << "## " << sec[:name] << RN << RN
33
+ if sec[:text]
34
+ result << sec[:text] << RN
35
+ end
36
+ if sec[:bullets]
37
+ sec[:bullets].each do |b|
38
+ result << " * " << b << RN
39
+ end
40
+ end
41
+ result << RN
42
+ end
43
+
44
+ result
45
+ end
46
+ end
47
+ end
48
+ end
@@ -9,9 +9,9 @@ module Resume
9
9
  result << r.about[:name].upcase << RN << RN
10
10
 
11
11
  # Adress
12
- result << r.about[:address].join(RN) << RN
13
- result << r.about[:email] << RN
14
- result << r.about[:phone] << RN << RN
12
+ result << r.about[:address].join(RN) << RN if r.about[:address]
13
+ result << r.about[:email] << RN if r.about[:email]
14
+ result << r.about[:phone] << RN << RN if r.about[:phone]
15
15
 
16
16
  # Education
17
17
  result << "EDUCATION" << RN << RN
@@ -42,7 +42,7 @@
42
42
  % ------ Address --------------------------------------------------------
43
43
 
44
44
  \address{<%= @about[:address].join("\\\\ \n") %> \\
45
- <%= @about[:phone] %> \\
45
+ <%= @about[:phone] + "\\" if @about[:phone] %>
46
46
  }{
47
47
  <%= @about[:email] %> \\
48
48
  <%= @about[:url] %>}
@@ -0,0 +1,8 @@
1
+ <html>
2
+ <head>
3
+ <title><%= @about[:name] %></title>
4
+ </head>
5
+ <body>
6
+ <%= @body %>
7
+ </body>
8
+ </html>
data/lib/resume.rb CHANGED
@@ -2,8 +2,11 @@ libdir = File.dirname(__FILE__)
2
2
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
3
3
 
4
4
  require 'erubis'
5
+ require 'redcarpet'
5
6
  require 'resume/latex'
6
7
  require 'resume/plain_text'
8
+ require 'resume/markdown'
9
+ require 'resume/html'
7
10
 
8
11
  # Ruby class that lets you define resumes that can be rendered
9
12
  # to various backends. Currently planned is Markdown and LaTex,
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{resume}
8
- s.version = "0.1.0"
7
+ s.name = "resumerb"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
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}
12
+ s.date = "2011-11-07"
13
+ s.description = "Resume provides a DSL for defining resume data, which can be rendered via various backends (currently LaTeX, plain text, Markdown and HTML)."
14
+ s.email = "micah@micahw.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.md"
@@ -28,25 +28,28 @@ Gem::Specification.new do |s|
28
28
  "example/my_resume.rb",
29
29
  "example/my_resume.tex",
30
30
  "lib/resume.rb",
31
+ "lib/resume/html.rb",
31
32
  "lib/resume/latex.rb",
33
+ "lib/resume/markdown.rb",
32
34
  "lib/resume/plain_text.rb",
33
35
  "lib/resume/templates/latex.tex.erb",
34
36
  "lib/resume/templates/resume.cls",
37
+ "lib/resume/templates/template.html.erb",
38
+ "resumerb.gemspec",
35
39
  "spec/resume.rb_spec.rb",
36
40
  "spec/spec_helper.rb"
37
41
  ]
38
- s.homepage = %q{http://github.com/mwylde/resume.rb}
42
+ s.homepage = "http://github.com/mwylde/resume.rb"
39
43
  s.licenses = ["MIT"]
40
44
  s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.3.7}
42
- s.summary = %q{Generates resumes in HTML and PDF (via LaTeX)}
45
+ s.rubygems_version = "1.8.10"
46
+ s.summary = "Generates resumes in HTML and PDF (via LaTeX)"
43
47
  s.test_files = [
44
48
  "spec/resume.rb_spec.rb",
45
49
  "spec/spec_helper.rb"
46
50
  ]
47
51
 
48
52
  if s.respond_to? :specification_version then
49
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
50
53
  s.specification_version = 3
51
54
 
52
55
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -56,6 +59,7 @@ Gem::Specification.new do |s|
56
59
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
57
60
  s.add_development_dependency(%q<rcov>, [">= 0"])
58
61
  s.add_runtime_dependency(%q<erubis>, ["> 2.6.5"])
62
+ s.add_runtime_dependency(%q<redcarpet>, ["~> 2.0.0b5"])
59
63
  else
60
64
  s.add_dependency(%q<rspec>, ["~> 2.1.0"])
61
65
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
@@ -63,6 +67,7 @@ Gem::Specification.new do |s|
63
67
  s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
64
68
  s.add_dependency(%q<rcov>, [">= 0"])
65
69
  s.add_dependency(%q<erubis>, ["> 2.6.5"])
70
+ s.add_dependency(%q<redcarpet>, ["~> 2.0.0b5"])
66
71
  end
67
72
  else
68
73
  s.add_dependency(%q<rspec>, ["~> 2.1.0"])
@@ -71,6 +76,7 @@ Gem::Specification.new do |s|
71
76
  s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
72
77
  s.add_dependency(%q<rcov>, [">= 0"])
73
78
  s.add_dependency(%q<erubis>, ["> 2.6.5"])
79
+ s.add_dependency(%q<redcarpet>, ["~> 2.0.0b5"])
74
80
  end
75
81
  end
76
82
 
metadata CHANGED
@@ -1,120 +1,102 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
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
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Micah Wylde
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-01-07 00:00:00 -08:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rspec
22
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70269931723160 !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
18
+ requirements:
25
19
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 1
30
- - 0
20
+ - !ruby/object:Gem::Version
31
21
  version: 2.1.0
32
22
  type: :development
33
23
  prerelease: false
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
24
+ version_requirements: *70269931723160
25
+ - !ruby/object:Gem::Dependency
36
26
  name: yard
37
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ requirement: &70269931720820 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
29
+ requirements:
40
30
  - - ~>
41
- - !ruby/object:Gem::Version
42
- segments:
43
- - 0
44
- - 6
45
- - 0
31
+ - !ruby/object:Gem::Version
46
32
  version: 0.6.0
47
33
  type: :development
48
34
  prerelease: false
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *70269931720820
36
+ - !ruby/object:Gem::Dependency
51
37
  name: bundler
52
- requirement: &id003 !ruby/object:Gem::Requirement
38
+ requirement: &70269931735860 !ruby/object:Gem::Requirement
53
39
  none: false
54
- requirements:
40
+ requirements:
55
41
  - - ~>
56
- - !ruby/object:Gem::Version
57
- segments:
58
- - 1
59
- - 0
60
- - 0
42
+ - !ruby/object:Gem::Version
61
43
  version: 1.0.0
62
44
  type: :development
63
45
  prerelease: false
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
46
+ version_requirements: *70269931735860
47
+ - !ruby/object:Gem::Dependency
66
48
  name: jeweler
67
- requirement: &id004 !ruby/object:Gem::Requirement
49
+ requirement: &70269931735360 !ruby/object:Gem::Requirement
68
50
  none: false
69
- requirements:
51
+ requirements:
70
52
  - - ~>
71
- - !ruby/object:Gem::Version
72
- segments:
73
- - 1
74
- - 5
75
- - 1
53
+ - !ruby/object:Gem::Version
76
54
  version: 1.5.1
77
55
  type: :development
78
56
  prerelease: false
79
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
57
+ version_requirements: *70269931735360
58
+ - !ruby/object:Gem::Dependency
81
59
  name: rcov
82
- requirement: &id005 !ruby/object:Gem::Requirement
60
+ requirement: &70269931734620 !ruby/object:Gem::Requirement
83
61
  none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- segments:
88
- - 0
89
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
90
66
  type: :development
91
67
  prerelease: false
92
- version_requirements: *id005
93
- - !ruby/object:Gem::Dependency
68
+ version_requirements: *70269931734620
69
+ - !ruby/object:Gem::Dependency
94
70
  name: erubis
95
- requirement: &id006 !ruby/object:Gem::Requirement
71
+ requirement: &70269931733940 !ruby/object:Gem::Requirement
96
72
  none: false
97
- requirements:
98
- - - ">"
99
- - !ruby/object:Gem::Version
100
- segments:
101
- - 2
102
- - 6
103
- - 5
73
+ requirements:
74
+ - - ! '>'
75
+ - !ruby/object:Gem::Version
104
76
  version: 2.6.5
105
77
  type: :runtime
106
78
  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
79
+ version_requirements: *70269931733940
80
+ - !ruby/object:Gem::Dependency
81
+ name: redcarpet
82
+ requirement: &70269931733260 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ~>
86
+ - !ruby/object:Gem::Version
87
+ version: 2.0.0b5
88
+ type: :runtime
89
+ prerelease: false
90
+ version_requirements: *70269931733260
91
+ description: Resume provides a DSL for defining resume data, which can be rendered
92
+ via various backends (currently LaTeX, plain text, Markdown and HTML).
93
+ email: micah@micahw.com
110
94
  executables: []
111
-
112
95
  extensions: []
113
-
114
- extra_rdoc_files:
96
+ extra_rdoc_files:
115
97
  - LICENSE.txt
116
98
  - README.md
117
- files:
99
+ files:
118
100
  - .document
119
101
  - .rspec
120
102
  - Gemfile
@@ -126,46 +108,44 @@ files:
126
108
  - example/my_resume.rb
127
109
  - example/my_resume.tex
128
110
  - lib/resume.rb
111
+ - lib/resume/html.rb
129
112
  - lib/resume/latex.rb
113
+ - lib/resume/markdown.rb
130
114
  - lib/resume/plain_text.rb
131
115
  - lib/resume/templates/latex.tex.erb
132
116
  - lib/resume/templates/resume.cls
133
- - resume.gemspec
117
+ - lib/resume/templates/template.html.erb
118
+ - resumerb.gemspec
134
119
  - spec/resume.rb_spec.rb
135
120
  - spec/spec_helper.rb
136
- has_rdoc: true
137
121
  homepage: http://github.com/mwylde/resume.rb
138
- licenses:
122
+ licenses:
139
123
  - MIT
140
124
  post_install_message:
141
125
  rdoc_options: []
142
-
143
- require_paths:
126
+ require_paths:
144
127
  - lib
145
- required_ruby_version: !ruby/object:Gem::Requirement
128
+ required_ruby_version: !ruby/object:Gem::Requirement
146
129
  none: false
147
- requirements:
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- hash: -3560557437108115605
151
- segments:
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ segments:
152
135
  - 0
153
- version: "0"
154
- required_rubygems_version: !ruby/object:Gem::Requirement
136
+ hash: 1517123393834753169
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
155
138
  none: false
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- segments:
160
- - 0
161
- version: "0"
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
162
143
  requirements: []
163
-
164
144
  rubyforge_project:
165
- rubygems_version: 1.3.7
145
+ rubygems_version: 1.8.10
166
146
  signing_key:
167
147
  specification_version: 3
168
148
  summary: Generates resumes in HTML and PDF (via LaTeX)
169
- test_files:
149
+ test_files:
170
150
  - spec/resume.rb_spec.rb
171
151
  - spec/spec_helper.rb