italian-ruby 1.3.1 → 1.3.6

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: 2b444d497c858ea3ea58fb8448a6ef58965d3c4dd024d3ef54101e9f1787a6e9
4
- data.tar.gz: 1b6af0bfde48e514bc4741e95c23e9d240866f6001b3ab1dcfe1267bc72dc02e
3
+ metadata.gz: b00ae2e653f64122b2ebcbba9d7fbdecf5fc723e572fea3c412a51fdd62306fb
4
+ data.tar.gz: d576f97f863cb3da6595f3799ccbaf2c4918f0b6e49ef7859fca55713558650b
5
5
  SHA512:
6
- metadata.gz: ed29c9544485eb9384765b36423e8ae752aca8e878329c3706f87712e141a27373cbcdd54199e9198832f73c0c6d96bcd27682880bcbfd897dcd862aa3d7c715
7
- data.tar.gz: e0e6f2fe80b37e860731ec47d16cccf2b705f35de3b8268677d3801853fcf233de88648aed1c82c6b0141f6de11e5f38a93f115938a04e9b7002af4cab6e0c93
6
+ metadata.gz: 346ac67bcc57dd4267a7e9ede4c9574e6e472336712edcb3688756000c629e7f978863be0118ba424cdaa19078f931df201a57b32bc0fc02ac708785fc705a96
7
+ data.tar.gz: e1291232d2467c87fb83cf09c312d9a602a076095c76839e0cbdd51656aba1f3ec4f0d2cda628221ab55368f059b06bda28d7c8517a53956c0ff76e7d438a580
@@ -5,6 +5,8 @@ class NilClass
5
5
  alias :nullo? :nil?
6
6
  alias :nulla? :nil?
7
7
  alias :in_stringa :to_s
8
+ alias :in_intero :to_i
9
+ alias :in_decimale :to_f
8
10
 
9
11
  alias :non_è_nullo? :esiste?
10
12
  alias :non_è_nulla? :esiste?
@@ -31,6 +31,8 @@ class String
31
31
  alias :vuota? :empty?
32
32
  alias :vuoto? :empty?
33
33
  alias :spoglia :strip
34
+ alias :spoglia_a_sinistra :lstrip
35
+ alias :spoglia_a_destra :rstrip
34
36
  alias :mastica :chomp
35
37
  alias :conteggio :count
36
38
  alias :conteggia :count
@@ -36,6 +36,11 @@ class Date
36
36
  Date.new self.year, 12, 31
37
37
  end
38
38
 
39
+ ##
40
+ # Restituisce il tempo all'ora specificata.
41
+ def alle(ore, minuti = 0, secondi = 0)
42
+ self.in_tempo.alle ore, minuti, secondi
43
+ end
39
44
 
40
45
  # Formatta la data secondo la rappresentazione passata.
41
46
  def formatta_locale(format)
@@ -65,6 +65,20 @@ class Hash
65
65
  self.select { |key, value| key.in? keys }
66
66
  end
67
67
 
68
+ ##
69
+ # Somma due mappe.
70
+ def +(altra_mappa)
71
+ altra_mappa.each do |chiave, valore|
72
+ if self.has_key? chiave
73
+ valore_sommato = valore + self[chiave]
74
+ self.store chiave, valore_sommato
75
+ else
76
+ self.store chiave, valore
77
+ end
78
+ end
79
+ self
80
+ end
81
+
68
82
  ##
69
83
  # Ritorna una rappresentazione a singolo livello, con notazione ".".
70
84
  def puntifica(*prefissi)
@@ -68,7 +68,7 @@ module Kernel
68
68
  Dir["#{cartella}/**/#{archivio}.ir"]
69
69
  end
70
70
  archivio_da_tradurre = archivi_in_memoria.flatten.compact.first
71
- archivio_da_richiedere = Italian::Ruby.percorso_archivio_tradotto archivio_in_italiano_da_tradurre
71
+ archivio_da_richiedere = Italian::Ruby.percorso_archivio_tradotto archivio_da_tradurre
72
72
  traduci archivio_da_tradurre
73
73
  Object.autoload costante, archivio_da_richiedere
74
74
  end
@@ -14,4 +14,11 @@ class Set
14
14
  self
15
15
  end
16
16
 
17
+ ##
18
+ # Converte l'insieme in una mappa.
19
+ def in_mappa(&block)
20
+ return self.map(&block).to_h if block_given?
21
+ raise ArgumentError, "must pass a block in order to convert a Set into a Hash"
22
+ end
23
+
17
24
  end
@@ -24,6 +24,24 @@ class Time
24
24
  end
25
25
  end
26
26
 
27
+ ##
28
+ # Sposta il tempo alle ore specificate.
29
+ def alle(ore, minuti = 0, secondi = 0)
30
+ Time.new(self.year, self.month, self.day, ore, minuti, secondi)
31
+ end
32
+
33
+ ##
34
+ # Ritorna il tempo all'inizio del giorno.
35
+ def inizio_giorno
36
+ Time.new(self.year, self.month, self.day)
37
+ end
38
+
39
+ ##
40
+ # Ritorna il tempo alla fine del giorno.
41
+ def fine_giorno
42
+ Time.new(self.year, self.month, self.day, 23, 59, 59)
43
+ end
44
+
27
45
  ##
28
46
  # Ritorna il tempo all'inizio dell'ora.
29
47
  def inizio_ora
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSIONE = "1.3.1"
3
+ VERSIONE = "1.3.6"
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.3.1
4
+ version: 1.3.6
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-02-25 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler