class GitCV

Public Class Methods

create(username,dir) click to toggle source
# File lib/GitCV.rb, line 6
def self.create(username,dir)
        user = Octokit.user "#{username}"
        githubImage = open("https://avatars.githubusercontent.com/#{username}?s=150")
        profileImage = File.open("#{dir}/profile.jpg",'w')

        githubImage.each do |pixel|
                profileImage.write(pixel)
        end

        profileImage.close

        Prawn::Document.generate("#{dir}/#{user.name}.pdf") do
                                image "#{dir}/profile.jpg"
                        text "Username : #{user.name} \n Followers : #{user[:followers]}
                        \n email : #{user[:email]} \n Hireable : #{user[:hireable]} \n Company : #{user[:Company]}
                        \n Following : #{user[:following]} \n Location #{user[:location]}
                        \n Public repositories : #{user[:public_repos]} \n contributions : #{user[:contributions]}
                        \n Biography : #{user[:bio]} \n #{user[:avatar]}"
        end
end