linkedin2cv 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.buildpacks +2 -0
  3. data/.bundle/config +1 -0
  4. data/.gitignore +7 -0
  5. data/.node +1 -0
  6. data/.travis.yml +21 -0
  7. data/Gemfile +5 -0
  8. data/Gemfile.lock +119 -0
  9. data/Procfile +3 -0
  10. data/README.md +32 -0
  11. data/Rakefile +6 -0
  12. data/Vagrantfile +16 -0
  13. data/app/routes/api.rb +101 -0
  14. data/app/routes/web.rb +132 -0
  15. data/app/views/hello.erb +36 -0
  16. data/app/views/home.erb +12 -0
  17. data/app/views/index.haml +11 -0
  18. data/app.rb +26 -0
  19. data/config.ru +6 -0
  20. data/config.yml +31 -0
  21. data/lib/linkedin2cv/cli/command.rb +46 -0
  22. data/lib/linkedin2cv/converter.rb +116 -0
  23. data/lib/linkedin2cv/logging.rb +35 -0
  24. data/lib/linkedin2cv/renderer/latex_renderer.rb +64 -0
  25. data/lib/linkedin2cv/version.rb +3 -0
  26. data/linkedin2cv.gemspec +49 -0
  27. data/public/.bowerrc +3 -0
  28. data/public/.editorconfig +21 -0
  29. data/public/.gitattributes +1 -0
  30. data/public/.gitignore +5 -0
  31. data/public/.jshintrc +24 -0
  32. data/public/.travis.yml +7 -0
  33. data/public/Gruntfile.js +487 -0
  34. data/public/app/.buildignore +1 -0
  35. data/public/app/.htaccess +543 -0
  36. data/public/app/404.html +157 -0
  37. data/public/app/favicon.ico +0 -0
  38. data/public/app/images/yeoman.png +0 -0
  39. data/public/app/index.html +73 -0
  40. data/public/app/robots.txt +3 -0
  41. data/public/app/scripts/app.js +20 -0
  42. data/public/app/scripts/controllers/main.js +21 -0
  43. data/public/app/scripts/services/linkedin2cv.js +93 -0
  44. data/public/app/styles/main.scss +95 -0
  45. data/public/app/views/main.html +23 -0
  46. data/public/bower.json +19 -0
  47. data/public/karma-e2e.conf.js +54 -0
  48. data/public/karma.conf.js +56 -0
  49. data/public/package.json +41 -0
  50. data/public/test/.jshintrc +36 -0
  51. data/public/test/runner.html +10 -0
  52. data/public/test/spec/controllers/main.js +22 -0
  53. data/public/test/spec/services/happyapi.js +18 -0
  54. data/public/test/spec/services/happyservice.js +18 -0
  55. data/spec/converter_spec.rb +83 -0
  56. data/spec/mocks/config.yml +31 -0
  57. data/spec/mocks/profile.json +866 -0
  58. data/spec/spec_helper.rb +13 -0
  59. data/templates/cv.erb +327 -0
  60. data/templates/foo.asciidoc +11 -0
  61. data/templates/foo.latex +230 -0
  62. data/test.rb +109 -0
  63. data/test.sh +6 -0
  64. data/teust.rb +75 -0
  65. metadata +434 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d62bfd1c1f730f996da843ce11a63b400f3c7cbb
4
+ data.tar.gz: 72139b2c8f2d664429de8b33c876ade5463207ba
5
+ SHA512:
6
+ metadata.gz: d18f5df837e060d5b5fb79bff0ec69b2c50fda290e2f9027d2aa78e3e38355cb6f0e6f0f3494648194601943f0180bbe0d8e1f442b394000990781ed9d8d2f03
7
+ data.tar.gz: 8f918db4c0368dcac90545a67222c7654bb6d0f66da04b1bb9827ac1ebc4667da39999c61dd0e844950671fbf4d0095dfa3a85d7308e7d17ab7600f6ff9614d7
data/.buildpacks ADDED
@@ -0,0 +1,2 @@
1
+ https://github.com/heroku/heroku-buildpack-ruby.git
2
+ https://github.com/mefellows/heroku-buildpack-nodejs
data/.bundle/config ADDED
@@ -0,0 +1 @@
1
+ --- {}
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ .idea/
2
+ .sass-cache/
3
+ *.gem
4
+ bin/*
5
+ !bin/placeholder
6
+ .env
7
+ .token
data/.node ADDED
@@ -0,0 +1 @@
1
+ public
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - 2.1.1
7
+ - 2.1.0
8
+ deploy:
9
+ - provider: heroku
10
+ api_key:
11
+ secure: Lv2f5VTR98m6pAcdE2g6mZKxr3bfNmY8hQtF5ItLdijWjX0G3P+fVPvtIfeBlYtmJAblHIItVpANnjpBL1M/Bi4HT77VDnKI9Ss2paah6fppkO+6LIWkR0pOHUxSTGNkHF7x7uRtu1/GPRHu/yysnnFJKQoWTtbMcXlU6n5hGK0=
12
+ app: linkedin2cv -generator
13
+ on:
14
+ repo: mefellows/linkedin2cv -generator
15
+ - provider: rubygems
16
+ api_key:
17
+ secure: Db23e9FQhY3Re/UEs0nvR+Gn6ji0sO4jnTO+FY6m69LhAcAL4Sfs4kSP287h70HCi/dCYvgTPrzR8R3ihPthBAjCBVVJ/SHeP25k8zfJAtMhFI+9Rvgas0jFfQFA4jTyLqMUeZZQsH6YnPRYcayHMzl53inRTWlSlnvUXQWoKEA=
18
+ gem: linkedin2cv -generator
19
+ on:
20
+ tags: true
21
+ repo: mefellows/linkedin2cv -generator
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+ ruby '2.0.0'
3
+
4
+ # Specify your gem's dependencies in substantiate-analyser.gemspec
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,119 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ linkedin2cv (0.0.1)
5
+ asciidoctor
6
+ clamp
7
+ dotenv
8
+ em-websocket (= 0.3.6)
9
+ eventmachine
10
+ foreman
11
+ haml
12
+ json
13
+ launchy
14
+ linkedin-oauth2
15
+ log4r
16
+ rake
17
+ rspec
18
+ sinatra
19
+ sinatra-contrib
20
+ sinatra-param
21
+ sinatra-websocket
22
+ thin
23
+ tilt
24
+
25
+ GEM
26
+ remote: https://rubygems.org/
27
+ specs:
28
+ addressable (2.3.6)
29
+ asciidoctor (0.1.4)
30
+ backports (3.6.0)
31
+ clamp (0.6.3)
32
+ crack (0.4.2)
33
+ safe_yaml (~> 1.0.0)
34
+ daemons (1.1.9)
35
+ diff-lcs (1.2.5)
36
+ dotenv (0.11.1)
37
+ dotenv-deployment (~> 0.0.2)
38
+ dotenv-deployment (0.0.2)
39
+ em-websocket (0.3.6)
40
+ addressable (>= 2.1.1)
41
+ eventmachine (>= 0.12.9)
42
+ eventmachine (1.0.3)
43
+ faraday (0.9.0)
44
+ multipart-post (>= 1.2, < 3)
45
+ foreman (0.71.0)
46
+ dotenv (~> 0.11.1)
47
+ thor (~> 0.19.1)
48
+ haml (4.0.5)
49
+ tilt
50
+ hashie (2.0.5)
51
+ json (1.8.1)
52
+ jwt (1.0.0)
53
+ launchy (2.4.2)
54
+ addressable (~> 2.3)
55
+ linkedin-oauth2 (0.1.1)
56
+ hashie (>= 1.2, < 2.1)
57
+ multi_json (~> 1.0)
58
+ oauth2 (~> 0.8)
59
+ log4r (1.1.10)
60
+ multi_json (1.10.1)
61
+ multi_xml (0.5.5)
62
+ multipart-post (2.0.0)
63
+ oauth2 (0.9.4)
64
+ faraday (>= 0.8, < 0.10)
65
+ jwt (~> 1.0)
66
+ multi_json (~> 1.3)
67
+ multi_xml (~> 0.5)
68
+ rack (~> 1.2)
69
+ rack (1.5.2)
70
+ rack-protection (1.5.3)
71
+ rack
72
+ rack-test (0.6.2)
73
+ rack (>= 1.0)
74
+ rake (10.3.2)
75
+ rspec (2.99.0)
76
+ rspec-core (~> 2.99.0)
77
+ rspec-expectations (~> 2.99.0)
78
+ rspec-mocks (~> 2.99.0)
79
+ rspec-core (2.99.0)
80
+ rspec-expectations (2.99.0)
81
+ diff-lcs (>= 1.1.3, < 2.0)
82
+ rspec-mocks (2.99.0)
83
+ safe_yaml (1.0.3)
84
+ sinatra (1.4.5)
85
+ rack (~> 1.4)
86
+ rack-protection (~> 1.4)
87
+ tilt (~> 1.3, >= 1.3.4)
88
+ sinatra-contrib (1.4.2)
89
+ backports (>= 2.0)
90
+ multi_json
91
+ rack-protection
92
+ rack-test
93
+ sinatra (~> 1.4.0)
94
+ tilt (~> 1.3)
95
+ sinatra-param (1.2.2)
96
+ sinatra (~> 1.3)
97
+ sinatra-websocket (0.3.0)
98
+ em-websocket (~> 0.3.6)
99
+ eventmachine
100
+ thin (>= 1.3.1)
101
+ thin (1.6.2)
102
+ daemons (>= 1.0.9)
103
+ eventmachine (>= 1.0.0)
104
+ rack (>= 1.0.0)
105
+ thor (0.19.1)
106
+ tilt (1.4.1)
107
+ webmock (1.18.0)
108
+ addressable (>= 2.3.6)
109
+ crack (>= 0.3.2)
110
+
111
+ PLATFORMS
112
+ ruby
113
+
114
+ DEPENDENCIES
115
+ bundler
116
+ linkedin2cv!
117
+ rake
118
+ rspec
119
+ webmock
data/Procfile ADDED
@@ -0,0 +1,3 @@
1
+ # web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
2
+ web: bundle exec thin start -p $PORT
3
+ #web: bundle exec puma -p $PORT
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ LinkedIn 2 CV
2
+ ==============
3
+
4
+ Turn your LinkedIn Profile into a professional resume in many formats (PDF / HTML5 / Latex / Asciidoc)
5
+
6
+ ## Motivations
7
+
8
+ Everyone stalks you on LinkedIn and that's where you get opportunities. But apparently you still need to give a resume/CV before you have your next job interview. So, rather than duplicate efforts you can focus on writing it once well, and then producing a resume in whatever format you want!
9
+
10
+ Oh, and don't bother using the LinkedIn 'Export to PDF' feature - it sucks.
11
+
12
+ ## Getting Started
13
+
14
+ First, install [MacTex](http://www.tug.org/mactex/) so that you can produce LaTeX documents. Then, simply run the converter:
15
+
16
+ gem install linkedin2resume
17
+ linkedin2cv convert --format latex --options config.yml matt.fellows
18
+
19
+ The converter should open up a Web Browser and ask you to sign-in to LinkedIn, enabling it to pull down your profile and convert it into a pretty CV.
20
+
21
+ ## Custom fields/data
22
+
23
+ Some templates may display extra information, or you may choose to make the resume more intelligent. For example, LinkedIn doesn't connect your projects to your role/company. See the example config.yml file for full details.
24
+
25
+ ## Contributing your own template
26
+
27
+ TODO, sorry!
28
+
29
+ ## Acknowledgements
30
+
31
+ * Asciidoctor
32
+ * LaTeX & MacTex
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/Vagrantfile ADDED
@@ -0,0 +1,16 @@
1
+ Vagrant.configure("2") do |config|
2
+
3
+ config.vm.define "centos-64-x64-vbox4210" do |v|
4
+ v.vm.box = "centos-64-x64-vbox4210"
5
+ v.vm.hostname = "centos"
6
+ v.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box"
7
+ config.vm.network "forwarded_port", guest: 80, host: 8081
8
+ end
9
+
10
+ config.vm.provider :virtualbox do |vb|
11
+ vb.customize ["modifyvm", :id, "--memory", "256"]
12
+ end
13
+
14
+ config.vm.provision :shell, :path => "vagrant/shell/bootstrap.sh"
15
+
16
+ end
data/app/routes/api.rb ADDED
@@ -0,0 +1,101 @@
1
+ require 'sinatra/base'
2
+ require 'eventmachine'
3
+ require 'em-websocket'
4
+ require 'sinatra/reloader'
5
+ require 'sinatra/param'
6
+ require "sinatra/json"
7
+ require "json"
8
+ require "sinatra-websocket"
9
+
10
+ #
11
+ # Public: API for the Application
12
+ #
13
+ module Linkedin2CV
14
+ module Routes
15
+ class API < Sinatra::Application
16
+ helpers Sinatra::Param
17
+
18
+ configure do
19
+ set :json_encoder, :to_json
20
+ set :sockets, []
21
+ end
22
+
23
+ before do
24
+ content_type :json
25
+
26
+ # CORS ACLs
27
+ headers 'Access-Control-Allow-Origin' => '*',
28
+ 'Access-Control-Allow-Methods' => ['OPTIONS', 'GET', 'POST']
29
+ end
30
+
31
+ # CORS pre-flight
32
+ options '/*' do
33
+ 200
34
+ end
35
+
36
+ # Public: Main API entry point to run the Linkedin2CV service
37
+ #
38
+ #
39
+ get '/api/linkedin2cv /:uri' do
40
+
41
+ end
42
+
43
+
44
+ get '/socket' do
45
+ if !request.websocket?
46
+ JSON::generate({'data' => {}, 'error' => 'Invalid WebSocket request'})
47
+ else
48
+ response_obj = {'data' => {}, 'message' => 'Invalid Request'}
49
+ request.websocket do |ws|
50
+ ws.onopen do
51
+ warn("socket opened")
52
+ settings.sockets << ws
53
+ end
54
+ ws.onmessage do |msg|
55
+ EM.next_tick {
56
+ json_msg = JSON.parse(msg)
57
+
58
+ # Do not remove the 'pong' response
59
+ # TODO: move this into an abstraction somewhere so it's hidden
60
+ pong = checkPong(json_msg)
61
+ if (!pong.nil?)
62
+ response_obj = pong
63
+ elsif
64
+
65
+ # Play with request/responses
66
+ if (json_msg['message'] == 'foo')
67
+ response_obj = {'message' => 'bar'}
68
+ else
69
+ # Do something with json_msg
70
+ response_obj = {'message' => json_msg['message']}
71
+ end
72
+
73
+ end
74
+
75
+ # Send a response
76
+ settings.sockets.each{|s| s.send(JSON::generate(response_obj)) }
77
+ }
78
+ end
79
+ ws.onclose do
80
+ warn("websocket closed")
81
+ settings.sockets.delete(ws)
82
+ end
83
+ end
84
+ end
85
+ end
86
+
87
+ # Public: Keep-alive check.
88
+ #
89
+ # Defaults to look for for a 'ping' message, responds with a 'pong'
90
+ # Override this for custom behaviour.
91
+ #
92
+ def checkPong(msg)
93
+ log.debug("Checking ping pong for a ping: " + msg['message'])
94
+ if (msg['message'] == 'ping')
95
+ log.debug("Ping hit!")
96
+ response_obj = {'message' => 'pong'}
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
data/app/routes/web.rb ADDED
@@ -0,0 +1,132 @@
1
+ require 'sinatra/base'
2
+ require 'sinatra/reloader'
3
+ require 'sinatra/param'
4
+ require 'haml'
5
+ require 'linkedin-oauth2'
6
+
7
+ #
8
+ # Public: Front end API for the Linkedin2CV Generator website
9
+ #
10
+ module Linkedin2CV
11
+ module Routes
12
+ class Web < Sinatra::Application
13
+ # include Logging
14
+ use Rack::Logger
15
+
16
+ configure do
17
+ set :views, 'app/views'
18
+ set :public_folder, 'public/dist'
19
+ set :sessions, true
20
+ set :api, ENV['LINKEDIN_API_KEY']
21
+ set :secret, ENV["LINKEDIN_API_SECRET"]
22
+ set :session_secret, 'd41d8cd98f00b204e9800998ecf8427e'
23
+ set :logging, true
24
+ set :server, 'thin'
25
+ set :port, 5000
26
+
27
+ # Would like to pass as option for CLI to set false, but true otherwise
28
+ set :threaded, false # This allows sneaky thread manipulation
29
+ end
30
+
31
+ # configure :production do
32
+ # set :views, 'app/views'
33
+ # set :public_folder, 'public/dist'
34
+ # set :sessions, true
35
+ # end
36
+
37
+ helpers do
38
+ def login?
39
+ !session[:atoken].nil?
40
+ end
41
+
42
+ def profile
43
+ linkedin_client.profile unless session[:atoken].nil?
44
+ end
45
+
46
+ def connections
47
+ linkedin_client.connections unless session[:atoken].nil?
48
+ end
49
+
50
+ private
51
+ def linkedin_client
52
+ client = LinkedIn::Client.new(settings.api, settings.secret, session[:atoken])
53
+ client
54
+ end
55
+
56
+ def logger
57
+ request.logger
58
+ end
59
+
60
+ end
61
+
62
+ # Public: Main HTML web page to interact with app
63
+ #
64
+ #
65
+ # get '/' do
66
+ # erb :home
67
+ # end
68
+
69
+ get "/" do
70
+ logger.info "this is interesting"
71
+ haml :index
72
+ end
73
+
74
+ # Public: Run API only temporarily for purposes of CLI client
75
+ #
76
+ #
77
+ get "/cli/auth" do
78
+ ENV['CLI_ONLY'] = 'true'
79
+ redirect "/auth"
80
+ end
81
+
82
+ get "/auth" do
83
+ logger.info "Authing..."
84
+ client = LinkedIn::Client.new(settings.api, settings.secret)
85
+ session[:authorize_url] = client.authorize_url(redirect_uri: "http://#{request.host}:#{request.port}/auth/callback")
86
+ redirect session[:authorize_url]
87
+ end
88
+
89
+ get "/auth/logout" do
90
+ session[:atoken] = nil
91
+ redirect "/"
92
+ end
93
+
94
+ get "/auth/callback" do
95
+ code = params[:code]
96
+ logger.info "Auth code received #{code}"
97
+ logger.info "OK, so getting a URL to authorize and get my access token"
98
+ client = LinkedIn::Client.new(settings.api, settings.secret)
99
+ token = client.request_access_token(code, redirect_uri: "http://#{request.host}:#{request.port}/auth/callback")
100
+ session[:atoken] = token.token
101
+
102
+ # Store in env for command line!
103
+ file = File.new('.token', 'w')
104
+ file.write(token.token)
105
+ file.close
106
+
107
+ if !ENV['CLI_ONLY'].nil?
108
+ logger.info "Got access token, shutting down!: #{session[:atoken]}"
109
+ Thread.current.thread_variable_set('access_token', token.token)
110
+ Thread.kill(Thread.current)
111
+ end
112
+
113
+ redirect "/"
114
+ end
115
+
116
+ #
117
+ # Public: 404 page
118
+ #
119
+ not_found do
120
+ 'This is nowhere to be found.'
121
+ end
122
+
123
+ #
124
+ # Public: Error page
125
+ #
126
+ error do
127
+ 'Im sorry, <a href="http://github.com/mefellows/">this guy</a>" wrote some shit code and hasnt improved it yet. He did say this was experimental though!'
128
+ end
129
+
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,36 @@
1
+ <html>
2
+ <body>
3
+ <h1>Simple Echo & Chat Server</h1>
4
+ <form id="form">
5
+ <input type="text" id="input" value="send a message"></input>
6
+ </form>
7
+ <div id="msgs"></div>
8
+ </body>
9
+
10
+ <script type="text/javascript">
11
+ window.onload = function(){
12
+ (function(){
13
+ var show = function(el){
14
+ return function(msg){ el.innerHTML = msg + '<br />' + el.innerHTML; }
15
+ }(document.getElementById('msgs'));
16
+
17
+ var url = 'ws://' + window.location.host + '/socket';
18
+ alert('opening connection to: ' + url)
19
+ var ws = new WebSocket(url);
20
+ ws.onopen = function() { show('websocket opened'); };
21
+ ws.onclose = function() { show('websocket closed'); }
22
+ ws.onmessage = function(m) { show('websocket message: ' + m.data); };
23
+
24
+ var sender = function(f){
25
+ var input = document.getElementById('input');
26
+ input.onclick = function(){ input.value = "" };
27
+ f.onsubmit = function(){
28
+ ws.send(input.value);
29
+ input.value = "send a message";
30
+ return false;
31
+ }
32
+ }(document.getElementById('form'));
33
+ })();
34
+ }
35
+ </script>
36
+ </html>
@@ -0,0 +1,12 @@
1
+ <!doctype html><!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--><!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--><!--[if gt IE 8]><!--><html class="no-js"><!--<![endif]--><head><meta charset="utf-8"><title>Linkedin2CV Generator | Generate a Linkedin2CV for your website</title><meta name="description" content=""><meta name="viewport" content="width=device-width"><!-- Place favicon.ico and apple-touch-icon.png in the root directory --><link rel="stylesheet" href="styles/vendor.css"><link rel="stylesheet" href="styles/f24dfdad.main.css"><body ng-app="linkedin2cv GeneratorApp"><!--[if lt IE 7]>
2
+ <p class="browselinkedin2cv ">You are using an <strong>outdated</strong> browser. Please <a href="http://browselinkedin2cv .com/">upgrade your browser</a> to improve your experience.</p>
3
+ <![endif]--><!-- Add your site or application content here --><div class="container" ng-view=""></div><!-- Google Analytics: change UA-XXXXX-X to be your site's ID --><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
7
+
8
+ ga('create', 'UA-XXXXX-X');
9
+ ga('send', 'pageview');</script><!--[if lt IE 9]>
10
+ <script src="bower_components/es5-shim/es5-shim.js"></script>
11
+ <script src="bower_components/json3/lib/json3.min.js"></script>
12
+ <![endif]--><script src="scripts/4e7c0841.vendor.js"></script><script src="scripts/d73d3ac9.scripts.js"></script>
@@ -0,0 +1,11 @@
1
+ -if login?
2
+ %a{:href => "/auth/logout"} Logout
3
+ %p= profile.headline
4
+ %br
5
+ %div= "Your token is #{session[:atoken]}"
6
+
7
+ -else
8
+ %a{:href => "/auth"} Login using LinkedIn
9
+
10
+ -if session[:authorize_url]
11
+ %p="yo, auth url #{session[:authorize_url]}"
data/app.rb ADDED
@@ -0,0 +1,26 @@
1
+ require 'sinatra/base'
2
+ require 'sinatra/reloader'
3
+ require './app/routes/web'
4
+ require './app/routes/api'
5
+ require 'eventmachine'
6
+
7
+ #
8
+ # Public: Front end UI and API
9
+ #
10
+ module Linkedin2CV
11
+ EventMachine.run do
12
+ class Linkedin2CVApplication < Sinatra::Application
13
+
14
+ configure { set :server, 'thin' }
15
+ use Rack::Deflater
16
+ use Linkedin2CV::Routes::API
17
+ use Linkedin2CV::Routes::Web
18
+
19
+ get '/status' do
20
+ "alive"
21
+ end
22
+
23
+ run!
24
+ end
25
+ end
26
+ end
data/config.ru ADDED
@@ -0,0 +1,6 @@
1
+ lib = File.expand_path('lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require './app'
5
+ # run Linkedin2CV::Linkedin2CVApplication
6
+ run
data/config.yml ADDED
@@ -0,0 +1,31 @@
1
+ home_phone: +61 3 9628 3624
2
+ mobile_phone: +61 422 082 738
3
+
4
+ references:
5
+ - mark:
6
+ projects: ["Melbourne IT AWS Migration \\ \"DevOps\""]
7
+ roles: ["Manager, Digital"]
8
+ first_name: Mark
9
+ last_name: Murphy
10
+ phone: +61 3 8624 2378
11
+ email: mark.murphy@melbourneit.com.au
12
+
13
+ skills:
14
+ max: 10
15
+ extra:
16
+ - technical: [Solution Design & Architecture, REST, APIs, AWS, Puppet, Automation]
17
+ - languages: [Java, PHP, Ruby, Scala]
18
+
19
+ other:
20
+ interests: [The Internet, Human Computer Interaction & Usability, Basketball, Waterskiing\Wakeboarding, Snowboarding]
21
+
22
+ projects:
23
+ - "Melbourne IT AWS Migration \\ \"DevOps\"": "Melbourne IT"
24
+ - "Melbourne IT Website Refresh (In Progress)": "Melbourne IT"
25
+ - "Startup - Mobile App (Advertising)": "Freelance"
26
+ - "Transformation": "Melbourne IT"
27
+ - "Renewal - Conversion Rate Optimisation": "Melbourne IT"
28
+ - "Skylock - Cloud-based GPS Security Portal": "Freelance"
29
+ - "Substantiate - GPS logbook solutions": "Freelance"
30
+ - "Auto-renewal": "Melbourne IT"
31
+ - "Business Transformation Programme (IWS)": "Melbourne IT"
@@ -0,0 +1,46 @@
1
+ require 'linkedin2cv/version'
2
+ require 'linkedin2cv/logging'
3
+ require 'linkedin2cv/converter'
4
+ require 'clamp'
5
+
6
+ module Linkedin2CV
7
+ class AbstractCommand < Clamp::Command
8
+ include Logging
9
+
10
+ option ["-v", "--verbose"], :flag, "be verbose"
11
+ option "--version", :flag, "show version" do
12
+ puts "Linkedin2CV v" + Linkedin2CV::VERSION
13
+ exit(0)
14
+ end
15
+
16
+ end
17
+
18
+ class ConvertCommand < AbstractCommand
19
+ option "--format", "format", "Specify the output format. Options are [asciidoc, latex (pdf)]", :attribute_name => :format, :default => 'latex'
20
+ option "--options", "options", "Specify an options file with supplemental data and settings", :attribute_name => :options_file
21
+ # option "--style", "style", "Specify the style resume you want. Options are [standard, awesome, boring] ", :attribute_name => :format, :default => 'standard'
22
+ # option "--all-fields", :flag, "Import all supported LinkedIn fields [position, company, publication, patent, language, skills, certification, education, course, volunteer, recommendations]", :attribute_name => :all
23
+ # option "--position", :flag, "Import Position Profile data", :default => true
24
+ # option "--company", :flag, "Import Company Profile data", :default => true
25
+ # option "--skills", :flag, "Import Skills Profile data", :default => true
26
+
27
+ parameter "[output-file]", "Output file (without extension. e.g. 'output' to produce 'output.pdf', 'output.latex'", :attribute_name => :output_file, :default => 'output'
28
+
29
+ def execute
30
+ options = {}
31
+ if !options_file.nil?
32
+ options = YAML.load_file(options_file)
33
+ end
34
+
35
+ options['output_file'] = output_file
36
+ options['format'] = format
37
+
38
+ converter = Linkedin2CV::Converter.new
39
+ converter.create_resume(options)
40
+ end
41
+ end
42
+
43
+ class MainCommand < AbstractCommand
44
+ subcommand "convert", "Magically converts your LinkedIn Profile to a professional resume", Linkedin2CV::ConvertCommand
45
+ end
46
+ end