It would be great if commander would provide a helper to unintend a String created with a heredoc. Some seem to solve this "elegantly" via a core_ext to String:
class String
def unindent
gsub(/^#{scan(/^\s*/).min_by{|l|l.length}}/, "")
end
end
command :test do
message = <<-EOM.unindent
This is a test message! The left indent
gets stripped automatically!
EOM
end
It would be great if commander would provide a helper to unintend a String created with a heredoc. Some seem to solve this "elegantly" via a core_ext to String: