docdata-order 2.3.0 → 2.4.1

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: 590985b29272c02538fc431cd9d8d1c0aac3ec95d960732d7f9e9086c3c031a2
4
- data.tar.gz: bc7ee9aad6969ed3356edb7eaa95082149e04823e5663e9668b7c44cf088ca18
3
+ metadata.gz: eb3a5199f7d8d610c31183ce8761421033170dde0b6b34f3d7de436611795eca
4
+ data.tar.gz: 84a1a4626ebef38203562930d7d4d5f17efa053eed0b54a33e6e51650e27db12
5
5
  SHA512:
6
- metadata.gz: 3dc9102ac8c43271c37e89280d5af148f492c54ee3af3c26ba48f67618e614319b42aea2eb8c72a1df05274ea9a9583dc1fab09d31a5a159f784f11dfbbff0a8
7
- data.tar.gz: 6009315e800b314617239ad87bbb790f77512329b38400e26b516a36453cb1fa73b808ecb8085c48e0e24bce59b9f68b4efec3f4883cfb3c43681abd485a64f6
6
+ metadata.gz: 8b5c7d82f3519af667097a22ff8d54ac5fec750e0e895b8a2181cf7bbd455dd06a08efcea151a9a76000d1450ebf80635d3bd854e81add2dbeb1defece5affba
7
+ data.tar.gz: 1eec6d2289eed4cfb7d2a448c0b5e6a41ee19e2cd22f793e05dfa49c38b5b7dc6b2addcf2e4fb4d71062026459191a247eb924ccb4dc901f8610fceb1729b8be
data/README.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/docdata-order.svg)](https://badge.fury.io/rb/docdata-order)
4
4
  [![Build Status](https://github.com/KentaaNL/docdata-order/actions/workflows/test.yml/badge.svg)](https://github.com/KentaaNL/docdata-order/actions)
5
- [![Code Climate](https://codeclimate.com/github/KentaaNL/docdata-order/badges/gpa.svg)](https://codeclimate.com/github/KentaaNL/docdata-order)
5
+ [![CodeQL](https://github.com/KentaaNL/docdata-order/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/KentaaNL/docdata-order/actions/workflows/github-code-scanning/codeql)
6
6
 
7
7
  Docdata::Order is a Ruby client for the Docdata Order API version 1.3.
8
8
 
9
9
  ## Table of Contents
10
10
 
11
11
  - [Installation](#installation)
12
+ - [Configuration](#configuration)
12
13
  - [Usage](#usage)
13
14
  - [Initialization](#initialization)
14
15
  - [Subject merchant](#subject-merchant)
@@ -41,6 +42,21 @@ Or install it yourself as:
41
42
 
42
43
  $ gem install docdata-order
43
44
 
45
+ ## Configuration
46
+
47
+ Docdata::Order provides a global configuration object that allows you to customize logger output and HTTP timeouts. You can set these options via the `Docdata::Order.configure` block:
48
+
49
+ ```ruby
50
+ Docdata::Order.configure do |config|
51
+ # Set a global logger for Docdata::Order output
52
+ config.logger = Logger.new($stdout)
53
+
54
+ # Set Net::HTTP timeout values (in seconds)
55
+ config.open_timeout = 30
56
+ config.read_timeout = 30
57
+ end
58
+ ```
59
+
44
60
  ## Usage
45
61
 
46
62
  ### Initialization
@@ -62,7 +62,9 @@ module Docdata
62
62
 
63
63
  params.merge!(log: true, log_level: :debug, pretty_print_xml: true) if @options[:debug]
64
64
 
65
- params[:logger] = Rails.logger if defined?(Rails)
65
+ params[:open_timeout] = Docdata::Order.config.open_timeout
66
+ params[:read_timeout] = Docdata::Order.config.read_timeout
67
+ params[:logger] = Docdata::Order.config.logger
66
68
 
67
69
  Savon.client(params)
68
70
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Docdata
4
4
  module Order
5
- VERSION = '2.3.0'
5
+ VERSION = '2.4.1'
6
6
  end
7
7
  end
data/lib/docdata/order.rb CHANGED
@@ -9,3 +9,35 @@ require 'docdata/order/request'
9
9
  require 'docdata/order/response'
10
10
  require 'docdata/order/urls'
11
11
  require 'docdata/order/version'
12
+
13
+ require 'logger'
14
+
15
+ module Docdata
16
+ # :nodoc:
17
+ module Order
18
+ # Holds the global Docdata::Order configuration.
19
+ class Configuration
20
+ attr_accessor :logger, :open_timeout, :read_timeout
21
+
22
+ def initialize
23
+ @logger = Rails.logger if defined?(Rails)
24
+ @open_timeout = 30
25
+ @read_timeout = 30
26
+ end
27
+ end
28
+
29
+ class << self
30
+ def config
31
+ @config ||= Configuration.new
32
+ end
33
+
34
+ def configure
35
+ yield(config)
36
+ end
37
+
38
+ def reset!
39
+ @config = Configuration.new
40
+ end
41
+ end
42
+ end
43
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docdata-order
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-31 00:00:00.000000000 Z
11
+ date: 2025-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,14 +132,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - ">="
134
134
  - !ruby/object:Gem::Version
135
- version: 3.0.0
135
+ version: 3.2.0
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.2.33
142
+ rubygems_version: 3.4.19
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Ruby client for the Docdata Order API