mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-10 14:46:42 +08:00
Merge pull request #926 from Ducz0r/lm-decoupling-metrics
Add the decoupling metrics rake task
This commit is contained in:
commit
094841e03b
1 changed files with 26 additions and 0 deletions
26
lib/tasks/metrics.rake
Normal file
26
lib/tasks/metrics.rake
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
namespace :metrics do
|
||||||
|
desc 'Prints out some basic decoupling metrics'
|
||||||
|
task decoupling: :environment do
|
||||||
|
erb_nr = 0
|
||||||
|
jsx_nr = 0
|
||||||
|
Dir.glob('**/*.erb') { erb_nr += 1 }
|
||||||
|
Dir.glob('**/*.jsx') { jsx_nr += 1 }
|
||||||
|
|
||||||
|
# Print the metrics
|
||||||
|
puts ''
|
||||||
|
puts '**********************************'
|
||||||
|
puts '** **'
|
||||||
|
puts '** Decoupling metrics **'
|
||||||
|
puts '** **'
|
||||||
|
puts '**********************************'
|
||||||
|
puts ''
|
||||||
|
puts 'Nr. of ERB template files (*.erb):'
|
||||||
|
puts erb_nr
|
||||||
|
puts ''
|
||||||
|
puts 'Nr. of React template files (*.jsx):'
|
||||||
|
puts jsx_nr
|
||||||
|
puts ''
|
||||||
|
puts '**********************************'
|
||||||
|
puts ''
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue