mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Base YAML config loader & Ameba runner
This commit is contained in:
parent
80e2ab4f55
commit
822a69b81c
7 changed files with 158 additions and 32 deletions
|
@ -1,7 +1,7 @@
|
|||
require "../src/ameba"
|
||||
require "benchmark"
|
||||
|
||||
private def get_sources(n)
|
||||
private def get_files(n)
|
||||
Dir["src/**/*.cr"].first(n)
|
||||
end
|
||||
|
||||
|
@ -16,10 +16,11 @@ Benchmark.ips do |x|
|
|||
30,
|
||||
40,
|
||||
].each do |n|
|
||||
sources = get_sources(n)
|
||||
formatter = Ameba::Formatter::BaseFormatter.new
|
||||
config = Ameba::Config.load
|
||||
config.formatter = Ameba::Formatter::BaseFormatter.new
|
||||
config.files = get_files(n)
|
||||
s = n == 1 ? "" : "s"
|
||||
x.report("#{n} source#{s}") { Ameba.run sources, formatter }
|
||||
x.report("#{n} source#{s}") { Ameba.run config }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue