Class: GithubIssueSync::CLI
- Inherits:
-
Thor
- Object
- Thor
- GithubIssueSync::CLI
- Defined in:
- lib/github_issue_sync/cli.rb
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Let Thor’s required-option and unknown-command errors exit non-zero.
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
Let Thor’s required-option and unknown-command errors exit non-zero.
9 10 11 |
# File 'lib/github_issue_sync/cli.rb', line 9 def self.exit_on_failure? true end |
Instance Method Details
#export ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/github_issue_sync/cli.rb', line 40 def export token = require_token! exporter = IssueExporter.new( repo: [:repo], token: token, labels: [:labels], state: [:state] ) if (path = [:output]) exporter.call(output_path: path, io: $stderr) else exporter.call(io: $stdout) end end |
#sync ⇒ Object
69 70 71 72 73 74 |
# File 'lib/github_issue_sync/cli.rb', line 69 def sync token = require_token! syncer = IssueSyncer.new(repo: [:repo], token: token) result = syncer.call(csv_path: [:input]) $stderr.puts "Done. Updated: #{result[:updated]}, Created: #{result[:created]}" end |
#version ⇒ Object
17 18 19 |
# File 'lib/github_issue_sync/cli.rb', line 17 def version puts GithubIssueSync::VERSION end |