class Git::Duet::SoloCommand
Attributes
soloist[RW]
Public Class Methods
new(soloist, quiet = false, global = false)
click to toggle source
# File lib/git/duet/solo_command.rb, line 11 def initialize(soloist, quiet = false, global = false) @soloist = soloist @quiet = !!quiet @global = !!global @author_mapper = Git::Duet::AuthorMapper.new end
Public Instance Methods
execute!()
click to toggle source
# File lib/git/duet/solo_command.rb, line 18 def execute! unset_committer_vars if soloist set_soloist_as_git_config_user report_env_vars write_env_vars else show_current_config end end
Private Instance Methods
set_soloist_as_git_config_user()
click to toggle source
# File lib/git/duet/solo_command.rb, line 33 def set_soloist_as_git_config_user exec_check("#{git_config} user.name '#{soloist_info[:name]}'") exec_check("#{git_config} user.email '#{soloist_info[:email]}'") end
soloist_info()
click to toggle source
# File lib/git/duet/solo_command.rb, line 58 def soloist_info @soloist_info ||= author_mapper.map(@soloist).fetch(@soloist) rescue KeyError, IndexError => e error("git-solo: Failed to find author: #{e}") raise Git::Duet::ScriptDieError, 86 end
unset_committer_vars()
click to toggle source
# File lib/git/duet/solo_command.rb, line 38 def unset_committer_vars exec_check( "#{git_config} --unset-all #{Git::Duet::Config.namespace}." \ 'git-committer-name', [0, 5] ) exec_check( "#{git_config} --unset-all #{Git::Duet::Config.namespace}." \ 'git-committer-email', [0, 5] ) end
var_map()
click to toggle source
# File lib/git/duet/solo_command.rb, line 51 def var_map { 'GIT_AUTHOR_NAME' => soloist_info[:name], 'GIT_AUTHOR_EMAIL' => soloist_info[:email] } end