Class: Git2PdfBash

Inherits:
Thor
  • Object
show all
Defined in:
bin/git2pdf

Overview

require ‘password’

Instance Method Summary collapse

Instance Method Details

#gen(repositories = "") ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'bin/git2pdf', line 13

def gen(repositories="")
  repos = repositories.split(',').collect { |r| r.strip }
  if repos.empty?
    repos = options[:repos].split(',').collect { |r| r.strip } unless options[:repos] == "repos"
  end
  puts "Creating a PDF of GitHub issues for repos: #{repos.join(', ')}"
  puts "Using organisation #{options[:organisation]}" if options[:organisation]
  pass = options[:password]
  if options[:password] == "password" or options[:password].nil? or options[:password].strip.length == 0
    #option[:password] = Password.get("GitHub Password:")
    puts "Password: "
    pass = STDIN.noecho(&:gets)
    pass = pass.strip.gsub(/\n/,'')
  end

  g = Git2Pdf.new repos: repos, basic_auth: [options[:user],pass], org: options[:organisation], user: options[:user]
  done = g.execute
  puts "\n#{done} cards output to issues.pdf"
end