diff --git a/Gemfile.lock b/Gemfile.lock index 577827f..1d79e10 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - gitea-client (0.9.0) + gitea-client (0.10.0) rest-client (~> 2.1.0) GEM diff --git a/lib/gitea/api/http.rb b/lib/gitea/api/http.rb index 814ebcb..71b312f 100644 --- a/lib/gitea/api/http.rb +++ b/lib/gitea/api/http.rb @@ -104,7 +104,11 @@ module Gitea response.return! end - JSON.parse(response) rescue {} + if response.headers.has_key?(:x_total) + return {data: JSON.parse(response), total_data: response.headers[:x_total]} + else + return JSON.parse(response) + end rescue {} end def get_user_agent diff --git a/lib/gitea/version.rb b/lib/gitea/version.rb index 9c23a04..9c8a1b5 100644 --- a/lib/gitea/version.rb +++ b/lib/gitea/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Gitea - VERSION = "0.9.0" + VERSION = "0.10.0" end