class TaskWithCommit

Public Instance Methods

finish(comment) click to toggle source
Calls superclass method Task#finish
# File lib/caperoma/models/tasks/task_with_commit.rb, line 4
def finish(comment)
  super
  git_commit(commit_message)
  # here I should pass the path
  `rubocop -a "#{project.folder_path}"` if enable_rubocop?
  git_commit(commit_rubocop_message)
  git_push
end
pause(comment) click to toggle source
Calls superclass method Task#pause
# File lib/caperoma/models/tasks/task_with_commit.rb, line 13
def pause(comment)
  super
  git_commit(commit_message)
  `rubocop -a "#{project.folder_path}"` if enable_rubocop?
  git_commit(commit_rubocop_message)
  git_push
end

Private Instance Methods

commit_message() click to toggle source
# File lib/caperoma/models/tasks/task_with_commit.rb, line 23
def commit_message
  # E.g.: [RUC-123][#1345231] Some Subject
  string = ''
  string += "[#{jira_key}]" if jira_key.present?
  string += "[##{pivotal_id}]" if pivotal_id.present?
  string += " #{title}"
  string.strip
end
commit_rubocop_message() click to toggle source
# File lib/caperoma/models/tasks/task_with_commit.rb, line 32
def commit_rubocop_message
  string = ''
  string += "[#{jira_key}]" if jira_key.present?
  string += "[##{pivotal_id}]" if pivotal_id.present?
  string += ' Applying good practices'
  string.strip
end
enable_rubocop?() click to toggle source
# File lib/caperoma/models/tasks/task_with_commit.rb, line 40
def enable_rubocop?
  ENV['CAPEROMA_TEST'].blank? && ENV['CAPEROMA_INTEGRATION_TEST'].blank?
end