DEV: Apply syntax_tree formatting to script/*

This commit is contained in:
David Taylor
2023-01-07 11:53:14 +00:00
parent ff508d1ae5
commit 436b3b392b
143 changed files with 8905 additions and 7353 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
start = Time.now
require 'objspace'
require "objspace"
require File.expand_path("../../config/environment", __FILE__)
# preload stuff
@ -9,11 +9,19 @@ I18n.t(:posts)
# load up all models and schema
(ActiveRecord::Base.connection.tables - %w[schema_migrations]).each do |table|
table.classify.constantize.first rescue nil
begin
table.classify.constantize.first
rescue StandardError
nil
end
end
# router warm up
Rails.application.routes.recognize_path('abc') rescue nil
begin
Rails.application.routes.recognize_path("abc")
rescue StandardError
nil
end
puts "Ruby version #{RUBY_VERSION} p#{RUBY_PATCHLEVEL}"
@ -23,8 +31,11 @@ GC.start
puts "RSS: #{`ps -o rss -p #{$$}`.chomp.split("\n").last.to_i} KB"
s = ObjectSpace.each_object(String).map do |o|
ObjectSpace.memsize_of(o) + 40 # rvalue size on x64
end
s =
ObjectSpace
.each_object(String)
.map do |o|
ObjectSpace.memsize_of(o) + 40 # rvalue size on x64
end
puts "Total strings: #{s.count} space used: #{s.sum} bytes"