Class: Boxen::Preflight::Identity

Inherits:
Boxen::Preflight show all
Defined in:
lib/boxen/preflight/identity.rb

Instance Attribute Summary

Attributes inherited from Check

#config

Instance Method Summary collapse

Methods inherited from Check

#abort, checks, #initialize, register, run, #warn

Constructor Details

This class inherits a constructor from Boxen::Check

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/boxen/preflight/identity.rb', line 4

def ok?
  !user || (config.email && config.name)
end

#runObject



8
9
10
11
# File 'lib/boxen/preflight/identity.rb', line 8

def run
  config.email = user.email
  config.name  = user.name
end

#userObject



13
14
15
# File 'lib/boxen/preflight/identity.rb', line 13

def user
  @user ||= config.api.user rescue nil
end