Class: Appydave::Tools::Dam::RepoStatus
- Inherits:
-
Object
- Object
- Appydave::Tools::Dam::RepoStatus
- Defined in:
- lib/appydave/tools/dam/repo_status.rb
Overview
Show git status for brand repositories
Instance Attribute Summary collapse
-
#brand ⇒ Object
readonly
Returns the value of attribute brand.
-
#brand_info ⇒ Object
readonly
Returns the value of attribute brand_info.
-
#brand_path ⇒ Object
readonly
Returns the value of attribute brand_path.
Instance Method Summary collapse
-
#initialize(brand = nil) ⇒ RepoStatus
constructor
A new instance of RepoStatus.
-
#show ⇒ Object
Show status for single brand.
-
#show_all ⇒ Object
Show status for all brands.
Constructor Details
#initialize(brand = nil) ⇒ RepoStatus
Returns a new instance of RepoStatus.
10 11 12 13 14 15 16 |
# File 'lib/appydave/tools/dam/repo_status.rb', line 10 def initialize(brand = nil) return unless brand @brand_info = load_brand_info(brand) @brand = @brand_info.key @brand_path = Config.brand_path(@brand) end |
Instance Attribute Details
#brand ⇒ Object (readonly)
Returns the value of attribute brand.
8 9 10 |
# File 'lib/appydave/tools/dam/repo_status.rb', line 8 def brand @brand end |
#brand_info ⇒ Object (readonly)
Returns the value of attribute brand_info.
8 9 10 |
# File 'lib/appydave/tools/dam/repo_status.rb', line 8 def brand_info @brand_info end |
#brand_path ⇒ Object (readonly)
Returns the value of attribute brand_path.
8 9 10 |
# File 'lib/appydave/tools/dam/repo_status.rb', line 8 def brand_path @brand_path end |
Instance Method Details
#show ⇒ Object
Show status for single brand
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/appydave/tools/dam/repo_status.rb', line 19 def show puts "🔍 Git Status: v-#{brand}" puts '' unless git_repo? puts "❌ Not a git repository: #{brand_path}" return end show_git_info end |
#show_all ⇒ Object
Show status for all brands
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/appydave/tools/dam/repo_status.rb', line 32 def show_all puts '🔍 Git Status - All Brands' puts '' Appydave::Tools::Configuration::Config.configure brands_config = Appydave::Tools::Configuration::Config.brands brands_config.brands.each do |brand_info| @brand_info = brand_info @brand = brand_info.key @brand_path = Config.brand_path(@brand) next unless git_repo? puts "📦 v-#{brand}" show_git_info(indent: ' ') puts '' end end |