italian-ruby 1.2.0 → 1.2.5

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: e4bebb83d1f1a42c9233a42f44ad75e112e2ec7ac353447bf5dfc5371de6bb2c
4
- data.tar.gz: 68c110d35fa4cbe4ea6608de9acce8fea2b65b1f61ef7b0396f2fb257929387c
3
+ metadata.gz: 43bae6de3f2564f8154ec1f312f1e0e1d5b23ba1c1bae6dfa7913a0b75e3d235
4
+ data.tar.gz: bb395a89ddbfbde39ea917e73f792e63372c83b64f30777f555028c2f017f41d
5
5
  SHA512:
6
- metadata.gz: a4f199506fc8b19f03a9c139d136740f42db164b6a5357d70394df95904d013984e506ce570d73796365d7cbfff7ffc25451d7ac0db7e84bb5b030b46920d614
7
- data.tar.gz: ceeaf6dc7bbc497a080f14881d446c2cc24c8f44c85563e457665ffc37d9c6dfb6fe80525ca30fa1a2ccf898cb59e5700c7752a99b8b82caaeb080022def2ff9
6
+ metadata.gz: 24e14fe80a17bce4d5da2b67d2530840d28997d8154b8193d18bc7a2addec228cb2ad79cad219328d55f4c26640357814165f1e6aaa20b56f7a305301e7f9b65
7
+ data.tar.gz: b4a5510e3b7d90b355ffcfbf972f93b93ef928cd8fb8c4ed274f722fb80d0e464f53ac236627fcded246991ca61fdaff546c2f39ead1fc2477c4b4311d313422
@@ -6,6 +6,8 @@ class Date
6
6
  class << self
7
7
  alias :oggi :today
8
8
  alias :converti :parse
9
+ alias :da_stringa :strptime
10
+ alias :deformatta :strptime
9
11
  end
10
12
 
11
13
  alias :anno_prossimo :next_year
@@ -14,6 +16,7 @@ class Date
14
16
  alias :in_stringa :to_s
15
17
  alias :in_data :to_date
16
18
  alias :in_tempo :to_time
19
+ alias :giorno :day
17
20
  alias :giorno_della_settimana :cwday
18
21
  alias :settimana :cweek
19
22
  alias :mese :month
@@ -9,7 +9,9 @@ class File
9
9
  alias :estensione :extname
10
10
  alias :esiste? :exists?
11
11
  alias :scrivi :write
12
+ alias :scrivi_binario :binwrite
12
13
  alias :leggi :read
14
+ alias :leggi_binario :binread
13
15
  alias :apri :open
14
16
  alias :cancella :unlink
15
17
  end
@@ -1,7 +1,9 @@
1
1
  # frozen_string_literal: true
2
+ require "stringio"
2
3
 
3
4
  class String
4
5
  alias :congela :freeze
6
+ alias :congela_in_profondità :freeze
5
7
  alias :caratteri :chars
6
8
  alias :prima_maiuscola :capitalize
7
9
  alias :in_simbolo :to_sym
@@ -26,6 +28,8 @@ class String
26
28
  alias :rimpiazza :gsub
27
29
  alias :rimpiazza! :gsub!
28
30
  alias :scansiona :scan
31
+ alias :vuota? :empty?
32
+ alias :vuoto? :empty?
29
33
  alias :spoglia :strip
30
34
  alias :mastica :chomp
31
35
  alias :conteggio :count
@@ -40,4 +44,5 @@ class String
40
44
  alias :specificata? :esiste?
41
45
  end
42
46
 
43
- Stringa = String
47
+ Stringa = String
48
+ StringaIO = StringIO
@@ -14,6 +14,7 @@ require_relative "metodi/numeric"
14
14
  require_relative "metodi/object"
15
15
  require_relative "metodi/open_struct"
16
16
  require_relative "metodi/range"
17
+ require_relative "metodi/set"
17
18
  require_relative "metodi/socket"
18
19
  require_relative "metodi/string"
19
20
  require_relative "metodi/symbol"
@@ -72,6 +72,17 @@ class Array
72
72
  end
73
73
  end
74
74
 
75
+ ##
76
+ # Congela in profondità la lista.
77
+ def congela_in_profondità
78
+ self.each do |element|
79
+ next unless element.respond_to? :congela_in_profondità
80
+ element.congela_in_profondità
81
+ end
82
+ self.freeze
83
+ self
84
+ end
85
+
75
86
  ##
76
87
  # Mappa e rimuove duplicati in un unico metodo.
77
88
  def mappa_e_rimuovi_duplicati(&block)
@@ -108,7 +119,7 @@ class Array
108
119
 
109
120
  ##
110
121
  # Restituisce la lista togliendo gli ultimi n elementi.
111
- def tronca(n = 0)
122
+ def tronca(n = 1)
112
123
  self[0..(-1 - n)]
113
124
  end
114
125
 
@@ -47,6 +47,17 @@ class Hash
47
47
  copy
48
48
  end
49
49
 
50
+ ##
51
+ # Congela in profondità la mappa.
52
+ def congela_in_profondità
53
+ self.each do |key, value|
54
+ next unless value.respond_to? :congela_in_profondità
55
+ value.congela_in_profondità
56
+ end
57
+ self.freeze
58
+ self
59
+ end
60
+
50
61
  ##
51
62
  # Espone le chiavi passate in una nuova mappa.
52
63
  def esponi(*keys)
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Set
4
+
5
+
6
+ ##
7
+ # Congela in profondità l'insieme.
8
+ def congela_in_profondità
9
+ self.each do |element|
10
+ next unless element.respond_to? :congela_in_profondità
11
+ element.congela_in_profondità
12
+ end
13
+ self.freeze
14
+ self
15
+ end
16
+
17
+ end
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSIONE = "1.2.0"
3
+ VERSIONE = "1.2.5"
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.2.0
4
+ version: 1.2.5
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-12-28 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -125,6 +125,7 @@ files:
125
125
  - lib/italian/ruby/metodi/open_struct.rb
126
126
  - lib/italian/ruby/metodi/range.rb
127
127
  - lib/italian/ruby/metodi/rspec.rb
128
+ - lib/italian/ruby/metodi/set.rb
128
129
  - lib/italian/ruby/metodi/socket.rb
129
130
  - lib/italian/ruby/metodi/string.rb
130
131
  - lib/italian/ruby/metodi/symbol.rb