Sha256: 7ded6c17d99cf3c7f45966596d9e022923860f62109a53737ab7077d97e82057

Contents?: true

Size: 778 Bytes

Versions: 29

Compression:

Stored size: 778 Bytes

Contents

class Lono::Blueprint
  module Helper
    extend Memoist

    def user_info
      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

      author = "author" if ENV['LONO_TEST']
      email = "email" if ENV['LONO_TEST']

      {
        :author           => author,
        :email            => email,
        :github_username  => github_username.empty? ? "[USERNAME]" : github_username,
      }
    end
    memoize :user_info
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
lono-7.5.2 lib/lono/blueprint/helper.rb
lono-7.5.1 lib/lono/blueprint/helper.rb
lono-7.5.0 lib/lono/blueprint/helper.rb
lono-7.4.11 lib/lono/blueprint/helper.rb
lono-7.4.10 lib/lono/blueprint/helper.rb
lono-7.4.9 lib/lono/blueprint/helper.rb
lono-7.4.8 lib/lono/blueprint/helper.rb
lono-7.4.7 lib/lono/blueprint/helper.rb
lono-7.4.6 lib/lono/blueprint/helper.rb
lono-7.4.5 lib/lono/blueprint/helper.rb
lono-7.4.4 lib/lono/blueprint/helper.rb
lono-7.4.3 lib/lono/blueprint/helper.rb
lono-7.4.2 lib/lono/blueprint/helper.rb
lono-7.4.1 lib/lono/blueprint/helper.rb
lono-7.4.0 lib/lono/blueprint/helper.rb
lono-7.3.2 lib/lono/blueprint/helper.rb
lono-7.3.1 lib/lono/blueprint/helper.rb
lono-7.3.0 lib/lono/blueprint/helper.rb
lono-7.2.3 lib/lono/blueprint/helper.rb
lono-7.2.2 lib/lono/blueprint/helper.rb