bin/errors in flows-0.5.1 vs bin/errors in flows-0.6.0

- old
+ new

@@ -15,10 +15,11 @@ require_relative 'errors_cli/oc_error_demo' require_relative 'errors_cli/railway_error_demo' require_relative 'errors_cli/result_error_demo' require_relative 'errors_cli/scp_error_demo' require_relative 'errors_cli/flow_error_demo' +require_relative 'errors_cli/interface_error_demo' class ErrorsCLI extend GLI::App program_desc 'Error reporting demo' @@ -28,15 +29,15 @@ def self.make_cmd(ctx, title, name) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength ctx.desc title ctx.command name do |cmd| cmd.action do |_, _, _| puts title.green - puts(('BEGIN' + '-' * (title.length - 5)).color(:darkgray)) + puts("BEGIN#{'-' * (title.length - 5)}".color(:darkgray)) yield rescue StandardError => err puts err.message - puts(('END' + '-' * (title.length - 3)).color(:darkgray)) + puts("END#{'-' * (title.length - 3)}".color(:darkgray)) puts end end end @@ -121,9 +122,16 @@ FlowErrorDemo.no_first_node end make_cmd cmd, 'Invalid Node route', :invalid_node_route do FlowErrorDemo.invalid_node_route + end + end + + desc 'Interface errors' + command :interface do |cmd| + make_cmd cmd, 'Missing Implementation', :missing_implementation do + InterfaceErrorDemo.missing_implementation end end end exit ErrorsCLI.run(ARGV)