diff --git a/config/initializers/app_metrics.rb b/config/initializers/app_metrics.rb new file mode 100644 index 0000000..23c8b99 --- /dev/null +++ b/config/initializers/app_metrics.rb @@ -0,0 +1,4 @@ +# Application metrics calculated at startup + +lines_of_code = `find . -name "*.rb" -not -path "./vendor/*" -not -path "./tmp/*" -exec wc -l {} + | tail -1 | awk '{print $1}'`.strip.to_i rescue 0 +Rails.application.config.lines_of_code = lines_of_code diff --git a/lib/flavor_text.rb b/lib/flavor_text.rb index 742969b..00be20b 100644 --- a/lib/flavor_text.rb +++ b/lib/flavor_text.rb @@ -215,6 +215,7 @@ class FlavorText "a minute saved is a minute earned", "how did it get so late so soon?", # dr. seuss "You can have it all. Just not all at once.", # oprah i think? + "written in #{Rails.application.config.lines_of_code} lines of code!", "#{%w[est created inited].sample} #{Time.now.to_i - Time.parse("Sun Feb 16 03:21:30 2025 -0500").to_i} seconds ago!".html_safe, "uptime: #{Time.now.to_i - Rails.application.config.server_start_time.to_i} seconds!".html_safe, "It takes a long time to build something good: ".html_safe,