Sha256: d3c728341fe964d104206eb186a0a12b6af1f6ba048eeceb271bc837ff0a3d66

Contents?: true

Size: 721 Bytes

Versions: 3

Compression:

Stored size: 721 Bytes

Contents

require_relative 'base'

module Capistrano::Dingtalk::Messaging
  class Markdown < Base
    def initialize(info)
      @info = info || {}
    end

    def markdown_load(action)
      "
      ### #{application}
      action: #{action}
      deployer: `#{deployer}`
      branch: `#{branch}`
      stage: `#{stage}`"
    end

    ################################################################################

    def markdown(action)
      method = "message_for_#{action}"
      respond_to?(method) && send(method)
    end

    def build_hash(action)
      {
        msgtype: "markdown",
        markdown: {
          title: message_for(action),
          text: markdown_load(action)
        }
      }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-dingtalk-0.1.2 lib/capistrano/dingtalk/messaging/markdown.rb
capistrano-dingtalk-0.1.1 lib/capistrano/dingtalk/messaging/markdown.rb
capistrano-dingtalk-0.1.0 lib/capistrano/dingtalk/messaging/markdown.rb