n3bulous-resume2 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown ADDED
@@ -0,0 +1,26 @@
1
+ # Resume2 ##
2
+
3
+ ## Description ##
4
+
5
+ Resume2 is a command line tool to manage your resume from a central data (YAML) file.
6
+
7
+ Right now it will process a Markdown file and merge the data into it. From there you can create a PDF or HTML via TextMate. Plenty of refinements before I even contemplate labeling it ready for public consumption.
8
+
9
+ ## Installation ##
10
+
11
+ (once the gemspec has been written and tested...)
12
+
13
+ sudo gem install n3bulous-resume2 --source=http://gems.github.com
14
+
15
+
16
+ ## Usage ##
17
+
18
+
19
+ ## TODO ##
20
+
21
+
22
+ ## License ##
23
+
24
+ Resume2 is free software; it is released under a BSD-style license that allows you to do as you wish with it as long as you don’t attempt to claim it as your own work.
25
+
26
+ By downloading this software, you agree to NOT blame the author if you fail to get a job, fail to apply for a job, or continue living in your mother's basement or garage. The author is also not responsible for any typos, either mine or yours. Use at your own risk. Software is not approved for use in mission critical systems.
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+ require 'rake/testtask'
4
+
5
+ require 'lib/resume2/version'
6
+
7
+ task :default => :test
8
+
9
+ spec = Gem::Specification.new do |s|
10
+ s.name = 'resume2'
11
+ s.version = Resume2::Version.to_s
12
+ s.has_rdoc = true
13
+ s.extra_rdoc_files = %w(README.markdown)
14
+ s.rdoc_options = %w(--main README.markdown)
15
+ s.summary = "Manage your resume information in a central YAML file and then export it into different formats and themes."
16
+ s.author = 'Kevin McFadden'
17
+ s.email = 'kevin+github@conceptsahead.com'
18
+ s.homepage = 'http://conceptsahead.com'
19
+ s.files = %w(README.markdown Rakefile) + Dir.glob("{lib,test}/**/*")
20
+ s.executables = ['resume2']
21
+
22
+ s.add_dependency('rdiscount', '~> 1.2.0')
23
+ end
24
+
25
+ Rake::GemPackageTask.new(spec) do |pkg|
26
+ pkg.gem_spec = spec
27
+ end
28
+
29
+ Rake::TestTask.new do |t|
30
+ t.libs << 'test'
31
+ t.test_files = FileList["test/**/*_test.rb"]
32
+ t.verbose = true
33
+ end
34
+
35
+ desc 'Generate the gemspec to serve this Gem from Github'
36
+ task :github do
37
+ file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
38
+ File.open(file, 'w') {|f| f << spec.to_ruby }
39
+ puts "Created gemspec: #{file}"
40
+ end
data/bin/resume2 ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # For testing only...
4
+ begin
5
+ require 'resume2'
6
+ rescue LoadError => exception
7
+ $:.unshift File.dirname(File.expand_path(__FILE__)) + "/../lib"
8
+ retry
9
+ end
10
+
11
+ resume2app = Resume2Application.new
12
+ resume2app.run
data/lib/resume2.rb ADDED
@@ -0,0 +1,10 @@
1
+ $:.unshift File.dirname(__FILE__)
2
+
3
+ require 'rubygems'
4
+ require 'rdiscount'
5
+ require 'erb'
6
+ require 'ostruct'
7
+
8
+ require 'resume2/version'
9
+ require 'resume2/resume2_application'
10
+ require 'resume2/generator'
@@ -0,0 +1,16 @@
1
+ class Generator
2
+ def initialize(template_file, resume_file)
3
+ yaml_data = YAML::load_file(resume_file)
4
+ data = OpenStruct.new(yaml_data.to_hash)
5
+
6
+ template = IO.read(template_file)
7
+
8
+ @template_with_data = ERB.new(template, 0, ">").result(data.send(:binding))
9
+ puts @template_with_data
10
+ markdown = RDiscount.new(@template_with_data)
11
+ # puts markdown.to_html
12
+ end
13
+
14
+ def write(output, format)
15
+ end
16
+ end
@@ -0,0 +1,64 @@
1
+ # TODO: Use a .resume2 RC file for templates and resume file defaults.
2
+ class Resume2Application
3
+ DEFAULT_SOURCE_FILENAME = "resume.yml"
4
+ SUPPORTED_FORMATS = ['pdf', 'rtf', 'txt']
5
+
6
+ def run
7
+ called_as = File.basename($0)
8
+ @formats = formats_are(called_as)
9
+ @template_file = templates_are
10
+ @resume_file = source_is
11
+
12
+ generator = Generator.new(@template_file, @resume_file)
13
+
14
+ # TODO: Support output direction
15
+ # @formats.each do |format|
16
+ # generator.write format, :stdout
17
+ # end
18
+ end
19
+
20
+ private
21
+ def usage
22
+ supported_formats = SUPPORTED_FORMATS.join(", ")
23
+ puts "resume2[format] [format] path-to-template [resume.yml]"
24
+ puts " examples:"
25
+ puts " resume2 txt templates/fancy.markdown resume.yml"
26
+ puts " resume2txt templates/clean.markdown"
27
+ puts " Supported formats: " + supported_formats
28
+
29
+ Process.exit!
30
+ end
31
+
32
+ def formats_are(filename)
33
+ format_name = filename.split("2", 2)[1]
34
+ if format_name.length == 0
35
+ ARGV.size > 1 ? format_name = ARGV[0] : usage
36
+ end
37
+
38
+ formats = case format_name
39
+ when "all": SUPPORTED_FORMATS
40
+ else [format_name]
41
+ end
42
+
43
+ return formats
44
+ end
45
+
46
+ def templates_are
47
+ templates = case ARGV.size
48
+ when 1: ARGV[0]
49
+ when 2: @formats.include?(ARGV[0]) ? ARGV[1] : ARGV[0]
50
+ when 3: ARGV[1]
51
+ else usage
52
+ end
53
+
54
+ return templates
55
+ end
56
+
57
+ def source_is
58
+ source = case ARGV.size
59
+ when 1: DEFAULT_SOURCE_FILENAME
60
+ when 2: @formats.include?(ARGV[0]) ? DEFAULT_SOURCE_FILENAME : ARGV[-1]
61
+ else ARGV[-1]
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,13 @@
1
+ module Resume2
2
+ module Version
3
+
4
+ MAJOR = 0
5
+ MINOR = 2
6
+ TINY = 0
7
+
8
+ def self.to_s # :nodoc:
9
+ [MAJOR, MINOR, TINY].join('.')
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ # http://sneaq.net/textmate-wtf
2
+ $:.reject! { |e| e.include? 'TextMate' }
3
+
4
+ require 'rubygems'
5
+ require 'test/unit'
6
+ require 'matchy'
7
+ require 'context'
8
+ require 'mocha'
9
+
10
+ require File.dirname(__FILE__) + '/../lib/resume2'
@@ -0,0 +1,13 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class Resume2Test < Test::Unit::TestCase
4
+
5
+ describe "An instance of the Resume2 class" do
6
+
7
+ it "should flunk" do
8
+ flunk "Please provide some tests"
9
+ end
10
+
11
+ end
12
+
13
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: n3bulous-resume2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Kevin McFadden
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-18 00:00:00 -08:00
13
+ default_executable: resume2
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rdiscount
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 1.2.0
23
+ version:
24
+ description:
25
+ email: kevin+github@conceptsahead.com
26
+ executables:
27
+ - resume2
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - README.markdown
32
+ files:
33
+ - README.markdown
34
+ - Rakefile
35
+ - lib/resume2
36
+ - lib/resume2/generator.rb
37
+ - lib/resume2/resume2_application.rb
38
+ - lib/resume2/version.rb
39
+ - lib/resume2.rb
40
+ - test/test_helper.rb
41
+ - test/unit
42
+ - test/unit/resume2_test.rb
43
+ - bin/resume2
44
+ has_rdoc: true
45
+ homepage: http://conceptsahead.com
46
+ post_install_message:
47
+ rdoc_options:
48
+ - --main
49
+ - README.markdown
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ requirements: []
65
+
66
+ rubyforge_project:
67
+ rubygems_version: 1.2.0
68
+ signing_key:
69
+ specification_version: 2
70
+ summary: Manage your resume information in a central YAML file and then export it into different formats and themes.
71
+ test_files: []
72
+