italian-ruby 0.9.11 → 0.9.16

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: 8e40157466748c8b10b1d9200ccb9ce71189945dbc586e0b30b6d2fe93432b9a
4
- data.tar.gz: e353bcb48eeff33625078010aa1a84c4b56b5dc0cbde715d39e4a76556b2416c
3
+ metadata.gz: 57478929b50282fa000339fec8d9357991d5d393a06f7ccdfacf0f1288bf9ff4
4
+ data.tar.gz: 78f6a2a4fff16dbb06951de926cebaa6fcdfc4372df81805fe19b849193248c9
5
5
  SHA512:
6
- metadata.gz: f80592c447639aa7a28ef678209b6ac0bf422e55b3f1eda1eabec059f82f6c28dea8b311fe88cc557ddebae54772dc12f1cd0c88cc0f593ed38b7db80c8fdf6b
7
- data.tar.gz: 28a3b7d02b3fc7f9395f9f826508815dc27ae3e34054c840bbe0adabe263f5d26e1d6ab2f99c049c197d2e9fc4debd269d85e0aeb37a75b9e140f2f08a8dd469
6
+ metadata.gz: '0280f2c8e7afb97ea0b303f216b54c83da0ce24df95219b1f5dff417ae0630be46b70223a0172328c104cacc8a5485a0323a1fabe687ae882f9e87b9d7485ee3'
7
+ data.tar.gz: 02acc4e6971374f277c3311360421a0336a4370914bd28a16123bc5bd7a841e205192a94076ba5ead4e7e5a36e2f088cc399c6706176aed83b36ec06c745159d
data/README.md CHANGED
@@ -76,7 +76,7 @@ LibreriaInteressantissima.metodo_interessantissimo
76
76
  # Che roba!
77
77
  ```
78
78
 
79
- È possibile anche utilizzare il `richiedi`, che funziona come il `require` di Ruby, nel remoto caso in cui _qualcuno_ faccia una gemma in Italian Ruby, la pubblichi su rubygems.org e _qualcun'altro_ la scarichi e la installi. Se mai succedesse, funzionerebbe così:
79
+ È possibile anche utilizzare il `richiedi`, che funziona come il `require` di Ruby, nel remoto caso in cui _qualcuno_ faccia una gemma in Italian Ruby, la pubblichi su rubygems.org e _qualcun altro_ la scarichi e la installi. Se mai succedesse, funzionerebbe così:
80
80
 
81
81
  ```ruby
82
82
  # tuo_file_ruby.rb
@@ -29,6 +29,7 @@ class Date
29
29
  alias :settimana :cweek
30
30
  alias :mese :month
31
31
  alias :anno :year
32
+ alias :fra? :between?
32
33
  alias :formatta :strftime
33
34
 
34
35
  def due_anni_fa
@@ -7,6 +7,7 @@ class Float
7
7
  INFINITO = INFINITY
8
8
 
9
9
  alias :in_intero :to_i
10
+ alias :in_decimale :to_f
10
11
  alias :in_stringa :to_s
11
12
  alias :arrotonda :round
12
13
  alias :arrotonda_per_eccesso :ceil
@@ -9,16 +9,42 @@ module Hanami
9
9
  alias :errore! :error!
10
10
  alias :errore :error
11
11
 
12
+ def termina!
13
+ throw :stop
14
+ end
15
+
12
16
  module LegacyInterface
13
17
  def chiama
14
18
  _call { super }
15
19
  end
20
+
21
+ def _call
22
+ catch :fail do
23
+ catch :stop do
24
+ validate!
25
+ yield
26
+ end
27
+ end
28
+
29
+ _prepare!
30
+ end
16
31
  end
17
32
  module Interface
18
33
  def chiama(*args)
19
34
  @__result = ::Hanami::Interactor::Result.new
20
35
  _call(*args) { super }
21
36
  end
37
+
38
+ def _call(*args)
39
+ catch :fail do
40
+ catch :stop do
41
+ validate!(*args)
42
+ yield
43
+ end
44
+ end
45
+
46
+ _prepare!
47
+ end
22
48
  end
23
49
 
24
50
  class Result
@@ -76,6 +76,10 @@ class Hash
76
76
  end
77
77
  copy
78
78
  end
79
+
80
+ def esponi(*keys)
81
+ self.select { |key, value| key.in? keys }
82
+ end
79
83
  end
80
84
 
81
- Mappa = Hash
85
+ Mappa = Hash
@@ -5,6 +5,7 @@
5
5
 
6
6
  class String
7
7
  alias :congela :freeze
8
+ alias :caratteri :chars
8
9
  alias :prima_maiuscola :capitalize
9
10
  alias :in_simbolo :to_sym
10
11
  alias :in_stringa :to_s
@@ -16,6 +17,7 @@ class String
16
17
  alias :maiuscolo :upcase
17
18
  alias :minuscola :downcase
18
19
  alias :minuscolo :downcase
20
+ alias :indice :index
19
21
  alias :combacia? :match?
20
22
  alias :inizia_con? :start_with?
21
23
  alias :finisce_con? :end_with?
@@ -48,6 +48,22 @@ class Time
48
48
  return (self.to_date <=> other) if other.is_a? Date
49
49
  original_compare other
50
50
  end
51
+
52
+ def inizio_ora
53
+ Time.new(self.year, self.month, self.day, self.hour)
54
+ end
55
+
56
+ def fine_ora
57
+ Time.new(self.year, self.month, self.day, self.hour, 59, 59)
58
+ end
59
+
60
+ def inizio_minuto
61
+ Time.new(self.year, self.month, self.day, self.hour, self.min)
62
+ end
63
+
64
+ def fine_minuto
65
+ Time.new(self.year, self.month, self.day, self.hour, self.min, 59)
66
+ end
51
67
  end
52
68
 
53
69
  Tempo = Time
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSION = "0.9.11"
3
+ VERSION = "0.9.16"
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: 0.9.11
4
+ version: 0.9.16
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-08-31 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler