lib/acter/result.rb in acter-0.1.0 vs lib/acter/result.rb in acter-0.1.1
- old
+ new
@@ -8,10 +8,11 @@
extend Forwardable
DEFAULT_RENDER_OPTIONS = {
show_body: true,
show_headers: false,
+ show_status: true,
color: :tty?,
theme: "monokai",
}
def initialize(response)
@@ -29,13 +30,15 @@
end
colorize = options[:color] && (options[:color] != :tty? || $>.tty?)
StringIO.open do |s|
- if colorize
- s.puts Term::ANSIColor.bold(response.status)
- else
- s.puts response.status
+ if options[:show_status]
+ if colorize
+ s.puts Term::ANSIColor.bold(response.status)
+ else
+ s.puts response.status
+ end
end
if options[:show_headers]
response.headers.each(&s.method(:puts))
end
if options[:show_body]