Class: StiDeploy::Git::Commit
- Inherits:
-
Object
- Object
- StiDeploy::Git::Commit
- Defined in:
- lib/sti_deploy/git/commit.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#git_user ⇒ Object
readonly
Returns the value of attribute git_user.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #commit! ⇒ Object
-
#initialize(branch, message) ⇒ Commit
constructor
A new instance of Commit.
Constructor Details
#initialize(branch, message) ⇒ Commit
Returns a new instance of Commit.
6 7 8 9 10 |
# File 'lib/sti_deploy/git/commit.rb', line 6 def initialize(branch, ) @branch = branch @git_user = Configuration.git_username = (git_user, ) end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
4 5 6 |
# File 'lib/sti_deploy/git/commit.rb', line 4 def branch @branch end |
#git_user ⇒ Object (readonly)
Returns the value of attribute git_user.
4 5 6 |
# File 'lib/sti_deploy/git/commit.rb', line 4 def git_user @git_user end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/sti_deploy/git/commit.rb', line 4 def end |
Instance Method Details
#commit! ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/sti_deploy/git/commit.rb', line 12 def commit! Messages.puts('git.committing', color: :yellow) Git.add_version return true if Git.commit(message: ) && Git.push(branch: branch) Messages.puts('git.push_error', target: branch, color: :red) exit(4) end |