resumetools 0.2.7.0 → 0.2.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,3 @@
1
- require 'json/pure'
2
-
3
1
  module ResumeTools
4
2
  module Renderer
5
3
  class JSON
@@ -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 => 10,
38
+ :section => 11,
59
39
  :para => 9,
60
40
  :item => 9,
61
- :period => 12
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.span(pdf.bounds.width - 10, :position => 10) do
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
- # Period title
128
- pdf.pad_top(5) { pdf.text period.title, :style => :bold, :size => FONT_SIZES[:period] }
129
-
130
- # Period details
131
- pdf.span(pdf.bounds.width - 10, :position => 10) do
132
- pdf.text(period.line, :size => FONT_SIZES[:default])
133
- end
134
-
135
- # Period items
136
- unless period.items.empty?
137
- pdf.table period.items.map { |item| [" •", item.text] },
138
- :font_size => FONT_SIZES[:item],
139
- :column_widths => { 0 => 20, 1 => 420 },
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, :url].each do |element|
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
 
@@ -35,7 +35,7 @@ module ResumeTools
35
35
 
36
36
  # Builds a new Resume instance from text
37
37
  def from_text(text)
38
- parser = ::ResumeParser.new
38
+ parser = ResumeTools::ResumeGrammarParser.new
39
39
  result = parser.parse(text)
40
40
 
41
41
  if result.nil?
@@ -25,12 +25,6 @@
25
25
 
26
26
  unless defined? ResumeTools::VERSION
27
27
  module ResumeTools
28
- module VERSION
29
- MAJOR = 0
30
- MINOR = 2
31
- TINY = 7
32
- BITSY = 0
33
- STRING = [MAJOR, MINOR, TINY, BITSY].join('.')
34
- end
28
+ VERSION = "0.2.7.6"
35
29
  end
36
30
  end
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
- $:.unshift File.dirname(__FILE__)
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"