Module: Ra10ke::Deprecation

Included in:
RakeTask
Defined in:
lib/ra10ke/deprecation.rb

Defined Under Namespace

Classes: Validation

Instance Method Summary collapse

Instance Method Details

#define_task_deprecationObject

Validate the git urls and refs



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ra10ke/deprecation.rb', line 11

def define_task_deprecation(*)
  desc 'Validate that no forge modules are deprecated'
  task :deprecation do
    valid = Ra10ke::Deprecation::Validation.new(get_puppetfile.puppetfile_path)
    exit_code = 0
    if valid.bad_mods?
      exit_code = 1
      message = "\nError: Puppetfile contains deprecated modules."
      tp valid.sorted_mods, :name, :deprecated_at
    else
      message = 'Puppetfile contains no deprecated Forge modules.'
    end
    abort(message) if exit_code.positive?

    puts message
  end
end