Module: Ra10ke::Validate
- Included in:
- RakeTask
- Defined in:
- lib/ra10ke/validate.rb
Defined Under Namespace
Classes: Validation
Constant Summary collapse
- GOOD_EMOJI =
ENV['GOOD_EMOJI'] || '👍'
- BAD_EMOJI =
ENV['BAD_EMOJI'] || '😨'
Instance Method Summary collapse
-
#define_task_validate ⇒ Object
Validate the git urls and refs.
Instance Method Details
#define_task_validate ⇒ Object
Validate the git urls and refs
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ra10ke/validate.rb', line 15 def define_task_validate(*) desc 'Validate the git urls and branches, refs, or tags' task :validate do gitvalididation = Ra10ke::Validate::Validation.new(get_puppetfile.puppetfile_path) exit_code = 0 if gitvalididation.bad_mods? exit_code = 1 = BAD_EMOJI + ' Not all modules in the Puppetfile are valid. '.red + BAD_EMOJI else = GOOD_EMOJI + ' Puppetfile looks good. '.green + GOOD_EMOJI end tp gitvalididation.sorted_mods, :name, { url: { width: 50 } }, :ref, :status abort() if exit_code.positive? puts end end |