Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ability to build a rubygem from rakefile

  • Loading branch information...
commit 582ef686740f47f750e2d849e8e29f9bf38b231d 1 parent 972a7ce
@danmayer authored
Showing with 18 additions and 54 deletions.
  1. +3 −0  .gitignore
  2. +0 −1  README.md
  3. +15 −3 Rakefile
  4. +0 −50 bin/resume
View
3  .gitignore
@@ -1,3 +1,6 @@
*.swp
./tmp
tmp/
+bin/*
+pkg
+*.gemspec
View
1  README.md
@@ -64,7 +64,6 @@ OPTIONAL (Publish personal resume gem)
* http://rtomayko.github.com/ronn/ (markdown to man page)
* possibly merge with a resume generator which after filling out some info via forms or yaml can generate varios resumes in all formats
* Users could submit templates / stylesheets allowing for differently formatted resumes
-
* rake task that generates proper single use gemfile and executable
* make sinatra app depend on the gem
* better filenames for the downloaded resume in various formats (currently saves as latex and markdown)
View
18 Rakefile
@@ -2,6 +2,8 @@ require 'rake/testtask'
task :default => ['test']
+GEM_NAME = "danmayer-resume"
+
desc "run sintra server locally"
task :run do
exec "ruby resume.rb"
@@ -10,19 +12,29 @@ end
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
- gem_name = "danmayer-resume"
- gemspec.name = gem_name
+ gemspec.name = GEM_NAME
gemspec.summary = "Resume gem"
gemspec.description = "A gem for Dan Mayer's resume"
gemspec.email = "dan@mayerdan.com"
gemspec.homepage = "http://github.com/danmayer/Resume"
gemspec.authors = ["Dan Mayer"]
- gemspec.executables = [gem_name]
+ gemspec.executables = [GEM_NAME]
end
+ Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
end
+task :build => [:generate_exe]
+
+desc "generate the gem executable"
+task :generate_exe do
+ puts "copying executable from template"
+ `cp lib/resume_exe bin/#{GEM_NAME}`
+ puts "giving new file chmod +x"
+ `chmod o+x bin/#{GEM_NAME}`
+end
+
desc "run all tests"
task :test do
Rake::Task['test:rack'].invoke
View
50 bin/resume
@@ -1,50 +0,0 @@
-#! /usr/bin/env ruby
-require 'main'
-require 'yaml'
-
-Main do
- option('open_html', 'o') do
- cast :boolean
- default false
- description "This will render the resume in HTML and open it on the users machine."
- end
-
- option('contact_info', 'c') do
- cast :boolean
- default false
- description "This will display contact information."
- end
-
- option('resume_site', 's') do
- cast :boolean
- default false
- description "This will open a remote site with more information about the person."
- end
-
- option('mission_statement', 'm') do
- cast :boolean
- default false
- description "This will display the mission statement."
- end
-
- def resume_run()
- require File.join(File.dirname(__FILE__), '..', 'lib', 'resume_gem')
- resume = Resume.new()
- if params['open_html'].value
- resume.open_html
- elsif params['contact_info'].value
- puts "contact info: \n#{resume.contact_information}"
- elsif params['resume_site'].value
- resume.open_resume_site
- elsif params['mission_statement'].value
- puts "mission statement: \n#{resume.mission_statement}"
- else
- help!
- end
- end
-
- def run
- resume_run
- end
-
-end
Please sign in to comment.
Something went wrong with that request. Please try again.