Sha256: b943921bd9acb3e19e99e580a44c919544418171cd8012b1d6569df4756355ed
Contents?: true
Size: 1.97 KB
Versions: 1
Compression:
Stored size: 1.97 KB
Contents
#!/usr/bin/env ruby -W # Copyright (c) 2015 Scott Williams $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + "/../lib") require "issue_exporter/cli" module IssueExporting class Command include CLI def about VERSION end def usage <<HERE Download all open issues from a GitHub repository. Usage: #{$PROGRAM_NAME} [OPTION]... [OWNER] [REPO] [TOKEN] Example: #{$PROGRAM_NAME} swilliams issue_exporter abcdef --closed include closed issues (default: false) --multiple-files Use a separate file for each issue (default: one single file) -o, --output DIRECTORY set output path (default: current working directory) --output-type TYPE sets the filetype (csv or file) (default: file) -h, --help display this help and exit --version display the version HERE end def initialize super @output = nil @multiple_files = false @include_closed_issues = false @output_type = 'file' end def correct_number_of_args(arg_count) arg_count == 3 end def define_options(opts) opts.on("-o", "--output ARG") { |arg| @output = arg } opts.on("--multiple-files") { @multiple_files = true } opts.on("--closed") { @include_closed_issues = true } opts.on("--output-type ARG") { |arg| @output_type = arg } end def process_input(arg, index) case index when 0 @owner = arg when 1 @repo = arg when 2 @token = arg end end def perform_action options = { path: @output, multiple_files: @multiple_files, include_closed_issues: @include_closed_issues, output_type: @output_type } exporter = IssueExporting::Exporter.new(@owner, @repo, @token, options) exporter.export end end end IssueExporting::Command.new.run
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
github_issue_exporter-0.3.0 | bin/export-github-issues |