Class: Appydave::Tools::Dam::RepoPush
- Inherits:
-
Object
- Object
- Appydave::Tools::Dam::RepoPush
- Defined in:
- lib/appydave/tools/dam/repo_push.rb
Overview
Push brand repository changes
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.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
Instance Method Summary collapse
-
#initialize(brand, project_id = nil) ⇒ RepoPush
constructor
A new instance of RepoPush.
-
#push ⇒ Object
Push changes.
Constructor Details
#initialize(brand, project_id = nil) ⇒ RepoPush
Returns a new instance of RepoPush.
10 11 12 13 14 15 |
# File 'lib/appydave/tools/dam/repo_push.rb', line 10 def initialize(brand, project_id = nil) @brand_info = load_brand_info(brand) @brand = @brand_info.key @brand_path = Config.brand_path(@brand) @project_id = project_id end |
Instance Attribute Details
#brand ⇒ Object (readonly)
Returns the value of attribute brand.
8 9 10 |
# File 'lib/appydave/tools/dam/repo_push.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_push.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_push.rb', line 8 def brand_path @brand_path end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
8 9 10 |
# File 'lib/appydave/tools/dam/repo_push.rb', line 8 def project_id @project_id end |
Instance Method Details
#push ⇒ Object
Push changes
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/appydave/tools/dam/repo_push.rb', line 18 def push puts "📤 Pushing: v-#{brand}" puts '' unless git_repo? puts "❌ Not a git repository: #{brand_path}" return end # If project specified, validate it exists in manifest validate_project if project_id perform_push end |