lib/raap/cli.rb in raap-0.2.0 vs lib/raap/cli.rb in raap-0.3.0

- old
+ new

@@ -14,10 +14,11 @@ :libraries, :timeout, :size_from, :size_to, :size_by, + :allow_private, keyword_init: true ) # defaults self.option = Option.new( @@ -26,10 +27,11 @@ libraries: [], timeout: 3, size_from: 0, size_to: 99, size_by: 1, + allow_private: false, ) def initialize(argv) @argv = argv end @@ -58,10 +60,13 @@ CLI.option.size_to = arg end o.on('--size-by int', Integer, "default: #{CLI.option.size_by}") do |arg| CLI.option.size_by = arg end + o.on('--allow-private', "default: #{CLI.option.allow_private}") do + CLI.option.allow_private = true + end end.parse!(@argv) CLI.option.dirs.each do |dir| RaaP::RBS.loader.add(path: Pathname(dir)) end @@ -215,18 +220,22 @@ instance_type: ::RBS::Types::ClassInstance.new(name: rtype.name, args: type_args, location: nil), class_type: ::RBS::Types::ClassSingleton.new(name: rtype.name, location: nil), ), size_step: CLI.option.size_from.step(to: CLI.option.size_to, by: CLI.option.size_by), timeout: CLI.option.timeout, + allow_private: true, ).run do |called| case called in Result::Success => s print '.' RaaP.logger.debug { "Success: #{s.called_str}" } in Result::Failure => f puts 'F' puts "Failed in case of `#{f.called_str}`" + if e = f.exception + RaaP.logger.debug { "Failure: [#{e.class}] #{e.message}" } + end puts RaaP.logger.debug { PP.pp(f.symbolic_call, ''.dup) } puts "### call stack:" puts puts "```" @@ -234,13 +243,16 @@ puts "```" status = 1 throw :break in Result::Skip => s print 'S' - RaaP::logger.debug("Skip: [#{s.exception.class}] #{s.exception.message}") + RaaP.logger.debug { PP.pp(s.symbolic_call, ''.dup) } + RaaP.logger.debug("Skip: [#{s.exception.class}] #{s.exception.message}") + RaaP.logger.debug(s.exception.backtrace.join("\n")) in Result::Exception => e print 'E' - RaaP.logger.info("Exception: [#{e.exception.class}] #{e.exception.message}") + RaaP.logger.debug { PP.pp(e.symbolic_call, ''.dup) } + RaaP.logger.debug("Exception: [#{e.exception.class}] #{e.exception.message}") RaaP.logger.debug(e.exception.backtrace.join("\n")) end end puts puts "success: #{stats.success}, skip: #{stats.skip}, exception: #{stats.exception}"