resumetools 0.2.8 → 0.2.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9e2ead7740e046277eb9d78c1b895c381a8cc7b
4
- data.tar.gz: e03fd47d6da9f350ed7805a225821e448e6711a5
3
+ metadata.gz: de9d550d2a1d483aea1737371c7d5fb3a8ee8880
4
+ data.tar.gz: 0a8f279217ef7ca672c5aafcbbd93c755eca5ce9
5
5
  SHA512:
6
- metadata.gz: c938691dc0ae9d95fd7d01e2bd0c8d164789740e1df913184661dd45e0fad5fb3e62b2240d71f7f728b65f5eea253c8ed7be436caf1fa1cc14ce720a9333d40b
7
- data.tar.gz: 11a85e3ebbd6b262fa0783deaf06a9b2564d2214a1ebb2d3af45d2f1591bd767659121661bd503866839d3754bbf25ff3347a769b4bcc8c4d0a663e61bc4de41
6
+ metadata.gz: ab0a66e2994aa45835320ef8f998097f3a230e7fceac2a2626056229cd3e2fd0f51cdc49d173efdc440f2703c0dd12565252d5eb5f0327a519e33f478b7312f2
7
+ data.tar.gz: 7c9c2c6da87d196b7e0a22af07a7fb9e567d90be6dd7e324fecaf30264413dd8aba0856f4cbfa7d544140bd31cc30596dc3b93123bfcbaf1c2897977fc826cb6
data/Gemfile.lock CHANGED
@@ -2,11 +2,12 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  resumetools (0.2.8)
5
- extlib
6
- json_pure
7
- prawn (>= 0.7.1)
8
- treetop (>= 1.3.0)
9
- uuidtools
5
+ extlib (>= 0.9.16)
6
+ json_pure (>= 1.8.2)
7
+ prawn (>= 1.3.0)
8
+ prawn-table (>= 0.2.1)
9
+ treetop (>= 1.5.3)
10
+ uuidtools (>= 2.1.5)
10
11
 
11
12
  GEM
12
13
  remote: https://rubygems.org/
@@ -19,6 +20,7 @@ GEM
19
20
  prawn (1.3.0)
20
21
  pdf-core (~> 0.4.0)
21
22
  ttfunk (~> 1.4.0)
23
+ prawn-table (0.2.1)
22
24
  rake (10.4.2)
23
25
  rspec (3.1.0)
24
26
  rspec-core (~> 3.1.0)
@@ -41,6 +43,6 @@ PLATFORMS
41
43
  ruby
42
44
 
43
45
  DEPENDENCIES
44
- rake (>= 0.8.7)
46
+ rake (>= 10.4.0)
45
47
  resumetools!
46
- rspec (>= 1.2.8)
48
+ rspec (>= 3.1.0)
data/README.md CHANGED
@@ -3,7 +3,9 @@ ResumeTools
3
3
 
4
4
  https://github.com/virgild/resumetools
5
5
 
6
- ![Travis-CI](https://travis-ci.org/virgild/resumetools.svg)
6
+ [![Travis-CI](https://travis-ci.org/virgild/resumetools.svg?branch=master)](https://travis-ci.org/virgild/resumetools)
7
+ [![Code Climate](https://codeclimate.com/github/virgild/resumetools/badges/gpa.svg)](https://codeclimate.com/github/virgild/resumetools)
8
+ [![Test Coverage](https://codeclimate.com/github/virgild/resumetools/badges/coverage.svg)](https://codeclimate.com/github/virgild/resumetools)
7
9
 
8
10
  DESCRIPTION:
9
11
  ------------
@@ -76,11 +78,7 @@ CODE:
76
78
 
77
79
  The source code is available at:
78
80
 
79
- http://codaset.com/virgil/resumetools
80
-
81
- To get the source code using git:
82
-
83
- $ git clone git://codaset.com/virgil/resumetools.git
81
+ https://github.com/virgild/resumetools
84
82
 
85
83
 
86
84
  USAGE:
@@ -104,6 +102,15 @@ Building a resume model
104
102
  section.para = "Work as a physicist and create a time machine"
105
103
  end
106
104
 
105
+ # Render to text
106
+ puts myresume.render_plain_text
107
+
108
+ # Render to JSON
109
+ myresume.render_json
110
+
111
+ # Render to PDF file (named 'resume.pdf')
112
+ File.open("resume.pdf", "w") { |file| file.write(myresume.render_pdf) }
113
+
107
114
 
108
115
  EXAMPLES:
109
116
  ---------
@@ -2,7 +2,7 @@
2
2
 
3
3
  #--
4
4
  # Copyright (c) 2009 Virgil Dimaguila
5
- #
5
+ #
6
6
  # Permission is hereby granted, free of charge, to any person
7
7
  # obtaining a copy of this software and associated documentation
8
8
  # files (the "Software"), to deal in the Software without
@@ -11,10 +11,10 @@
11
11
  # copies of the Software, and to permit persons to whom the
12
12
  # Software is furnished to do so, subject to the following
13
13
  # conditions:
14
- #
14
+ #
15
15
  # The above copyright notice and this permission notice shall be
16
16
  # included in all copies or substantial portions of the Software.
17
- #
17
+ #
18
18
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
19
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
20
  # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -28,7 +28,7 @@
28
28
  module ResumeTools
29
29
  module Renderer
30
30
  module PDF
31
-
31
+
32
32
  FONT_DIR = File.join(File.dirname(__FILE__), '..', '..', 'fonts')
33
33
  MARGINS = [1.0, 1.0, 1.0, 1.0]
34
34
  FONT_SIZES = {
@@ -41,7 +41,7 @@ module ResumeTools
41
41
  :period => 10
42
42
  }
43
43
  DATE_FORMAT = "%B, %Y"
44
-
44
+
45
45
  # Render to PDF
46
46
  def render_pdf(opts={})
47
47
  pdf = Prawn::Document.new(
@@ -51,7 +51,7 @@ module ResumeTools
51
51
  :bottom_margin => MARGINS[2].in,
52
52
  :right_margin => MARGINS[3].in
53
53
  )
54
-
54
+
55
55
  pdf.font_families.update(
56
56
  "VeraSans" => {
57
57
  :normal => File.expand_path("Vera.ttf", FONT_DIR),
@@ -60,79 +60,78 @@ module ResumeTools
60
60
  :bold_italic => File.expand_path("VeraBI.ttf", FONT_DIR)
61
61
  }
62
62
  )
63
-
63
+
64
64
  # Set default font
65
65
  pdf.font("Helvetica", :style => :normal, :size => FONT_SIZES[:default], :kerning => true)
66
-
66
+
67
67
  # Name
68
68
  pdf.text self.full_name, :style => :bold, :size => FONT_SIZES[:header], :align => :center
69
-
69
+
70
70
  # Contact info
71
71
  self.header_lines.each do |line|
72
72
  pdf.text line, :align => :center
73
73
  end
74
-
74
+
75
75
  pdf.pad_bottom 20 do
76
76
  end
77
-
77
+
78
78
  # Sections
79
79
  self.sections.each do |section|
80
80
  pdf.pad_top(20) do
81
81
  # Section title
82
82
  pdf.text section.title, :style => :bold, :size => FONT_SIZES[:section]
83
-
83
+
84
84
  # Section paragraph
85
85
  unless section.para.blank?
86
86
  pdf.span(pdf.bounds.width - 10, :position => 10) do
87
87
  pdf.pad_top(5) { pdf.text section.para, :size => FONT_SIZES[:para] }
88
88
  end
89
89
  end
90
-
90
+
91
91
  # Section items
92
92
  unless section.items.empty?
93
- pdf.table section.items.map { |item| [" •", item.text] },
94
- :font_size => FONT_SIZES[:item],
95
- :column_widths => { 0 => 20, 1 => 420 },
96
- :border_style => :none,
97
- :border_color => "ffffff",
98
- :vertical_padding => 4,
99
- :horizontal_padding => 0,
100
- :align => { 0 => :left, 1 => :left }
93
+ pdf.table(section.items.map { |item| [" •", item.text] }, :cell_style => {
94
+ :borders => []
95
+ })
96
+ # , cell_style: {
97
+ # :font_size => FONT_SIZES[:item],
98
+ # :border_style => :none,
99
+ # :border_color => "ffffff",
100
+ # :vertical_padding => 4,
101
+ # :horizontal_padding => 0,
102
+ # :align => { 0 => :left, 1 => :left },
103
+ # :column_widths => { 0 => 20, 1 => 420 }
104
+ # }
101
105
  end
102
-
106
+
103
107
  # Periods
104
- section.periods.each do |period|
108
+ section.periods.each do |period|
105
109
  pdf.pad_top(5) do
106
110
  # Period title
107
111
  pdf.pad_top(5) { pdf.text period.title, :style => :bold, :size => FONT_SIZES[:period] }
108
-
112
+
109
113
  # Period details
110
114
  pdf.pad_top(5) do
111
115
  pdf.text(period.line, :size => FONT_SIZES[:default])
112
116
  end
113
-
117
+
114
118
  # Period items
115
119
  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 }
120
+ pdf.table(period.items.map { |item| [" •", item.text] }, :cell_style => {
121
+ :borders => []
122
+ })
124
123
  end
125
124
  end
126
125
  end
127
126
  end
128
127
  end
129
-
128
+
130
129
  pdf.render
131
130
  end
132
131
 
133
132
  end #module PDF
134
133
  end #module Renderer
135
-
134
+
136
135
  Resume.class_eval do
137
136
  include Renderer::PDF
138
137
  end
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # Resume Tools, Copyright (c) 2009 Virgil Dimaguila
3
- #
3
+ #
4
4
  # Permission is hereby granted, free of charge, to any person
5
5
  # obtaining a copy of this software and associated documentation
6
6
  # files (the "Software"), to deal in the Software without
@@ -9,10 +9,10 @@
9
9
  # copies of the Software, and to permit persons to whom the
10
10
  # Software is furnished to do so, subject to the following
11
11
  # conditions:
12
- #
12
+ #
13
13
  # The above copyright notice and this permission notice shall be
14
14
  # included in all copies or substantial portions of the Software.
15
- #
15
+ #
16
16
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
17
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
18
  # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -25,6 +25,6 @@
25
25
 
26
26
  unless defined? ResumeTools::VERSION
27
27
  module ResumeTools
28
- VERSION = "0.2.8"
28
+ VERSION = "0.2.8.2"
29
29
  end
30
30
  end
data/lib/resumetools.rb CHANGED
@@ -24,6 +24,7 @@
24
24
  #++
25
25
 
26
26
  require "prawn"
27
+ require "prawn/table"
27
28
  require "prawn/measurement_extensions"
28
29
  require "extlib"
29
30
  require "uuidtools"
data/resumetools.gemspec CHANGED
@@ -8,12 +8,12 @@ Gem::Specification.new do |s|
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["Virgil Dimaguila"]
11
- s.date = "2015-01-20"
11
+ s.date = "2015-01-21"
12
12
  s.description = "Resume generation and writing tools\n"
13
13
  s.email = "virgil@roundysoft.com"
14
- s.files = ["CHANGES", "Gemfile", "Gemfile.lock", "LICENSE", "README.md", "Rakefile", "examples", "examples/sample.pdf", "examples/sample.resume", "lib", "lib/fonts", "lib/fonts/Vera.ttf", "lib/fonts/VeraBI.ttf", "lib/fonts/VeraBd.ttf", "lib/fonts/VeraIt.ttf", "lib/resumetools", "lib/resumetools.rb", "lib/resumetools/grammars", "lib/resumetools/grammars/resume.treetop", "lib/resumetools/resume", "lib/resumetools/resume/export.rb", "lib/resumetools/resume/json.rb", "lib/resumetools/resume/pdf.rb", "lib/resumetools/resume/plain_text.rb", "lib/resumetools/resume/resume.rb", "lib/resumetools/resume/text_reader.rb", "lib/resumetools/version.rb", "lib/text", "lib/text/format.rb", "resumetools.gemspec", "script", "spec", "spec/grammar_spec.rb", "spec/read_resume_spec.rb", "spec/rendering_pdf_spec.rb", "spec/resume_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks", "tasks/default.rake", "tasks/gem.rake", "tasks/rdoc.rake", "tasks/rspec.rake", "vendor"]
15
- s.homepage = "https://github.com/virgild/resumetools"
16
- s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
14
+ s.files = ["CHANGES", "Gemfile", "Gemfile.lock", "LICENSE", "README.md", "Rakefile", "doc", "examples", "examples/sample.pdf", "examples/sample.resume", "lib", "lib/fonts", "lib/fonts/Vera.ttf", "lib/fonts/VeraBI.ttf", "lib/fonts/VeraBd.ttf", "lib/fonts/VeraIt.ttf", "lib/resumetools", "lib/resumetools.rb", "lib/resumetools/grammars", "lib/resumetools/grammars/resume.treetop", "lib/resumetools/resume", "lib/resumetools/resume/export.rb", "lib/resumetools/resume/json.rb", "lib/resumetools/resume/pdf.rb", "lib/resumetools/resume/plain_text.rb", "lib/resumetools/resume/resume.rb", "lib/resumetools/resume/text_reader.rb", "lib/resumetools/version.rb", "lib/text", "lib/text/format.rb", "pkg", "resumetools.gemspec", "script", "spec", "spec/grammar_spec.rb", "spec/read_resume_spec.rb", "spec/rendering_pdf_spec.rb", "spec/resume_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks", "tasks/default.rake", "tasks/gem.rake", "tasks/rdoc.rake", "tasks/rspec.rake", "vendor"]
15
+ s.homepage = "http://virgild.github.io/resumetools"
16
+ s.required_ruby_version = Gem::Requirement.new(">= 2.0.0")
17
17
  s.rubyforge_project = "resumetools"
18
18
  s.rubygems_version = "2.4.5"
19
19
  s.summary = "Resume generation and writing tools"
@@ -22,29 +22,32 @@ Gem::Specification.new do |s|
22
22
  s.specification_version = 4
23
23
 
24
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- s.add_development_dependency(%q<rake>, [">= 0.8.7"])
26
- s.add_development_dependency(%q<rspec>, [">= 1.2.8"])
27
- s.add_runtime_dependency(%q<extlib>, [">= 0"])
28
- s.add_runtime_dependency(%q<prawn>, [">= 0.7.1"])
29
- s.add_runtime_dependency(%q<treetop>, [">= 1.3.0"])
30
- s.add_runtime_dependency(%q<json_pure>, [">= 0"])
31
- s.add_runtime_dependency(%q<uuidtools>, [">= 0"])
25
+ s.add_development_dependency(%q<rake>, [">= 10.4.0"])
26
+ s.add_development_dependency(%q<rspec>, [">= 3.1.0"])
27
+ s.add_runtime_dependency(%q<extlib>, [">= 0.9.16"])
28
+ s.add_runtime_dependency(%q<prawn>, [">= 1.3.0"])
29
+ s.add_runtime_dependency(%q<prawn-table>, [">= 0.2.1"])
30
+ s.add_runtime_dependency(%q<treetop>, [">= 1.5.3"])
31
+ s.add_runtime_dependency(%q<json_pure>, [">= 1.8.2"])
32
+ s.add_runtime_dependency(%q<uuidtools>, [">= 2.1.5"])
32
33
  else
33
- s.add_dependency(%q<rake>, [">= 0.8.7"])
34
- s.add_dependency(%q<rspec>, [">= 1.2.8"])
35
- s.add_dependency(%q<extlib>, [">= 0"])
36
- s.add_dependency(%q<prawn>, [">= 0.7.1"])
37
- s.add_dependency(%q<treetop>, [">= 1.3.0"])
38
- s.add_dependency(%q<json_pure>, [">= 0"])
39
- s.add_dependency(%q<uuidtools>, [">= 0"])
34
+ s.add_dependency(%q<rake>, [">= 10.4.0"])
35
+ s.add_dependency(%q<rspec>, [">= 3.1.0"])
36
+ s.add_dependency(%q<extlib>, [">= 0.9.16"])
37
+ s.add_dependency(%q<prawn>, [">= 1.3.0"])
38
+ s.add_dependency(%q<prawn-table>, [">= 0.2.1"])
39
+ s.add_dependency(%q<treetop>, [">= 1.5.3"])
40
+ s.add_dependency(%q<json_pure>, [">= 1.8.2"])
41
+ s.add_dependency(%q<uuidtools>, [">= 2.1.5"])
40
42
  end
41
43
  else
42
- s.add_dependency(%q<rake>, [">= 0.8.7"])
43
- s.add_dependency(%q<rspec>, [">= 1.2.8"])
44
- s.add_dependency(%q<extlib>, [">= 0"])
45
- s.add_dependency(%q<prawn>, [">= 0.7.1"])
46
- s.add_dependency(%q<treetop>, [">= 1.3.0"])
47
- s.add_dependency(%q<json_pure>, [">= 0"])
48
- s.add_dependency(%q<uuidtools>, [">= 0"])
44
+ s.add_dependency(%q<rake>, [">= 10.4.0"])
45
+ s.add_dependency(%q<rspec>, [">= 3.1.0"])
46
+ s.add_dependency(%q<extlib>, [">= 0.9.16"])
47
+ s.add_dependency(%q<prawn>, [">= 1.3.0"])
48
+ s.add_dependency(%q<prawn-table>, [">= 0.2.1"])
49
+ s.add_dependency(%q<treetop>, [">= 1.5.3"])
50
+ s.add_dependency(%q<json_pure>, [">= 1.8.2"])
51
+ s.add_dependency(%q<uuidtools>, [">= 2.1.5"])
49
52
  end
50
53
  end
@@ -58,4 +58,22 @@ describe "Creating a resume from a text" do
58
58
  expect(@resume.sections[3].periods[0].dtstart).to eq "1993"
59
59
  expect(@resume.sections[3].periods[0].dtend).to eq "Present"
60
60
  end
61
+
62
+ describe "rendering to plain text" do
63
+ it "should render without errors" do
64
+ resume_text = @resume.render_plain_text
65
+ end
66
+ end
67
+
68
+ describe "rendering to JSON" do
69
+ it "should render without errors" do
70
+ resume_json = @resume.render_json
71
+ end
72
+ end
73
+
74
+ describe "rendering to PDF" do
75
+ it "should render without errors" do
76
+ pdf_data = @resume.render_pdf
77
+ end
78
+ end
61
79
  end
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # Copyright (c) 2009 Virgil Dimaguila
3
- #
3
+ #
4
4
  # Permission is hereby granted, free of charge, to any person
5
5
  # obtaining a copy of this software and associated documentation
6
6
  # files (the "Software"), to deal in the Software without
@@ -9,10 +9,10 @@
9
9
  # copies of the Software, and to permit persons to whom the
10
10
  # Software is furnished to do so, subject to the following
11
11
  # conditions:
12
- #
12
+ #
13
13
  # The above copyright notice and this permission notice shall be
14
14
  # included in all copies or substantial portions of the Software.
15
- #
15
+ #
16
16
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
17
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
18
  # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -29,7 +29,7 @@ describe "Rendering a Resume to PDF" do
29
29
  before do
30
30
  @resume = ResumeTools::Resume.new
31
31
  end
32
-
32
+
33
33
  it "should render to PDF" do
34
34
  result = @resume.render_pdf
35
35
  result.should_not be_nil
data/tasks/gem.rake CHANGED
@@ -46,6 +46,7 @@ namespace :gem do
46
46
 
47
47
  s.add_runtime_dependency("extlib", ">= 0.9.16")
48
48
  s.add_runtime_dependency("prawn", ">= 1.3.0")
49
+ s.add_runtime_dependency("prawn-table", ">= 0.2.1")
49
50
  s.add_runtime_dependency("treetop", ">= 1.5.3")
50
51
  s.add_runtime_dependency("json_pure", ">= 1.8.2")
51
52
  s.add_runtime_dependency("uuidtools", ">= 2.1.5")
@@ -54,7 +55,7 @@ namespace :gem do
54
55
 
55
56
  s.author = "Virgil Dimaguila"
56
57
  s.email = "virgil@roundysoft.com"
57
- s.homepage = "https://github.com/virgild/resumetools"
58
+ s.homepage = "http://virgild.github.io/resumetools"
58
59
  s.rubyforge_project = "resumetools"
59
60
  end
60
61
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resumetools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Virgil Dimaguila
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-20 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.3.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: prawn-table
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.2.1
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.2.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: treetop
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +162,7 @@ files:
148
162
  - tasks/gem.rake
149
163
  - tasks/rdoc.rake
150
164
  - tasks/rspec.rake
151
- homepage: https://github.com/virgild/resumetools
165
+ homepage: http://virgild.github.io/resumetools
152
166
  licenses: []
153
167
  metadata: {}
154
168
  post_install_message: