Class: Gitdig::Commands::Config::Org

Inherits:
Gitdig::Command show all
Defined in:
lib/gitdig/commands/config/org.rb

Constant Summary

Constants inherited from Gitdig::Command

Gitdig::Command::CONFIG_FILE

Instance Method Summary collapse

Methods inherited from Gitdig::Command

#command, #configs, #cursor, #editor, #exec_exist?, #generator, #github_client, #pager, #platform, #prompt, #screen, #which

Constructor Details

#initialize(name, options) ⇒ Org

Returns a new instance of Org.



9
10
11
12
# File 'lib/gitdig/commands/config/org.rb', line 9

def initialize(name, options)
  @name = name
  @options = options
end

Instance Method Details

#execute(input: $stdin, output: $stdout) ⇒ Object



14
15
16
17
18
# File 'lib/gitdig/commands/config/org.rb', line 14

def execute(input: $stdin, output: $stdout)
  configs.set(:org, value: @name)
  configs.write(force: true)
  output.puts 'OK'
end