Rakefile in panko_serializer-0.7.9 vs Rakefile in panko_serializer-0.8.0
- old
+ new
@@ -30,11 +30,12 @@
end
def run_process(cmd)
puts "> Running #{cmd}"
lines = []
- PTY.spawn(cmd) do |stdout, stdin, pid|
+ _stderr_reader, stderr_writer = IO.pipe
+ PTY.spawn(cmd, err: stderr_writer.fileno) do |stdout, stdin, pid|
stdout.each do |line|
print_and_flush "."
lines << line
end
rescue Errno::EIO
@@ -63,26 +64,28 @@
table = Terminal::Table.new title: title, headings: headings, rows: rows
puts table
end
end
-desc "Run all benchmarks"
-task :benchmarks do
- run_benchmarks Dir[File.join(__dir__, "benchmarks", "**", "bm_*")]
-end
+namespace :benchmarks do
+ desc "All"
+ task :all do
+ run_benchmarks Dir[File.join(__dir__, "benchmarks", "**", "bm_*")]
+ end
-desc "Type Casts - Benchmarks"
-task :bm_type_casts do
- run_benchmarks Dir[File.join(__dir__, "benchmarks", "type_casts", "bm_*")], items_count: 0
-end
+ desc "Type Casts"
+ task :type_casts do
+ run_benchmarks Dir[File.join(__dir__, "benchmarks", "type_casts", "bm_*")], items_count: 0
+ end
-desc "Sanity Benchmarks"
-task :sanity do
- puts Time.now.strftime("%d/%m %H:%M:%S")
- puts "=========================="
+ desc "Sanity"
+ task :sanity do
+ puts Time.now.strftime("%d/%m %H:%M:%S")
+ puts "=========================="
- run_benchmarks [
- File.join(__dir__, "benchmarks", "sanity.rb")
- ], items_count: 2300
+ run_benchmarks [
+ File.join(__dir__, "benchmarks", "sanity.rb")
+ ], items_count: 2300
- puts "\n\n"
+ puts "\n\n"
+ end
end