Class: GHI::Commands::Config
- Defined in:
- lib/ghi/commands/config.rb
Constant Summary
Constants included from Formatting
Formatting::CURSOR, Formatting::THROBBERS
Constants included from Formatting::Colors
Formatting::Colors::ANSI, Formatting::Colors::WEB
Instance Attribute Summary
Attributes inherited from Command
Attributes included from Formatting
Instance Method Summary collapse
Methods inherited from Command
#api, #assigns, execute, #initialize, #repo, #repo=
Methods included from Formatting
#columns, #dimensions, #format_comment, #format_comment_editor, #format_comments_and_events, #format_date, #format_editor, #format_event, #format_event_type, #format_issue, #format_issues, #format_issues_header, #format_labels, #format_markdown, #format_milestone, #format_milestone_editor, #format_milestones, #format_number, #format_state, #format_tag, #format_username, #indent, #page, #paginate?, #paging?, #past_due?, #percent, #puts, #throb, #truncate
Methods included from Formatting::Colors
#bg, #blink, #bright, #colorize?, colorize?, #fg, #highlight, #inverse, #no_color, #to_hex, #underline
Constructor Details
This class inherits a constructor from GHI::Commands::Command
Instance Method Details
#execute ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ghi/commands/config.rb', line 21 def execute global = true .parse! args.empty? ? %w(-h) : args if action == 'auth' assigns[:password] = Authorization.password || get_password Authorization.( assigns[:username], assigns[:password], assigns[:local] ) end end |
#options ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ghi/commands/config.rb', line 4 def OptionParser.new do |opts| opts. = <<EOF usage: ghi config [options] EOF opts.separator '' opts.on '--local', 'set for local repo only' do assigns[:local] = true end opts.on '--auth [<username>]' do |username| self.action = 'auth' assigns[:username] = username || Authorization.username end opts.separator '' end end |