Class: BrandKit
- Inherits:
-
Object
- Object
- BrandKit
- Defined in:
- lib/brand_kit.rb
Overview
BrandKit CLI app for checking domain and social media username availability
Instance Method Summary collapse
-
#initialize ⇒ BrandKit
constructor
Initialize the CLI with prompt, ASCII art generator, and JSON output flag.
-
#run ⇒ Object
Main entry point to run the app flow: 1.
Constructor Details
#initialize ⇒ BrandKit
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
#run ⇒ Object
Main entry point to run the app flow:
-
Show intro banner
-
Get domain input from args or prompt
-
Check domain availability
-
Show domain result with purchase link if available
-
Optionally check social username availability
-
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 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] (domain_result[:domain]) end |