Sha256: ad052e522fc6ce962e6c46b3660b531fdf40495e462716d1d077b8362bc5caf4

Contents?: true

Size: 877 Bytes

Versions: 6

Compression:

Stored size: 877 Bytes

Contents

# frozen_string_literal: true

require 'yaml'
module WhatsupGithub
  # Table containing Rows
  class YAMLFormatter
    # def initialize(since)
    #   @collector = RowCollector.new(since: since)
    # end

    def generate_output_from(content)
      entries =
        content.collect do |object|
          {
            'description' => object.description,
            'versions' => object.versions,
            'type' => object.type,
            'date' => object.date,
            'link' => object.link,
            'merge_commit' => object.merge_commit,
            'contributor' => object.author,
            'membership' => object.membership,
            'labels' => object.labels
          }
        end
      output =
        {
          'updated' => Time.now.strftime('%c').tr_s(' ', ' '),
          'entries' => entries
        }
      output.to_yaml
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
whatsup_github-1.0.1 lib/whatsup_github/yaml_formatter.rb
whatsup_github-1.0.0 lib/whatsup_github/yaml_formatter.rb
whatsup_github-0.5.0 lib/whatsup_github/yaml_formatter.rb
whatsup_github-0.4.2 lib/whatsup_github/yaml_formatter.rb
whatsup_github-0.4.1 lib/whatsup_github/yaml_formatter.rb
whatsup_github-0.4.0 lib/whatsup_github/yaml_formatter.rb