italian-ruby 0.9.13 → 0.9.18
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 +4 -4
- data/lib/italian/ruby/core_ext/array.rb +2 -0
- data/lib/italian/ruby/core_ext/errors.rb +4 -0
- data/lib/italian/ruby/core_ext/gems/hanami.rb +26 -0
- data/lib/italian/ruby/core_ext/hash.rb +5 -1
- data/lib/italian/ruby/core_ext/object.rb +4 -0
- data/lib/italian/ruby/core_ext/string.rb +7 -0
- data/lib/italian/ruby/core_ext/time.rb +16 -0
- data/lib/italian/ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5a8e6a9a192784170cfe0f899e319332e32c2fedf826bda0f08e97f29e07b96
|
4
|
+
data.tar.gz: 6273dbbd81c0198f0aab7bb0e16185d9187f82c533dfa65b0ddf61fcb0043f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92a111116bbb0a399c7422572d745f49ff8c88fd185f985e9d4b8a34e8c449dee46be9607f434404852b89cac64bc835d1e208487cce472cbd7e02fea79bea3e
|
7
|
+
data.tar.gz: b000c606201e30e017b51508f1fb92f589173a4e104befde874e1ea9547c36761cf2dc9c78f3c9fcbac373e05a95420327bd07925274f93fd80113c76ce11282
|
@@ -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
|
@@ -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?
|
@@ -25,6 +27,7 @@ class String
|
|
25
27
|
alias :giustifica_a_sinistra :ljust
|
26
28
|
alias :giustifica_a_destra :rjust
|
27
29
|
alias :rimpiazza :gsub
|
30
|
+
alias :rimpiazza! :gsub!
|
28
31
|
alias :spoglia :strip
|
29
32
|
alias :conteggio :count
|
30
33
|
alias :conteggia :count
|
@@ -61,6 +64,10 @@ class String
|
|
61
64
|
Time.parse self
|
62
65
|
end
|
63
66
|
|
67
|
+
def in_classe
|
68
|
+
Object.const_get self
|
69
|
+
end
|
70
|
+
|
64
71
|
def primi(n)
|
65
72
|
self[0..(n - 1)]
|
66
73
|
end
|
@@ -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
|
data/lib/italian/ruby/version.rb
CHANGED
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.
|
4
|
+
version: 0.9.18
|
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-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|