Class: WayOfWorking::InclusiveLanguage::Alex::Generators::Exec
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- WayOfWorking::InclusiveLanguage::Alex::Generators::Exec
- Defined in:
- lib/way_of_working/inclusive_language/alex/generators/exec.rb
Overview
This generator runs the inclusive language tests
Instance Method Summary collapse
Instance Method Details
#prep_and_run_alex ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/way_of_working/inclusive_language/alex/generators/exec.rb', line 22 def prep_and_run_alex command = ['npx', 'alex', '--why'] # Configure alex to only test a specific file or folder, if defined command << path if path say(Rainbow("\nRunning alex...").yellow) @alex_ok = run_alex(command) end |
#run_first ⇒ Object
16 17 18 19 20 |
# File 'lib/way_of_working/inclusive_language/alex/generators/exec.rb', line 16 def run_first @start_time = Time.now say(Rainbow("Limiting tests to #{path}\n").yellow) if path end |
#run_last ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/way_of_working/inclusive_language/alex/generators/exec.rb', line 32 def run_last say(Rainbow("\nTotal time taken: #{(Time.now - @start_time).to_i} seconds").yellow) if @alex_ok say(Rainbow("\nInclusive language tests succeeded!").green) else abort(Rainbow("\nInclusive language tests failed!").red) end end |