Sha256: 7183992911cdf8d656375c42269067da5dd9faf4a33f68220b6e7b1df456edd3

Contents?: true

Size: 1.93 KB

Versions: 2

Compression:

Stored size: 1.93 KB

Contents

require 'linkedin2cv/version'
require 'linkedin2cv/logging'
require 'linkedin2cv/converter'
require 'clamp'

module Linkedin2CV
  class AbstractCommand < Clamp::Command
    include Logging

    option ["-v", "--verbose"], :flag, "be verbose"
    option "--version", :flag, "show version" do
      puts "Linkedin2CV v" + Linkedin2CV::VERSION
      exit(0)
    end

  end

  class ConvertCommand < AbstractCommand
      option "--format", "format", "Specify the output format. Options are [asciidoc, latex (pdf)]", :attribute_name => :format, :default => 'latex'
      option "--options", "options", "Specify an options file with supplemental data and settings", :attribute_name => :options_file
      # option "--style", "style", "Specify the style resume you want. Options are [standard, awesome, boring] ", :attribute_name => :format, :default => 'standard'
      # option "--all-fields", :flag, "Import all supported LinkedIn fields [position, company, publication, patent, language, skills, certification, education, course, volunteer, recommendations]", :attribute_name => :all
      # option "--position", :flag, "Import Position Profile data", :default => true
      # option "--company", :flag, "Import Company Profile data", :default => true
      # option "--skills", :flag, "Import Skills Profile data", :default => true

      parameter "[output-file]", "Output file (without extension. e.g. 'output' to produce 'output.pdf', 'output.latex'", :attribute_name => :output_file, :default => 'output'

    def execute
      options = {}
      if !options_file.nil?
        options = YAML.load_file(options_file)
      end

      options['output_file'] = output_file
      options['format'] = format

      converter = Linkedin2CV::Converter.new
      converter.create_resume(options)
    end
  end

  class MainCommand < AbstractCommand
    subcommand "convert", "Magically converts your LinkedIn Profile to a professional resume", Linkedin2CV::ConvertCommand
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
linkedin2cv-0.0.2 lib/linkedin2cv/cli/command.rb
linkedin2cv-0.0.1 lib/linkedin2cv/cli/command.rb