pdnd-ruby-client 0.1.6 → 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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +8 -0
- data/lib/pdnd-ruby-client/client.rb +7 -7
- data/lib/pdnd-ruby-client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bae1645fd551de26656b5f584106785c506f36df8385539bce449051cb64a3b2
|
|
4
|
+
data.tar.gz: 7ebb2b41a7f706dc5f706dc929065d2ae52c68febc960a59812bb956840e88d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9f3d655828043ee8f6a76faf1d1a5ea80baff0519330844375930a119ea3cd24217ed6bcffa915a0fb5f2bb815e93587236482a98fc0cf8149699c532c2f20e
|
|
7
|
+
data.tar.gz: c4bd729e5abd4eed356a90635dcb26957e6a6b347601391ba7552f372bf4bbd832e8b98ab5fe20879662b1f16fbe296110d23d534e3414fa94d52df51aa9a8ba
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
7
|
+
## [v0.1.7](https://github.com/isprambiente/pdnd-ruby-client/tree/v0.1.7) (2025-11-07)
|
|
8
|
+
|
|
9
|
+
[Full Changelog](https://github.com/isprambiente/pdnd-ruby-client/compare/v0.1.6...v0.1.7)
|
|
10
|
+
|
|
3
11
|
## [v0.1.6](https://github.com/isprambiente/pdnd-ruby-client/tree/v0.1.6) (2025-10-08)
|
|
4
12
|
|
|
5
13
|
[Full Changelog](https://github.com/isprambiente/pdnd-ruby-client/compare/v0.1.5...v0.1.6)
|
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
|
-
|
|
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: #{
|
|
55
|
-
[response.status, JSON.parse(
|
|
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
|