Skip to content

Commit

Permalink
Merge pull request #196 from voxpupuli/json-pretty_generate
Browse files Browse the repository at this point in the history
Generate a pretty `ext/puppet_agent_components.json` file
  • Loading branch information
bastelfreak authored Aug 13, 2024
2 parents a9b6053 + 079a33e commit b588336
Show file tree
Hide file tree
Showing 2 changed files with 5,826 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace :puppet_versions do
require 'net/http'
require 'net/https'
require 'uri'
require 'json'

uri = URI.parse('https://forgeapi.puppet.com/private/versions/puppet-agent')
http = Net::HTTP.new(uri.host, uri.port)
Expand All @@ -31,7 +32,7 @@ namespace :puppet_versions do
raise unless response.is_a?(Net::HTTPSuccess)

File.open(PUPPET_VERSIONS_PATH, 'wb:UTF-8') do |fd|
fd.write(response.body)
fd.write(JSON.pretty_generate(JSON.parse(response.body)))
end
end

Expand Down
5,825 changes: 5,824 additions & 1 deletion ext/puppet_agent_components.json

Large diffs are not rendered by default.

0 comments on commit b588336

Please sign in to comment.