Class: CliTemplate::Git
- Inherits:
-
Object
- Object
- CliTemplate::Git
- Defined in:
- lib/cli_template/git.rb
Class Method Summary collapse
Class Method Details
.sh(command) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/cli_template/git.rb', line 12 def sh(command) puts "=> #{command}" stdout = `#{command}` out = stdout.strip puts "stdout #{stdout.inspect}" puts "out #{out.inspect}" return out if !out&.empty? end |
.user_email ⇒ Object
8 9 10 |
# File 'lib/cli_template/git.rb', line 8 def user_email sh "git config --get user.email" end |
.user_name ⇒ Object
4 5 6 |
# File 'lib/cli_template/git.rb', line 4 def user_name sh "git config --get user.name" end |