italian-ruby 1.3.9 → 1.3.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d574c13b3261f4db0d3f22b3da18765e9bb4b04bde89ae0adf6fca5a8cc08fa2
|
4
|
+
data.tar.gz: 3cdc2809407d18f1a5a85acd0b9d6e8de894518037120c8ed904107070c3ae06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9eaa800b1beed9d1ddda1d4d9256ee9f78c330bef3acb754c454021dbfb387e32a0a222b37e4979d4448747b63c70046da4fa66703ac0d4cb9efbe055e35932b
|
7
|
+
data.tar.gz: f42b4d771f48a34c84fa9779c97161b9c0cdebb871a73f950f3300789c2688fbfab7837f1c4730bdead00dd0e81b783cf3bd013ed89daac684d609248c3a2f42
|
@@ -20,7 +20,7 @@ module Kernel
|
|
20
20
|
Dir["#{cartella}/**/#{archivio}.ir"]
|
21
21
|
end
|
22
22
|
archivio_in_italiano_da_richiedere = archivi_in_memoria.flatten.compact.first
|
23
|
-
return
|
23
|
+
return traduci_e_richiedi archivio_in_italiano_da_richiedere if archivio_in_italiano_da_richiedere != nil
|
24
24
|
|
25
25
|
# Non è stato trovato nessun archivio in italiano corrispondente al nome
|
26
26
|
# passato. Viene ora tentato il caricamento di un file Ruby originale con
|
@@ -116,8 +116,9 @@ module Kernel
|
|
116
116
|
# Ottiene il percorso archivio relativo del sorgente chiamante.
|
117
117
|
def archivio_relativo(sorgente_chiamante, percorso_archivio)
|
118
118
|
cartella_chiamante = File.dirname sorgente_chiamante
|
119
|
-
|
120
|
-
archivio_da_richiedere = Dir["#{
|
119
|
+
percorso_da_richiedere = File.expand_path File.join(cartella_chiamante, percorso_archivio)
|
120
|
+
archivio_da_richiedere = Dir["#{percorso_da_richiedere}.{ir,rb}"].compact.first
|
121
|
+
raise LoadError, "no such file: #{percorso_da_richiedere}.{ir,rb}" if archivio_da_richiedere.nil?
|
121
122
|
archivio_da_richiedere
|
122
123
|
end
|
123
124
|
|
@@ -2,6 +2,30 @@
|
|
2
2
|
|
3
3
|
class Module
|
4
4
|
|
5
|
+
##
|
6
|
+
# Rimanda la costante alla definizione in archivio. La prima volta che viene
|
7
|
+
# incontrata la definizione della costante nel codice, allora l'archivio
|
8
|
+
# verrà richiesto.
|
9
|
+
def rimanda(costante, archivio)
|
10
|
+
archivi_in_memoria = $:.map do |cartella|
|
11
|
+
Dir["#{cartella}/**/#{archivio}.ir"]
|
12
|
+
end
|
13
|
+
archivio_da_tradurre = archivi_in_memoria.flatten.compact.first
|
14
|
+
archivio_da_richiedere = Italian::Ruby.percorso_archivio_tradotto archivio_da_tradurre
|
15
|
+
traduci archivio_da_tradurre
|
16
|
+
self.autoload costante, archivio_da_richiedere
|
17
|
+
end
|
18
|
+
|
19
|
+
##
|
20
|
+
# Come il rimanda, ma usando un percorso relativo.
|
21
|
+
def rimanda_relativo(costante, percorso_archivio)
|
22
|
+
sorgente_chiamante, linea_chiamante = ottieni_sorgente_e_linea_chiamante caller_locations
|
23
|
+
archivio_da_tradurre = archivio_relativo sorgente_chiamante, percorso_archivio
|
24
|
+
archivio_da_richiedere = Italian::Ruby.percorso_archivio_tradotto archivio_da_tradurre
|
25
|
+
traduci archivio_da_tradurre
|
26
|
+
self.autoload costante, archivio_da_richiedere
|
27
|
+
end
|
28
|
+
|
5
29
|
private
|
6
30
|
|
7
31
|
##
|
@@ -43,4 +67,10 @@ class Module
|
|
43
67
|
quando_preposto *args
|
44
68
|
end
|
45
69
|
|
70
|
+
##
|
71
|
+
# Crea un alias per un metodo.
|
72
|
+
def metodo_alias(alias_name, method_name)
|
73
|
+
alias_method alias_name, method_name
|
74
|
+
end
|
75
|
+
|
46
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: italian-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Ballardin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|