italian-ruby 0.8.14 → 0.9.3
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.rb +2 -1
- data/lib/italian/ruby/core_ext/array.rb +11 -0
- data/lib/italian/ruby/core_ext/date.rb +4 -1
- data/lib/italian/ruby/core_ext/float.rb +2 -1
- data/lib/italian/ruby/core_ext/integer.rb +10 -9
- data/lib/italian/ruby/core_ext/main.rb +1 -0
- data/lib/italian/ruby/core_ext/nil_class.rb +3 -1
- data/lib/italian/ruby/core_ext/object.rb +3 -1
- data/lib/italian/ruby/core_ext/rational.rb +12 -0
- data/lib/italian/ruby/core_ext/string.rb +36 -0
- data/lib/italian/ruby/version.rb +1 -1
- data/vim/syntax/ir.vim +21 -19
- data/vim/vimrc +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb1a6dace711e982fcab30f41dcef87fe2ef9ec238f2c3ae803f89a2f2e43d01
|
4
|
+
data.tar.gz: 7ea55816ac3d49866d49b59a1e8ba8160bf0925355d4361ad367bfd103d8db5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ee1b95564690d3a33328da4487b2c03481229b5e6e3046e3bbc97e97c538eef0d9209e08f180ba324a8f3fc6b347487191337b98eacf6531e1ff01ca1f6bee
|
7
|
+
data.tar.gz: a3057042a4a3cf55e9bbe00adc8b524e7a544f1d28147f1fcd0c0fa84c34aa63aeafdc15ad027d753b446462329ebfb2d3c54f7cc7832e7fcc1a683505900924
|
@@ -24,8 +24,9 @@ require_relative "core_ext/symbol"
|
|
24
24
|
require_relative "core_ext/numeric"
|
25
25
|
require_relative "core_ext/integer"
|
26
26
|
require_relative "core_ext/float"
|
27
|
+
require_relative "core_ext/rational"
|
27
28
|
require_relative "core_ext/enumerator"
|
28
29
|
require_relative "core_ext/time"
|
29
30
|
require_relative "core_ext/date"
|
30
31
|
|
31
|
-
$VERBOSE = original_verbosity
|
32
|
+
$VERBOSE = original_verbosity
|
@@ -138,6 +138,17 @@ class Array
|
|
138
138
|
self[1]
|
139
139
|
end
|
140
140
|
alias :seconda :secondo
|
141
|
+
|
142
|
+
def tronca(n = 0)
|
143
|
+
self[0..(-1 - n)]
|
144
|
+
end
|
145
|
+
alias :salta_gli_ultimi :tronca
|
146
|
+
alias :salta_le_ultime :tronca
|
147
|
+
|
148
|
+
def salta_il_primo
|
149
|
+
self.drop 1
|
150
|
+
end
|
151
|
+
alias :salta_la_prima :salta_il_primo
|
141
152
|
end
|
142
153
|
|
143
154
|
Lista = Array
|
@@ -26,6 +26,9 @@ class Date
|
|
26
26
|
alias :in_data :to_date
|
27
27
|
alias :in_tempo :to_time
|
28
28
|
alias :giorno_della_settimana :cwday
|
29
|
+
alias :settimana :cweek
|
30
|
+
alias :mese :month
|
31
|
+
alias :anno :year
|
29
32
|
alias :formatta :strftime
|
30
33
|
|
31
34
|
def due_anni_fa
|
@@ -46,4 +49,4 @@ class Date
|
|
46
49
|
end
|
47
50
|
end
|
48
51
|
|
49
|
-
Data = Date
|
52
|
+
Data = Date
|
@@ -4,30 +4,31 @@
|
|
4
4
|
# Alias di metodi della classe Integer.
|
5
5
|
|
6
6
|
class Integer
|
7
|
-
alias :volte
|
8
|
-
alias :in_decimale
|
9
|
-
alias :in_stringa
|
10
|
-
alias :in_numero
|
7
|
+
alias :volte :times
|
8
|
+
alias :in_decimale :to_f
|
9
|
+
alias :in_stringa :to_s
|
10
|
+
alias :in_numero :to_i
|
11
|
+
alias :valore_assoluto :abs
|
11
12
|
|
12
13
|
def secondi
|
13
14
|
self
|
14
15
|
end
|
15
|
-
alias :secondo
|
16
|
+
alias :secondo :secondi
|
16
17
|
|
17
18
|
def minuti
|
18
19
|
self.secondi * 60
|
19
20
|
end
|
20
|
-
alias :minuto
|
21
|
+
alias :minuto :minuti
|
21
22
|
|
22
23
|
def ore
|
23
24
|
self.minuti * 60
|
24
25
|
end
|
25
|
-
alias :ora
|
26
|
+
alias :ora :ore
|
26
27
|
|
27
28
|
def giorni
|
28
29
|
self.ore * 24
|
29
30
|
end
|
30
|
-
alias :giorno
|
31
|
+
alias :giorno :giorni
|
31
32
|
|
32
33
|
def fa
|
33
34
|
Time.now - self
|
@@ -38,4 +39,4 @@ class Integer
|
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
41
|
-
Intero = Integer
|
42
|
+
Intero = Integer
|
@@ -27,6 +27,8 @@ class Object
|
|
27
27
|
end
|
28
28
|
alias :specificato? :esiste?
|
29
29
|
alias :specificata? :esiste?
|
30
|
+
alias :non_è_nullo? :esiste?
|
31
|
+
alias :non_è_nulla? :esiste?
|
30
32
|
|
31
33
|
def non_esiste?
|
32
34
|
!esiste?
|
@@ -74,4 +76,4 @@ class Object
|
|
74
76
|
|
75
77
|
end
|
76
78
|
|
77
|
-
Oggetto = Object
|
79
|
+
Oggetto = Object
|
@@ -55,6 +55,42 @@ class String
|
|
55
55
|
return unless defined? Date
|
56
56
|
Date.parse self
|
57
57
|
end
|
58
|
+
|
59
|
+
def primi(n)
|
60
|
+
self[0..(n - 1)]
|
61
|
+
end
|
62
|
+
|
63
|
+
def primo_carattere
|
64
|
+
self[0]
|
65
|
+
end
|
66
|
+
|
67
|
+
def ultimo_carattere
|
68
|
+
self[-1]
|
69
|
+
end
|
70
|
+
|
71
|
+
def salta_caratteri(n)
|
72
|
+
self[(n - 1)..-1]
|
73
|
+
end
|
74
|
+
|
75
|
+
def salta_il_primo_carattere
|
76
|
+
self[1..-1]
|
77
|
+
end
|
78
|
+
|
79
|
+
def tronca_caratteri(n)
|
80
|
+
self[0..(-1 - n)]
|
81
|
+
end
|
82
|
+
|
83
|
+
def tronca
|
84
|
+
self[0..-2]
|
85
|
+
end
|
86
|
+
|
87
|
+
def adatta(l)
|
88
|
+
if self.length > l
|
89
|
+
"#{self[0..l - 3]}.."
|
90
|
+
else
|
91
|
+
self.ljust l, " "
|
92
|
+
end
|
93
|
+
end
|
58
94
|
end
|
59
95
|
|
60
96
|
Stringa = String
|
data/lib/italian/ruby/version.rb
CHANGED
data/vim/syntax/ir.vim
CHANGED
@@ -8,10 +8,16 @@ if exists("b:current_syntax")
|
|
8
8
|
endif
|
9
9
|
|
10
10
|
syn match italianRubyKeyword /\v(\s|^)(classe|modulo|esegui)\s/me=e-1
|
11
|
-
syn match italianRubyKeyword /\v(\s|^)(se|allora|altrimenti_se|considera|quando|finché|in)\s/me=e-1
|
11
|
+
syn match italianRubyKeyword /\v(\s|^)(se|allora|altrimenti_se|a_meno_che|considera|quando|finché|in|definito\?|alias|super)\s/me=e-1
|
12
12
|
syn match italianRubyKeyword /\v(\s|^)(prossimo|prossima|esci|ritorna|rilascia|recupera)\s/me=e-1
|
13
|
-
syn match italianRubyKeyword /\v(\s|^)(se|allora|altrimenti|considera|esci|ritorna|rilascia|blocco_dato
|
14
|
-
syn match italianRubyKeyword /\v(\s|^)(inizia|recupera|assicura|riprova|fine)$/
|
13
|
+
syn match italianRubyKeyword /\v(\s|^)(se|allora|altrimenti|a_meno_che|considera|esci|ritorna|rilascia|blocco_dato\?|super)$/
|
14
|
+
syn match italianRubyKeyword /\v(\s|^)(inizia|recupera|assicura|riprova|esegui|fine)$/
|
15
|
+
|
16
|
+
syn region italianRubyDefinition start=/definisci/ end=/[$\n\(]/ contains=italianRubySymbol,italianRubyConstant,italianRubyNumeric,italianRubySpecial,italianRubySplatOperator
|
17
|
+
syn match italianRubyMethodName /\v([a-z0-9_=\?\!àèéìòù]+)/ contained containedin=italianRubyDefinition
|
18
|
+
syn match italianRubyDefinitionKeyword /\vdefinisci/ contained containedin=italianRubyDefinition
|
19
|
+
syn match italianRubyClassMethodPrefix /\v(se_stesso|se_stessa)\./he=e-1 contained containedin=italianRubyDefinition
|
20
|
+
syn match italianRubySplatOperator /\v(\*{1,2}[a-zA-Z0-9_])/he=e-1
|
15
21
|
|
16
22
|
syn match italianRubySymbol /\v(\s|^)([a-zè_][a-zA-Z0-9àèéìòù_"]+:)/
|
17
23
|
syn match italianRubySymbol /\v(\s|^)("[a-zA-Z0-9àèéìòù_]+":)/
|
@@ -25,26 +31,22 @@ syn match italianRubyConstant /\v[A-Z][a-zA-Z0-9àèéìòùÀÈÌ
|
|
25
31
|
syn match italianRubyComment /\v#.*$/
|
26
32
|
|
27
33
|
syn match italianRubyNumeric /\v(\s)+([0-9\.]+)/
|
28
|
-
syn match italianRubyInterpolationStart /\v#\{/
|
29
|
-
syn match italianRubyInterpolationStop /\v\}/
|
30
|
-
syn region italianRubyInterpolation start=/\v#\{/
|
31
|
-
syn region italianRubyString start=/"/
|
34
|
+
syn match italianRubyInterpolationStart /\v#\{/ contained containedin=italianRubyInterpolation
|
35
|
+
syn match italianRubyInterpolationStop /\v\}/ contained containedin=italianRubyInterpolation
|
36
|
+
syn region italianRubyInterpolation start=/\v#\{/ end=/\v\}/ contains=TOP,italianRubyComment contained keepend
|
37
|
+
syn region italianRubyString start=/"/ end=/"/ skip=/\\"/ contains=italianRubyInterpolation
|
38
|
+
syn region italianRubyString start=/\v\%\{/ end=/\}/ skip=/\\"/ contains=italianRubyInterpolation
|
32
39
|
|
33
40
|
syn match italianRubySpecial /\v(\s|^)(includi|estendi|preponi)(\s|$)/
|
34
41
|
syn match italianRubySpecial /\v(\s|^)(pubblici|protetti|privati)(\s|$)/
|
35
42
|
syn match italianRubySpecial /\v(\s|^)(richiedi|richiedi_relativo|richiedi_tutti)(\s|$)/
|
36
|
-
syn match italianRubySpecial /\v(\s|^)(cicla|alza)(\s|$)/
|
37
|
-
syn match italianRubySpecial /\v(\s|^)(cattura|lancia)
|
38
|
-
syn match italianRubySpecial /\v\.(nuovo|nuova)/hs=s+1
|
43
|
+
syn match italianRubySpecial /\v(\s|^)(cicla|alza)(\s|$)/me=e-1
|
44
|
+
syn match italianRubySpecial /\v(\s|^)(cattura|lancia)\s/me=e-1
|
45
|
+
syn match italianRubySpecial /\v\.(nuovo|nuova)(\s|\,|\()/hs=s+1,he=e-1,me=e-1
|
46
|
+
syn match italianRubySpecial /\v\.(nuovo|nuova)\)/hs=s+1,he=e-1
|
47
|
+
syn match italianRubySpecial /\v\.(nuovo|nuova)$/hs=s+1
|
39
48
|
syn match italianRubySpecial /\v(se_stesso|se_stessa)/
|
40
|
-
syn match italianRubySpecial /\v(
|
41
|
-
syn match
|
42
|
-
syn match italianRubySpecialBoolean /\v(\s)+(si|no|nullo|nulla)(\W)/he=e-1
|
43
|
-
|
44
|
-
syn region italianRubyDefinition start=/definisci/ end=/[$\n]/ contains=italianRubySymbol,italianRubyConstant,italianRubyNumeric,italianRubySpecialBoolean,italianRubySplatOperator
|
45
|
-
syn match italianRubyDefinitionKeyword /\vdefinisci/ contained containedin=italianRubyDefinition
|
46
|
-
syn match italianRubyMethodName /\v([a-z0-9_=\?\!àèéìòù]+)\(/he=e-1 contained containedin=italianRubyDefinition
|
47
|
-
syn match italianRubyMethodName /\v([a-z0-9_=\?\!àèéìòù]+)$/ contained containedin=italianRubyDefinition
|
48
|
-
syn match italianRubySplatOperator /\v(\*{1,2}[a-zA-Z0-9_])/he=e-1
|
49
|
+
syn match italianRubySpecial /\v(\s)+(si|no|nullo|nulla)$/
|
50
|
+
syn match italianRubySpecial /\v(\s)+(si|no|nullo|nulla)\W/he=e-1,me=e-1
|
49
51
|
|
50
52
|
let b:current_syntax = "ir"
|
data/vim/vimrc
CHANGED
@@ -33,7 +33,7 @@ syntax on
|
|
33
33
|
highlight italianRubyKeyword ctermfg=171
|
34
34
|
highlight italianRubyDefinitionKeyword ctermfg=171
|
35
35
|
highlight italianRubySpecial ctermfg=33
|
36
|
-
highlight
|
36
|
+
highlight italianRubyClassMethodPrefix ctermfg=33
|
37
37
|
highlight italianRubyMethod ctermfg=220
|
38
38
|
highlight italianRubyMethodName ctermfg=220
|
39
39
|
highlight italianRubySymbol ctermfg=33
|
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.
|
4
|
+
version: 0.9.3
|
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-07-
|
11
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/italian/ruby/core_ext/open_struct.rb
|
99
99
|
- lib/italian/ruby/core_ext/proc.rb
|
100
100
|
- lib/italian/ruby/core_ext/range.rb
|
101
|
+
- lib/italian/ruby/core_ext/rational.rb
|
101
102
|
- lib/italian/ruby/core_ext/string.rb
|
102
103
|
- lib/italian/ruby/core_ext/symbol.rb
|
103
104
|
- lib/italian/ruby/core_ext/time.rb
|