italian-ruby 1.0.1 → 1.0.2
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: ee8de3a330795b109c5851c18e0f146c1c7e2006a805487bb3af0095ac102a84
|
4
|
+
data.tar.gz: 872fec5fd21cea7baee6e553954e1eee7380ca85119432456826ebfa67618ccb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 439f5f7b26f73290b3f0c3837082cc3ba45465a75940edbc15da0cdcccf54139cc0cc870549541c687d94c59bd0ab0d7450c658bb542ff36316fc8bf0afda7c0
|
7
|
+
data.tar.gz: 044d1934168a41b6e54c7938bca1610b1e47891d8aa589a5cd69b9f03512e12de9615e49188b76e491e17a5bf78a2f3959899f76ec42ba9a966772646a6e10e4
|
@@ -13,11 +13,12 @@ end
|
|
13
13
|
class UNIXSocket
|
14
14
|
|
15
15
|
alias :scrivi :write
|
16
|
+
alias :prendi_byte :getbyte
|
16
17
|
alias :leggi :read
|
17
18
|
alias :ricevi :recv
|
18
19
|
alias :leggi_linea :readline
|
19
20
|
alias :chiudi :close
|
20
|
-
|
21
|
+
|
21
22
|
end
|
22
23
|
|
23
24
|
class UNIXServer
|
@@ -26,5 +27,22 @@ class UNIXServer
|
|
26
27
|
|
27
28
|
end
|
28
29
|
|
30
|
+
class TCPSocket
|
31
|
+
|
32
|
+
alias :scrivi :write
|
33
|
+
alias :prendi_byte :getbyte
|
34
|
+
alias :leggi :read
|
35
|
+
alias :ricevi :recv
|
36
|
+
alias :leggi_linea :readline
|
37
|
+
alias :chiudi :close
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
class TCPServer
|
42
|
+
|
43
|
+
alias :accetta :accept
|
44
|
+
|
45
|
+
end
|
46
|
+
|
29
47
|
|
30
48
|
Presa = Socket
|
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
class String
|
4
4
|
|
5
|
+
##
|
6
|
+
# Codici colori.
|
7
|
+
CODICI_COLORI = Hash[
|
8
|
+
rosso: "31",
|
9
|
+
verde: "32",
|
10
|
+
giallo: "33",
|
11
|
+
blu: "34",
|
12
|
+
magenta: "35",
|
13
|
+
azzurro: "36",
|
14
|
+
arancione: "38;5;214"
|
15
|
+
].freeze
|
16
|
+
|
5
17
|
##
|
6
18
|
# Metodi per la colorizzazione delle stringhe,
|
7
19
|
# quando stampate a terminale.
|
@@ -14,31 +26,45 @@ class String
|
|
14
26
|
end
|
15
27
|
|
16
28
|
def rosso
|
17
|
-
colorize
|
29
|
+
colorize CODICI_COLORI[:rosso]
|
18
30
|
end
|
19
31
|
|
20
32
|
def verde
|
21
|
-
colorize
|
33
|
+
colorize CODICI_COLORI[:verde]
|
22
34
|
end
|
23
35
|
|
24
36
|
def giallo
|
25
|
-
colorize
|
37
|
+
colorize CODICI_COLORI[:giallo]
|
26
38
|
end
|
27
39
|
|
28
40
|
def blu
|
29
|
-
colorize
|
41
|
+
colorize CODICI_COLORI[:blu]
|
30
42
|
end
|
31
43
|
|
32
44
|
def magenta
|
33
|
-
colorize
|
45
|
+
colorize CODICI_COLORI[:magenta]
|
34
46
|
end
|
35
47
|
|
36
48
|
def azzurro
|
37
|
-
colorize
|
49
|
+
colorize CODICI_COLORI[:azzurro]
|
38
50
|
end
|
39
51
|
|
40
52
|
def arancione
|
41
|
-
colorize
|
53
|
+
colorize CODICI_COLORI[:arancione]
|
54
|
+
end
|
55
|
+
|
56
|
+
def decolorizza
|
57
|
+
self.gsub /(\u001b\[3\dm|\u001b\[3\d;\d;\d\d\dm|\u001b\[0m)/, ""
|
58
|
+
end
|
59
|
+
|
60
|
+
def disaccoppia_colore
|
61
|
+
indice_inizio_colore = self.index "m"
|
62
|
+
codice_colore = self[2..indice_inizio_colore - 1]
|
63
|
+
|
64
|
+
porzione_decolorizzata = self[indice_inizio_colore + 1..-5]
|
65
|
+
colore = CODICI_COLORI.invert.fetch codice_colore
|
66
|
+
|
67
|
+
[ colore, porzione_decolorizzata ]
|
42
68
|
end
|
43
69
|
|
44
70
|
##
|
@@ -95,7 +95,7 @@ module Italian
|
|
95
95
|
contenuto_tradotto.gsub! /(\b)finché(\b)/, "\\1until\\2"
|
96
96
|
contenuto_tradotto.gsub! /(\b)quando(\b)/, "\\1when\\2"
|
97
97
|
contenuto_tradotto.gsub! /(\b)mentre(\b)/, "\\1while\\2"
|
98
|
-
contenuto_tradotto.gsub! /(\b)rilascia(\
|
98
|
+
contenuto_tradotto.gsub! /(\b)rilascia(\s|$)/, "\\1yield\\2"
|
99
99
|
|
100
100
|
contenuto_tradotto
|
101
101
|
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.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Ballardin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|