From ba90c68e1d95fe8bb4d4be295838a4382ea73110 Mon Sep 17 00:00:00 2001 From: serknight Date: Tue, 13 Apr 2021 13:48:53 -0600 Subject: [PATCH 1/2] fix opts mutation, fixes configuration passing, and add docs / specs --- Gemfile.lock | 12 +- README.md | 6 + docs/accounting/index.html | 2 +- docs/assets/index.html | 2 +- docs/files/index.html | 2 +- docs/payroll_au/index.html | 2 +- docs/payroll_nz/index.html | 2 +- docs/payroll_uk/index.html | 2 +- docs/projects/index.html | 2 +- lib/xero-ruby/api/accounting_api.rb | 672 ++++++++++++------ lib/xero-ruby/api/asset_api.rb | 18 +- lib/xero-ruby/api/files_api.rb | 51 +- lib/xero-ruby/api/payroll_au_api.rb | 87 ++- lib/xero-ruby/api/payroll_nz_api.rb | 204 ++++-- lib/xero-ruby/api/payroll_uk_api.rb | 210 ++++-- lib/xero-ruby/api/project_api.rb | 39 +- lib/xero-ruby/api_client.rb | 12 +- .../models/payroll_uk/salary_and_wage.rb | 5 +- lib/xero-ruby/version.rb | 2 +- spec/api_client_spec.rb | 11 + spec/configuration_spec.rb | 17 + 21 files changed, 917 insertions(+), 443 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 852adbaf..78e7649e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - xero-ruby (2.4.1) - faraday (~> 1.0.1, >= 1.0.1) + xero-ruby (2.9.0) + faraday (~> 1.0, >= 1.0.1) json (~> 2.1, >= 2.1.0) GEM @@ -12,10 +12,13 @@ GEM byebug (11.1.3) coderay (1.1.3) diff-lcs (1.4.4) - faraday (1.0.1) + faraday (1.3.0) + faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) + ruby2_keywords + faraday-net_http (1.0.1) jaro_winkler (1.5.4) - json (2.4.1) + json (2.5.1) method_source (1.0.0) multipart-post (2.1.1) parallel (1.20.1) @@ -52,6 +55,7 @@ GEM ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.6) ruby-progressbar (1.10.1) + ruby2_keywords (0.0.4) unicode-display_width (1.5.0) PLATFORMS diff --git a/README.md b/README.md index e0bac60b..e14b8d4a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,12 @@ creds = { xero_client ||= XeroRuby::ApiClient.new(credentials: creds) ``` +If you want additional logging or timeout, you can add/override any configuration option by passing the optional named paramater object `config`. +```ruby +config = { timeout: 30, debugging: true } +@xero_client ||= XeroRuby::ApiClient.new(credentials: creds, config: config) +``` + ## User Authorization & Callback All API requests require a valid access token to be set on the client. diff --git a/docs/accounting/index.html b/docs/accounting/index.html index 97c3a7c9..75a6f4ed 100644 --- a/docs/accounting/index.html +++ b/docs/accounting/index.html @@ -5819,7 +5819,7 @@