Class: Pairzone::Commands::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/pairzone/commands/info.rb

Instance Method Summary collapse

Constructor Details

#initialize(project_name) ⇒ Info

Returns a new instance of Info.



4
5
6
# File 'lib/pairzone/commands/info.rb', line 4

def initialize(project_name)
  @project_name = project_name
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
# File 'lib/pairzone/commands/info.rb', line 8

def execute
  Logger.info("<%= color('Pairzone Account Information', CYAN + BOLD) %>")
  @user = Pairzone::Api::User.current_user
  Logger.info(@user)
  Logger.info("")
  Logger.debug("Finding information about local pairzone: #{local_pairzone_name}")
  pairzone = Pairzone::Api::Pairzone.find_by_project_name(local_pairzone_name)
  Logger.info(pairzone || "No pairzone found for this directory (create one with <%= color('pairzone create', CYAN) %>).")
end