italian-ruby 1.5.0 → 1.5.4

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: 07e1b903441560bbcc4042bcc0b23727be946bd5672b0078245a2f0bcc66170a
4
- data.tar.gz: eb4f909ebcc06a24d4b9ff8d073ac6c5dfdc23ed5fed65c3bb6fb6da772b47e2
3
+ metadata.gz: c1550fed9fa5d8627a12423a83717323320906d71af217af9971b1dc17d0ad4d
4
+ data.tar.gz: 985f523686345ec7362b1e06181276da70c6d1fba9f026b36d11d9d8fd23d4b4
5
5
  SHA512:
6
- metadata.gz: 72f2ec931d331bb5c118339b0eb3600d39ce5869a538968f882ceda483c6d57381205b22f0a6d1005b098f162d9d31b9a046a748665fdf8855b292a194660981
7
- data.tar.gz: bfc95da88e365e915c241c6d534c6679ed4a6912e1eda479c6af37a1f7eadb62ca63e005b056b949a8de85e94eebb820dc049425003596453f70ae5d363bef86
6
+ metadata.gz: 76f69ca7661e93da77319403fe443fe8d9abee62a797bc09bee70db8f474c317a418f4228639f2598e353ccab32d363a3f86c5d5d2ce3b1e44f2b365520b098e
7
+ data.tar.gz: 4b35ab2ba0a2abd0be8b784f2000e4652e6ddf598705cb38c4d5531fc349f7dd034ad6e1c34464605be7e8245a75f08a50b72ad9ab2e51d30814f97751eb6054
@@ -4,7 +4,7 @@ class File
4
4
 
5
5
  class << self
6
6
  alias :espandi :expand_path
7
- alias :nome_file :basename
7
+ alias :nome_base :basename
8
8
  alias :nome_cartella :dirname
9
9
  alias :estensione :extname
10
10
  alias :esiste? :exists?
@@ -14,6 +14,41 @@ class Array
14
14
  !include? *args
15
15
  end
16
16
 
17
+ ##
18
+ # Divide la lista in 100 pacchetti in modo che ogni pacchetto abbia
19
+ # lo stesso numero di elementi.
20
+ def in_pacchetti_percentuali
21
+ conteggio = self.count
22
+
23
+ if conteggio < 100
24
+ avanzamento = 100.0 / conteggio
25
+ indice = 0
26
+
27
+ self.each.with_index do |elemento, indice_elemento|
28
+ pacchetto = [ elemento ]
29
+ indice += avanzamento
30
+ indice = 100 if indice_elemento == conteggio - 1
31
+ yield pacchetto, indice.round, 100 if block_given?
32
+ end
33
+ else
34
+ avanzamento = conteggio / 100.0
35
+ elementi_presi = 0
36
+ percentile = 0
37
+ indice = 0
38
+
39
+ while percentile < 100
40
+ elementi_da_prendere = (indice + avanzamento).round - 1
41
+ pacchetto = self[elementi_presi..elementi_da_prendere]
42
+ elementi_presi = elementi_da_prendere + 1
43
+ indice += avanzamento
44
+ percentile += 1
45
+ yield pacchetto, percentile, 100 if block_given?
46
+ end
47
+ end
48
+
49
+ self
50
+ end
51
+
17
52
  ##
18
53
  # Esegue i metodi specificati per ogni elemento della lista.
19
54
  def campiona(*method_names)
@@ -46,6 +46,13 @@ class Date
46
46
  def formatta_locale(format)
47
47
  formattazione = strftime format
48
48
  formattazione
49
+ .gsub(/Monday/i, "Lunedì")
50
+ .gsub(/Tuesday/i, "Martedì")
51
+ .gsub(/Wednesday/i, "Mercoledì")
52
+ .gsub(/Thursday/i, "Giovedì")
53
+ .gsub(/Friday/i, "Venerdì")
54
+ .gsub(/Saturday/i, "Sabato")
55
+ .gsub(/Sunday/i, "Domenica")
49
56
  .gsub(/January/i, "Gennaio")
50
57
  .gsub(/February/i, "Febbraio")
51
58
  .gsub(/March/i, "Marzo")
@@ -20,7 +20,20 @@ class Time
20
20
  if defined? I18n
21
21
  I18n.l self, format: format
22
22
  else
23
- strftime format
23
+ formattazione = strftime format
24
+ formattazione
25
+ .gsub(/January/i, "Gennaio")
26
+ .gsub(/February/i, "Febbraio")
27
+ .gsub(/March/i, "Marzo")
28
+ .gsub(/April/i, "Aprile")
29
+ .gsub(/May/i, "Maggio")
30
+ .gsub(/June/i, "Giugno")
31
+ .gsub(/July/i, "Luglio")
32
+ .gsub(/August/i, "Agosto")
33
+ .gsub(/September/i, "Settembre")
34
+ .gsub(/October/i, "Ottobre")
35
+ .gsub(/November/i, "Novembre")
36
+ .gsub(/December/i, "Dicembre")
24
37
  end
25
38
  end
26
39
 
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSIONE = "1.5.0"
3
+ VERSIONE = "1.5.4"
4
4
  end
5
5
  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.5.0
4
+ version: 1.5.4
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-23 00:00:00.000000000 Z
11
+ date: 2021-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler