Sha256: 60aa636288fb77edd201c7fbba15c05ad7558fea2d498c12588ec1a8002a85b5
Contents?: true
Size: 989 Bytes
Versions: 1
Compression:
Stored size: 989 Bytes
Contents
# frozen_string_literal: true require 'puppet-strings' require 'tempfile' namespace :strings do namespace :validate do desc 'Validate the reference is up to date' task :reference, [:patterns, :debug, :backtrace] do |t, args| filename = 'REFERENCE.md' unless File.exist?(filename) STDERR.puts "#{filename} does not exist" exit 1 end patterns = args[:patterns] patterns = patterns.split if patterns patterns ||= PuppetStrings::DEFAULT_SEARCH_PATTERNS generated = Tempfile.create do |file| options = { debug: args[:debug] == 'true', backtrace: args[:backtrace] == 'true', json: false, markdown: true, path: file, } PuppetStrings.generate(patterns, options) file.read end existing = File.read(filename) if generated != existing STDERR.puts "#{filename} is outdated" exit 1 end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
puppet-strings-2.9.0 | lib/puppet-strings/tasks/validate.rb |