woocommerce-ruby3-api 1.5.2 → 1.5.4

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: 881185e578b5ac0cc7befe360c066912d3968618812133654d56c3db3f389e79
4
- data.tar.gz: e379ba148da036fba958912c8079873a22bbfebf71faf0aec76560a0dd56e8f8
3
+ metadata.gz: 19b2793d69ccd0e37b94c3193d1a457a1209b58bfe8b2bd5bf15272d064e349b
4
+ data.tar.gz: de0acf8172c2509b3f774c32c1941b1f285b9a111fc31584e023fdca68ca98a8
5
5
  SHA512:
6
- metadata.gz: e67d20be2d1f5179b2045cbe80b1d5fc209c873c21537f0cc362fd2fcadbe6f87ede8e4000c3b1d43eaae4675c6d36074f8288b29cf56537d34affbdfdf01a08
7
- data.tar.gz: 6267243d74dc3ceb5775cba2a9388b441b8abad34b2f068318f5a6e79d1f387cc6231f105b51853ab9800cdc2c2574dacd0eb0bdc4cda2bc98ba4bb10d67abd6
6
+ metadata.gz: 421c8c0439c63a4455cd2b97dffb8b85a228c70fd975f9b9f72b8d8537a1aa48e5c3c24e3f9d14f38c445068c828aed78eb8fcd539e47e02581f858f8cc78e5b
7
+ data.tar.gz: 97b18290d6382908683b532100cf628f7f2354af35532bd9f03e645c4c71fdb9498067abf22c746c62e73830e1e362ce25122a8898554f882f77521f0c142e64
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # WooCommerce Ruby 3 API
2
2
 
3
- A Ruby wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library, optimized for Ruby 3.0+.
3
+ A Ruby wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library, optimized for Ruby 3.1+.
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,6 +208,7 @@ 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-04-11 - 1.5.3 - Hides sensitive information from ruby "inspect". Prevents accidental exposure in logs or console output.
211
212
  - 2025-04-11 - 1.5.2 - Fixes gemfile.lock issue.
212
213
  - 2025-04-11 - 1.5.1 - Adds RuboCop for code quality. Fixes RuboCop violations. Refactors code and tests for easier maintainability.
213
214
  - 2025-04-10 - 1.5.0 - Update code for Ruby 3.1+ compatibility using Addressable::URI and base64 gem. Add Github CI actions.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WooCommerce
4
- VERSION = "1.5.2"
4
+ VERSION = "1.5.4"
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
@@ -33,8 +33,9 @@ Gem::Specification.new do |s|
33
33
 
34
34
  s.add_runtime_dependency "addressable", "~> 2.8.1"
35
35
  s.add_runtime_dependency "base64", "~> 0.2.0"
36
- s.add_runtime_dependency "httparty", "~> 0.23.1"
36
+ s.add_runtime_dependency "httparty", "~> 0.24.0"
37
37
  s.add_runtime_dependency "json", "~> 2.10.2", ">= 2.6.0"
38
+ s.add_runtime_dependency "rexml", "~> 3.4.2"
38
39
 
39
40
  # Security measures
40
41
  s.metadata["rubygems_mfa_required"] = "true"
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.2
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Sanches
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.23.1
47
+ version: 0.24.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.23.1
54
+ version: 0.24.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +72,20 @@ dependencies:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: 2.6.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: rexml
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 3.4.2
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 3.4.2
75
89
  description: This gem provides a wrapper to access the WooCommerce REST API, optimized
76
90
  for Ruby 3+
77
91
  email: ben@chemica.co.uk