feat(clients): add Ruby client - #2
Conversation
ogyamada
left a comment
There was a problem hiding this comment.
Thanks, this is a good client. I ran it on Ruby 3.0 against the sandbox courier: lookups, wilaya_ship_code (68 resolves to 28), create/track/rates and the error envelope all behave. Two things before I merge.
-
docs/integrating.mdpicked up an auto-format pass. The Node and Apps Script examples went from single to double quotes and the tables got padded, which is 49 of the 88 added lines and nothing to do with Ruby. The repo has no prettier config and the other docs keep the compact|---|---|tables. Could you revert those hunks and keep only the new Ruby section, the two table rows, and the raw HTTP line? -
credentials:is a required keyword andpostalways sends it. The other three clients made it optional in 1.1.0 so the sandbox courier works without a fake key. Right nowDzShip.new(courier: "sandbox")raisesmissing keyword: :credentials, andcredentials: nilsends"credentials": null, which the API rejects with a 400. Default it to nil and leave the key out of the body when it is nil or empty, the way the Python client does.
Nit, take it or leave it: the repo's commit subjects are plain sentences ("Add a Ruby client") rather than conventional prefixes.
Adds clients/ruby/dzship.rb (stdlib only, Ruby 3.0+) and documents it in README and the integrating guide, with a full example and Rails line. Compatible with freeship v1.1