Module: Lono::Blueprint::Helper

Extended by:
Memoist
Included in:
New
Defined in:
lib/lono/blueprint/helper.rb

Instance Method Summary collapse

Instance Method Details

#user_infoObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/lono/blueprint/helper.rb', line 5

def 
  git_author_name = git_installed? ? `git config user.name`.chomp : ""
  git_user_email = git_installed? ? `git config user.email`.chomp : ""
  github_username = git_installed? ? `git config github.user`.chomp : ""

  {
    :author           => git_author_name.empty? ? "TODO: Write your name" : git_author_name,
    :email            => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
    :github_username  => github_username.empty? ? "[USERNAME]" : github_username,
  }
end