resumetools 0.2.7.0 → 0.2.7.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +3 -0
- data/Rakefile +0 -26
- data/lib/resumetools/grammars/resume.treetop +391 -389
- data/lib/resumetools/resume/json.rb +0 -2
- data/lib/resumetools/resume/pdf.rb +21 -43
- data/lib/resumetools/resume/plain_text.rb +1 -3
- data/lib/resumetools/resume/resume.rb +2 -1
- data/lib/resumetools/resume/text_reader.rb +1 -1
- data/lib/resumetools/version.rb +1 -7
- data/lib/resumetools.rb +16 -8
- data/lib/text/format.rb +1044 -0
- data/spec/grammar_spec.rb +2 -2
- data/tasks/gem.rake +43 -27
- metadata +110 -110
- data/tasks/package.rake +0 -9
@@ -25,26 +25,6 @@
|
|
25
25
|
# OTHER DEALINGS IN THE SOFTWARE.
|
26
26
|
#++
|
27
27
|
|
28
|
-
gems = [
|
29
|
-
['prawn', '>= 0.5.1'],
|
30
|
-
['prawn-core', '>= 0.5.1'],
|
31
|
-
['prawn-layout', '>= 0.2.1'],
|
32
|
-
['prawn-format', '>= 0.2.1']
|
33
|
-
]
|
34
|
-
|
35
|
-
gems.each do |name, version|
|
36
|
-
if version
|
37
|
-
gem name, version
|
38
|
-
else
|
39
|
-
gem name
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
require "prawn"
|
44
|
-
require "prawn/format"
|
45
|
-
require "prawn/layout"
|
46
|
-
require "prawn/measurement_extensions"
|
47
|
-
|
48
28
|
module ResumeTools
|
49
29
|
module Renderer
|
50
30
|
module PDF
|
@@ -55,10 +35,10 @@ module ResumeTools
|
|
55
35
|
:default => 9,
|
56
36
|
:header => 14,
|
57
37
|
:contact => 9,
|
58
|
-
:section =>
|
38
|
+
:section => 11,
|
59
39
|
:para => 9,
|
60
40
|
:item => 9,
|
61
|
-
:period =>
|
41
|
+
:period => 10
|
62
42
|
}
|
63
43
|
DATE_FORMAT = "%B, %Y"
|
64
44
|
|
@@ -121,28 +101,26 @@ module ResumeTools
|
|
121
101
|
end
|
122
102
|
|
123
103
|
# Periods
|
124
|
-
section.periods.each do |period|
|
125
|
-
pdf.
|
104
|
+
section.periods.each do |period|
|
105
|
+
pdf.pad_top(5) do
|
106
|
+
# Period title
|
107
|
+
pdf.pad_top(5) { pdf.text period.title, :style => :bold, :size => FONT_SIZES[:period] }
|
108
|
+
|
109
|
+
# Period details
|
126
110
|
pdf.pad_top(5) do
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
:border_style => :none,
|
141
|
-
:border_color => "ffffff",
|
142
|
-
:vertical_padding => 4,
|
143
|
-
:horizontal_padding => 0,
|
144
|
-
:align => { 0 => :center, 1 => :left }
|
145
|
-
end
|
111
|
+
pdf.text(period.line, :size => FONT_SIZES[:default])
|
112
|
+
end
|
113
|
+
|
114
|
+
# Period items
|
115
|
+
unless period.items.empty?
|
116
|
+
pdf.table period.items.map { |item| [" •", item.text] },
|
117
|
+
:font_size => FONT_SIZES[:item],
|
118
|
+
:column_widths => { 0 => 20, 1 => 420 },
|
119
|
+
:border_style => :none,
|
120
|
+
:border_color => "ffffff",
|
121
|
+
:vertical_padding => 4,
|
122
|
+
:horizontal_padding => 0,
|
123
|
+
:align => { 0 => :center, 1 => :left }
|
146
124
|
end
|
147
125
|
end
|
148
126
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'text/format'
|
2
|
-
|
3
1
|
module ResumeTools
|
4
2
|
module Renderer
|
5
3
|
class PlainText
|
@@ -19,7 +17,7 @@ module ResumeTools
|
|
19
17
|
:lined_headers => true
|
20
18
|
}
|
21
19
|
@opts.merge!(opts)
|
22
|
-
@format = Text::Format.new
|
20
|
+
@format = ::Text::Format.new
|
23
21
|
@format.first_indent = @opts[:first_indent]
|
24
22
|
@format.columns = @opts[:columns]
|
25
23
|
|
@@ -117,11 +117,12 @@ module ResumeTools
|
|
117
117
|
# Returns an array of lines that has the contact info
|
118
118
|
def header_lines
|
119
119
|
elements = []
|
120
|
-
[:address1, :address2, :telephone, :email
|
120
|
+
[:address1, :address2, :telephone, :email].each do |element|
|
121
121
|
elements << self.send(element) unless self.send(element).blank?
|
122
122
|
end
|
123
123
|
lines = []
|
124
124
|
elements.each_slice(2) { |pair| lines << pair.join(" • ") }
|
125
|
+
lines << self.url unless self.url.blank?
|
125
126
|
lines
|
126
127
|
end
|
127
128
|
|
data/lib/resumetools/version.rb
CHANGED
data/lib/resumetools.rb
CHANGED
@@ -23,15 +23,23 @@
|
|
23
23
|
# OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
#++
|
25
25
|
|
26
|
+
require "prawn"
|
27
|
+
require "prawn/layout"
|
28
|
+
require "prawn/measurement_extensions"
|
26
29
|
require "extlib"
|
27
30
|
require "uuidtools"
|
31
|
+
require "json"
|
32
|
+
require "treetop"
|
28
33
|
|
29
|
-
|
34
|
+
unless defined?(Text::Format)
|
35
|
+
require File.expand_path(File.dirname(__FILE__) + "/text/format")
|
36
|
+
end
|
37
|
+
|
38
|
+
require File.expand_path(File.dirname(__FILE__) + "/resumetools/version")
|
39
|
+
require File.expand_path(File.dirname(__FILE__) + "/resumetools/resume/resume")
|
40
|
+
require File.expand_path(File.dirname(__FILE__) + "/resumetools/resume/text_reader")
|
41
|
+
require File.expand_path(File.dirname(__FILE__) + "/resumetools/resume/pdf")
|
42
|
+
require File.expand_path(File.dirname(__FILE__) + "/resumetools/resume/plain_text")
|
43
|
+
require File.expand_path(File.dirname(__FILE__) + "/resumetools/resume/json")
|
44
|
+
require File.expand_path(File.dirname(__FILE__) + "/resumetools/resume/export")
|
30
45
|
|
31
|
-
require "resumetools/version"
|
32
|
-
require "resumetools/resume/resume"
|
33
|
-
require "resumetools/resume/text_reader"
|
34
|
-
require "resumetools/resume/pdf"
|
35
|
-
require "resumetools/resume/plain_text"
|
36
|
-
require "resumetools/resume/json"
|
37
|
-
require "resumetools/resume/export"
|