Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'kpaulisse-release-1-0' into kpaulisse-release-1-0-doc
- Loading branch information
Showing
13 changed files
with
235 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../display' | ||
|
||
require 'json' | ||
|
||
module OctocatalogDiff | ||
module CatalogDiff | ||
class Display | ||
# Display the output from a diff in JSON format. This is the legacy format, used in octocatalog-diff | ||
# 0.x, where each diff is represented by an array. | ||
class LegacyJson < OctocatalogDiff::CatalogDiff::Display | ||
# Generate JSON representation of the 'diff' suitable for further analysis. | ||
# @param diff [Array<Diff results>] The diff which *must* be in this format | ||
# @param options [Hash] Options which are: | ||
# - :header => [String] Header to print; no header is printed if not specified | ||
# @param _logger [Logger] Not used here | ||
def self.generate(diff, options = {}, _logger = nil) | ||
result = { | ||
'diff' => diff.map(&:raw) | ||
} | ||
result['header'] = options[:header] unless options[:header].nil? | ||
result.to_json | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.