lib/codebuild-notifier/slack_message.rb in codebuild-notifier-0.3.2 vs lib/codebuild-notifier/slack_message.rb in codebuild-notifier-1.0.0
- old
+ new
@@ -15,20 +15,18 @@
# You should have received a copy of the GNU General Public License
# along with codebuild-notifier. If not, see <http://www.gnu.org/licenses/>.
module CodeBuildNotifier
class SlackMessage
- attr_reader :author_email, :author_name, :build, :committer_email,
- :commit_message_subject, :config, :short_hash
+ attr_reader :build, :config
- delegate :source_ref, to: :build
+ delegate :author_email, :author_name, :committer_email,
+ :commit_message_subject, :short_hash, :source_ref, to: :build
def initialize(build, config)
@build = build
@config = config
- @short_hash, @author_name, @author_email,
- @committer_email, @commit_message_subject = git_info
end
def payload
{
color: slack_color,
@@ -42,13 +40,9 @@
[author_email, committer_email].uniq
end
def additional_channel
!build.for_pr? && config.additional_channel
- end
-
- private def git_info
- Git.current_commit
end
private def slack_color
{
'FAILED' => 'danger',