Class: BrandKit

Inherits:
Object
  • Object
show all
Defined in:
lib/brand_kit.rb

Overview

BrandKit CLI app for checking domain and social media username availability

Instance Method Summary collapse

Constructor Details

#initializeBrandKit

Initialize the CLI with prompt, ASCII art generator, and JSON output flag



17
18
19
20
21
# File 'lib/brand_kit.rb', line 17

def initialize
  @prompt = TTY::Prompt.new
  @artii = Artii::Base.new
  @json_output = ARGV.include?('--json')
end

Instance Method Details

#runObject

Main entry point to run the app flow:

  1. Show intro banner

  2. Get domain input from args or prompt

  3. Check domain availability

  4. Show domain result with purchase link if available

  5. Optionally check social username availability

  6. Show farewell banner



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/brand_kit.rb', line 30

def run
  intro_banner
  
  domain = extract_domain_from_argv || prompt_for_domain
  domain_result = DomainChecker.new(domain).check
  
  show_result_box(domain_result[:message], :green)
  
  print_purchase_link(domain_result) if domain_result[:link]
  
  ask_social_check(domain_result[:domain])
  farewell_banner
end