mangusta 0.5.2 → 0.5.3
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/lib/mangusta/ripostiglio.ir +13 -3
- data/lib/mangusta/versione.ir +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8ea0eff3796365441e8c84d2744d3bfbd60f8d78ee42b55d01d3a52d07b02348
|
|
4
|
+
data.tar.gz: a16cc36ce5fc14070e31603aacf70d80709a79db566ed18d72d397b2add1c73e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b2fa8faa9ec46b2f6ca4c5845430b240e91636d1d0f52b30e3b8f9e3a8d96910cc8546b73f53f14662b644d430634f1ed4ee5fcbba25e942f291ff6d5482289
|
|
7
|
+
data.tar.gz: 2149622bdb334905a098b0b727fb7feaf83e232eaa21d62f7d8febfcac082fd4c2c74a7ce212b6f3c14b6ec904ba1b725b44c6894942a43b9b7714f39205e1ea
|
data/lib/mangusta/ripostiglio.ir
CHANGED
|
@@ -41,6 +41,7 @@ modulo Mangusta
|
|
|
41
41
|
estendi Mangusta::Ripostiglio::MetodiDiClasse::Persistenza
|
|
42
42
|
|
|
43
43
|
classe << se_stesso
|
|
44
|
+
accessore :nome_base_dati
|
|
44
45
|
accessore :nome_collezione
|
|
45
46
|
accessore :nome_classe_documento
|
|
46
47
|
accessore :classe_documento
|
|
@@ -55,14 +56,23 @@ modulo Mangusta
|
|
|
55
56
|
##
|
|
56
57
|
# Ritorna l'oggetto collezione agganciato a questo ripostiglio.
|
|
57
58
|
# Se chiamato con argomento, imposta la collezione all'argomento passato.
|
|
58
|
-
definisci collezione(nome_collezione_da_impostare = nullo)
|
|
59
|
-
se nome_collezione_da_impostare.
|
|
59
|
+
definisci collezione(nome_collezione_da_impostare = nullo, base_dati: nullo)
|
|
60
|
+
se nome_collezione_da_impostare.specificato?
|
|
60
61
|
se_stesso.nome_collezione = nome_collezione_da_impostare
|
|
62
|
+
se_stesso.nome_base_dati = base_dati se base_dati.specificata?
|
|
61
63
|
ritorna nome_collezione
|
|
62
64
|
fine
|
|
63
65
|
|
|
64
66
|
alza "Mangusta non è ancora stato connesso ad una base dati" se Mangusta.connessione.nulla?
|
|
65
|
-
|
|
67
|
+
|
|
68
|
+
se se_stesso.nome_base_dati.specificato?
|
|
69
|
+
basi_dati = Mangusta.connessione.list_mongo_databases
|
|
70
|
+
base_dati = basi_dati.trova { |base_dati| base_dati.name == se_stesso.nome_base_dati }
|
|
71
|
+
alza "la base dati `#{se_stesso.nome_base_dati}` non esiste" se basi_dati.non_esiste?
|
|
72
|
+
base_dati[se_stesso.nome_collezione]
|
|
73
|
+
altrimenti
|
|
74
|
+
Mangusta.connessione[se_stesso.nome_collezione]
|
|
75
|
+
fine
|
|
66
76
|
fine
|
|
67
77
|
|
|
68
78
|
##
|
data/lib/mangusta/versione.ir
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mangusta
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Francesco Ballardin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-06-
|
|
11
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: italian-ruby
|