lib/hammer_cli/output/adapter/abstract.rb in hammer_cli-0.0.4 vs lib/hammer_cli/output/adapter/abstract.rb in hammer_cli-0.0.5

- old
+ new

@@ -1,15 +1,20 @@ module HammerCLI::Output::Adapter class Abstract - def print_message msg + def initialize(context={}, formatters=HammerCLI::Output::Formatters::FormatterLibrary.new) + @context = context + @formatters = formatters + end + + def print_message(msg) puts msg end - def print_error msg, details=nil + def print_error(msg, details=nil) details = details.split("\n") if details.kind_of? String if details indent = " " $stderr.puts msg+":" @@ -17,10 +22,10 @@ else $stderr.puts msg end end - def print_records fields, data, heading=nil + def print_records(fields, data) raise NotImplementedError end end end