From c9a6011fca1335df969f3484a72afe6023ce0a97 Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Mon, 29 Jul 2019 15:17:36 -0300 Subject: [PATCH 1/2] Annotate return types of abstract classes --- src/lib/ios/pipe.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ios/pipe.cr b/src/lib/ios/pipe.cr index 2eb1091..651d3bd 100644 --- a/src/lib/ios/pipe.cr +++ b/src/lib/ios/pipe.cr @@ -27,7 +27,7 @@ module Cli::Ios end # Implements `IO#write`. - def write(slice : Slice(UInt8)) + def write(slice : Slice(UInt8)) : Nil if io = @writer io.write slice else From 5508e1e6d7a87f90ebc85f9955aca9ebe946f65b Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Mon, 29 Jul 2019 15:17:52 -0300 Subject: [PATCH 2/2] Run formatter --- src/lib/command_base.cr | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lib/command_base.cr b/src/lib/command_base.cr index e5f9b43..db1e097 100644 --- a/src/lib/command_base.cr +++ b/src/lib/command_base.cr @@ -238,7 +238,7 @@ module Cli # :nodoc: def initialize(@__previous, @__argv) - run_callbacks_for_initialize {} + run_callbacks_for_initialize { } end @__option_data = Util::Var(Optarg::Model).new @@ -246,12 +246,16 @@ module Cli # Returns option and argument values (an `OptionModel` instance). # # This method is the same as `#args`. - def options; __option_data; end + def options + __option_data + end # Returns option and argument values (an `OptionModel` instance). # # This method is the same as `#options`. - def args; __option_data; end + def args + __option_data + end # Returns an array of nameless argument values. # @@ -342,13 +346,14 @@ module Cli end @io : IoHash? + # Returns a named IO container. def io @io ||= if prev = @__previous - prev.io - else - Cli.new_default_io - end + prev.io + else + Cli.new_default_io + end end # Invokes the :out IO's puts method.