From 3365f268e73231fc1caa70efe29e6a9881276231 Mon Sep 17 00:00:00 2001 From: Scott Ganyo Date: Tue, 27 Aug 2013 14:56:10 -0700 Subject: [PATCH] allow headers to vary during paging --- ugc/Gemfile.lock | 2 +- ugc/README.md | 4 ++++ ugc/lib/ugc/helpers/format.rb | 3 ++- ugc/lib/ugc/version.rb | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ugc/Gemfile.lock b/ugc/Gemfile.lock index 65e622153b..d6cacc64e8 100644 --- a/ugc/Gemfile.lock +++ b/ugc/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ugc (0.9.6) + ugc (0.9.7) command_line_reporter gli highline diff --git a/ugc/README.md b/ugc/README.md index 9bc305ef56..06147ac588 100644 --- a/ugc/README.md +++ b/ugc/README.md @@ -178,6 +178,10 @@ If you specify column names in your query, you will be unable to reference the r ## Release notes +### 0.9.7 +* Bug Fixes + 1. allow headers to vary during paging + ### 0.9.6 * Bug Fixes 1. url encode url for curl diff --git a/ugc/lib/ugc/helpers/format.rb b/ugc/lib/ugc/helpers/format.rb index 839a900016..c84fed3c71 100644 --- a/ugc/lib/ugc/helpers/format.rb +++ b/ugc/lib/ugc/helpers/format.rb @@ -15,6 +15,7 @@ def col_overhead def format_collection(collection, headers=nil) if collection && collection.size > 0 + save_headers = headers ? headers.clone : nil save_response collection.response metadata = collection_metadata collection, headers table border: $settings.table_border? do @@ -35,7 +36,7 @@ def format_collection(collection, headers=nil) end end if collection.cursor && agree('Next Page? (Y/N)') {|q| q.default = 'Y'} - format_collection(collection.next_page, headers) + format_collection(collection.next_page, save_headers) end else puts "0 results" diff --git a/ugc/lib/ugc/version.rb b/ugc/lib/ugc/version.rb index 1794a180dd..cac6fcbac7 100644 --- a/ugc/lib/ugc/version.rb +++ b/ugc/lib/ugc/version.rb @@ -1,3 +1,3 @@ module Ugc - VERSION = '0.9.6' + VERSION = '0.9.7' end