woocommerce-ruby3-api 1.5.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e42f8da0504dcc9b35ee61e8b5165b2bac2c8f0c66bb08fcd3955145a2c94ef5
4
- data.tar.gz: 708a6741110d8721fac043e2a0446110e29bc6116d9e97d3a9515aa279ca5611
3
+ metadata.gz: 5c4c603507ce363b8817c12e4764d6999b7217f01326d3b0611cf59b86ee8e11
4
+ data.tar.gz: 1ec03d3ed101cd31e16180973b114e18ba103bd33fd69ce6dd6b5f071fec9444
5
5
  SHA512:
6
- metadata.gz: 05a0c2450deb9186d1080e3dd2b1a82d556fb74cbeb3154ed638ed82a42dc3fb2069f27688944c61c3aab422e2079547e096f28ff306d28c855d5d23c8311cd5
7
- data.tar.gz: 9a5aa4105ee99d2639537efe9064d7cc8dcd1c701b6913fa3e69820bdd34b97c845dd2eae4ccbcc49c7c3b6597f3f651ce2ff68573878270b874b08cd114cf4a
6
+ metadata.gz: 8fcfe547980697c7a349677631e0d2eea2e871e77b1466d80e7f55f7845119b3281a4464a5e81f795ea9fce69ce96e2ff827704a5ec86e308407527195311a3a
7
+ data.tar.gz: c0250703cf04ffb2a6ee9af315a97f1c59b89f6f46fa3f8c63c53656f575c42f93dd0fbadb051e9f223eb59ec62485295370ed414d11842e518daa41d5670c1b
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A Ruby wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library, optimized for Ruby 3.0+.
4
4
 
5
- [![Gem Version](https://badge.fury.io/rb/woocommerce-ruby3-api.svg?bust=1)](https://badge.fury.io/rb/woocommerce-ruby3-api)
5
+ [![Gem Version](https://badge.fury.io/rb/woocommerce-ruby3-api.svg?bust=3)](https://badge.fury.io/rb/woocommerce-ruby3-api)
6
6
  [![Tests](https://github.com/chemica/woocommerce-ruby3-api/actions/workflows/test.yml/badge.svg?branch=main&bust=1)](https://github.com/chemica/woocommerce-ruby3-api/actions/workflows/test.yml)
7
7
 
8
8
  ## About
@@ -208,7 +208,10 @@ puts response.headers["x-wc-totalpages"] # Total of pages
208
208
  ## Release History
209
209
 
210
210
  ### Ruby 3 Version (woocommerce-ruby3-api)
211
- - 2025-10-04 - 1.5.0 - Initial fork with Ruby 3+ compatibility using Addressable::URI and base64 gem
211
+ - 2025-04-11 - 1.5.3 - Hides sensitive information from ruby "inspect". Prevents accidental exposure in logs or console output.
212
+ - 2025-04-11 - 1.5.2 - Fixes gemfile.lock issue.
213
+ - 2025-04-11 - 1.5.1 - Adds RuboCop for code quality. Fixes RuboCop violations. Refactors code and tests for easier maintainability.
214
+ - 2025-04-10 - 1.5.0 - Update code for Ruby 3.1+ compatibility using Addressable::URI and base64 gem. Add Github CI actions.
212
215
 
213
216
  ### Original Project (woocommerce_api)
214
217
  - 2016-12-14 - 1.4.0 - Introduces `httparty_args` arg and fixed compatibility with WordPress 4.7.
@@ -232,6 +235,8 @@ puts response.headers["x-wc-totalpages"] # Total of pages
232
235
  4. Push to the branch (`git push origin my-new-feature`)
233
236
  5. Create new Pull Request
234
237
 
238
+ Adding an issue to start a discussion about your change would be appreciated.
239
+
235
240
  ## License
236
241
 
237
242
  Released under the [MIT License](LICENSE).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WooCommerce
4
- VERSION = "1.5.1"
4
+ VERSION = "1.5.3"
5
5
  end
@@ -11,15 +11,12 @@ require "woocommerce_api/version"
11
11
  module WooCommerce
12
12
  class ApiBase
13
13
  DEFAULT_ARGS = {
14
- wp_api: false,
15
- version: "v3",
16
- verify_ssl: true,
17
- signature_method: "HMAC-SHA256",
18
- httparty_args: {}
14
+ wp_api: false, version: "v3", verify_ssl: true,
15
+ signature_method: "HMAC-SHA256", httparty_args: {}
19
16
  }.freeze
17
+ SENSITIVE_ARGS = [:@consumer_key, :@consumer_secret, :@signature_method].freeze
20
18
 
21
19
  def initialize(url, consumer_key, consumer_secret, args = {})
22
- # Required args
23
20
  @url = url
24
21
  @consumer_key = consumer_key
25
22
  @consumer_secret = consumer_secret
@@ -27,10 +24,21 @@ module WooCommerce
27
24
  args = DEFAULT_ARGS.merge(args)
28
25
  create_args_variables(args)
29
26
 
30
- # Internal args
31
27
  @is_ssl = @url.start_with? "https"
32
28
  end
33
29
 
30
+ # Overrides inspect to hide sensitive information
31
+ #
32
+ # Returns a string representation of the object
33
+ def inspect
34
+ safe_ivars = instance_variables.each_with_object({}) do |var, hash|
35
+ value = instance_variable_get(var)
36
+ hash[var] = SENSITIVE_ARGS.include?(var) ? "[FILTERED]" : value
37
+ end
38
+
39
+ "#<#{self.class}:0x#{object_id.to_s(16)} #{safe_ivars.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')}>"
40
+ end
41
+
34
42
  private
35
43
 
36
44
  # Internal: Sets authentication options for SSL requests
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woocommerce-ruby3-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Sanches