pdnd-ruby-client 0.1.7 → 0.1.8

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: 7465358f480a660082893609f41ce73652d42733474cd9110ef614ee15ac84c2
4
- data.tar.gz: f242965866041e9fb499babb40dd77cd2e1eaa81e037fe40c02c10965b60c518
3
+ metadata.gz: bae1645fd551de26656b5f584106785c506f36df8385539bce449051cb64a3b2
4
+ data.tar.gz: 7ebb2b41a7f706dc5f706dc929065d2ae52c68febc960a59812bb956840e88d5
5
5
  SHA512:
6
- metadata.gz: e86020921bef23dd31737efe38f1970ad25329a5dd5c7c42c672ee5e8e67ed1f1a6d728db5756aa5c48850cd663712ff277c6fd1a44e4932f12b201b49abcc29
7
- data.tar.gz: ff73db88ac3b4139ec84c0597ad99fc1525198c5e7da19996af79fec5974db3bec920298b483e2a4ffe6333f861f50f0013a91336e71301367a830679af1574b
6
+ metadata.gz: e9f3d655828043ee8f6a76faf1d1a5ea80baff0519330844375930a119ea3cd24217ed6bcffa915a0fb5f2bb815e93587236482a98fc0cf8149699c532c2f20e
7
+ data.tar.gz: c4bd729e5abd4eed356a90635dcb26957e6a6b347601391ba7552f372bf4bbd832e8b98ab5fe20879662b1f16fbe296110d23d534e3414fa94d52df51aa9a8ba
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.1.8](https://github.com/isprambiente/pdnd-ruby-client/tree/v0.1.8) (2025-11-14)
4
+
5
+ [Full Changelog](https://github.com/isprambiente/pdnd-ruby-client/compare/v0.1.7...v0.1.8)
6
+
3
7
  ## [v0.1.7](https://github.com/isprambiente/pdnd-ruby-client/tree/v0.1.7) (2025-11-07)
4
8
 
5
9
  [Full Changelog](https://github.com/isprambiente/pdnd-ruby-client/compare/v0.1.6...v0.1.7)
data/README.md CHANGED
@@ -164,6 +164,7 @@ ruby bin/pdnd_client.rb --api-url "https://api.pdnd.example.it/resource" --confi
164
164
  - `--env` : Specifica l'ambiente da usare (es. collaudo, produzione). Default: `produzione`
165
165
  - `--config` : Specifica il percorso completo del file di configurazione (es: `--config /configs/sample.json`)
166
166
  - `--debug` : Abilita output dettagliato
167
+ - `--pretty` : Abilita output dei json formattato in modalità leggibile
167
168
  - `--api-url` : URL dell’API da chiamare dopo la generazione del token
168
169
  - `--api-url-filters` : Filtri da applicare all'API (es. ?parametro=valore)
169
170
  - `--status-url` : URL dell’API di status per verificare la validità del token
@@ -189,6 +190,11 @@ ruby bin/pdnd_client.rb --status-url="https://api.pdnd.example.it/status" --conf
189
190
  ruby bin/pdnd_client.rb --debug --api-url="https://api.pdnd.example.it/resource"
190
191
  ```
191
192
 
193
+ **Pretty attivo:**
194
+ ```bash
195
+ ruby bin/pdnd_client.rb --pretty --api-url="https://api.pdnd.example.it/resource"
196
+ ```
197
+
192
198
  ### Opzione di aiuto
193
199
 
194
200
  Se esegui il comando con `--help` oppure senza parametri, viene mostrata una descrizione delle opzioni disponibili e alcuni esempi di utilizzo:
@@ -207,6 +213,7 @@ Opzioni:
207
213
  Default: produzione
208
214
  --config Specifica il percorso completo del file di configurazione
209
215
  --debug Abilita output dettagliato
216
+ --pretty Abilita output dei json formattato in modalità leggibile
210
217
  --api-url URL dell’API da chiamare dopo la generazione del token
211
218
  --api-url-filters Filtri da applicare all'API (es. ?parametro=valore)
212
219
  --status-url URL dell’API di status per verificare la validità del token
@@ -219,6 +226,7 @@ Esempi:
219
226
  ruby bin/pdnd_client.rb --api-url="https://api.pdnd.example.it/resource" --config /percorso/config.json
220
227
  ruby bin/pdnd_client.rb --status-url="https://api.pdnd.example.it/status" --config /percorso/config.json
221
228
  ruby bin/pdnd_client.rb --debug --api-url="https://api.pdnd.example.it/resource"
229
+ ruby bin/pdnd_client.rb --pretty --api-url="https://api.pdnd.example.it/resource"
222
230
  ```
223
231
 
224
232
  ## Variabili di ambiente supportate
@@ -39,20 +39,20 @@ module PDND
39
39
  log_api_search
40
40
 
41
41
  response = perform_request(@api_search.to_s)
42
+ body = response.body.force_encoding('UTF-8')
43
+ raise PDND::APIError.new(response.status, body) unless response.success?
42
44
 
43
- raise PDND::APIError.new(response.status, response.body.force_encoding('UTF-8')) unless response.success?
44
-
45
- puts "📡 Response: #{response.body}" if @debug
46
- [response.status, JSON.parse(response.body)]
45
+ puts "📡 Response: #{body}" if @debug
46
+ [response.status, JSON.parse(body)]
47
47
  end
48
48
 
49
49
  def check_status
50
50
  validate_status_config
51
51
 
52
52
  response = perform_request(@status_url)
53
-
54
- puts "📡 Status response: #{response.body}" if @debug
55
- [response.status, JSON.parse(response.body)]
53
+ body = response.body.force_encoding('UTF-8')
54
+ puts "📡 Status response: #{body}" if @debug
55
+ [response.status, JSON.parse(body)]
56
56
  end
57
57
 
58
58
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PDND
4
4
  class ClientVersion
5
- VERSION = '0.1.7'
5
+ VERSION = '0.1.8'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdnd-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Loreti