lib/gitlab/cli_helpers.rb in gitlab-3.6.0 vs lib/gitlab/cli_helpers.rb in gitlab-3.6.1
- old
+ new
@@ -91,11 +91,11 @@
# Outputs a nicely formatted table or error msg.
def output_table(cmd, args, data)
case data
when Gitlab::ObjectifiedHash
puts record_table([data], cmd, args)
- when Array
+ when Gitlab::PaginatedResponse
puts record_table(data, cmd, args)
else # probably just an error msg
puts data
end
end
@@ -105,10 +105,10 @@
puts '{}'
else
hash_result = case data
when Gitlab::ObjectifiedHash
record_hash([data], cmd, args, true)
- when Array
+ when Gitlab::PaginatedResponse
record_hash(data, cmd, args)
else
{ cmd: cmd, data: data, args: args }
end
puts JSON.pretty_generate(hash_result)