italian-ruby 0.8.15 → 0.9.4

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: 0ad92503f1fb450fdc95f6f509e465c1003759a5362d7e9eba7dc5aecfa576bb
4
- data.tar.gz: e3094c20a2ad852105050fce643b598481f48ed45d2f8ba57d90f3957c6cdef7
3
+ metadata.gz: c53811425eddf7ff16616b148712a3b101a89c3dc2e4003aa719abda085925e9
4
+ data.tar.gz: 40959de329eb146bb0ad64232680922df73baf5fd96133af558b8f86bd0ea77e
5
5
  SHA512:
6
- metadata.gz: 47b1cc938632dfa56366e3d5c6aaa00d0ddf48a1d26787ba2bea2e33e19646f8d04116e9adad5e7a3dfb1f29c35f1eb168eaa4e1445f408190ea1977367c04b7
7
- data.tar.gz: 3909669eb9a6b8c397ffba7908365f812f81827d957efd33f14d4628a77b0876dac7c6e911b0d88491d8605f42d4b430b018d55025a1257d902f5e871d9eaed1
6
+ metadata.gz: 60cecfced4353f00776f2058219a92c2fb8fd0e7a9d6928681601600aea3b23d1aa8c0886386189fba3ed88ba2dee9fdbef5d0d59bdcf96182b9ec25796f3952
7
+ data.tar.gz: c5035ab4e241da0f5b720bb160d225e3ab87d7e310848de6426e7dc0ee4f68338fba78b08e80821783dfe975b48020376d01bc413f3bc9980a213b66d66c48a2
@@ -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
@@ -8,4 +8,5 @@ class StandardError
8
8
  alias :traccia :backtrace
9
9
  end
10
10
 
11
- Errore = StandardError
11
+ Errore = StandardError
12
+ MetodoInesistente = NoMethodError
@@ -6,6 +6,7 @@
6
6
  alias :stampa :puts
7
7
  alias :scrivi :print
8
8
  alias :cicla :loop
9
+ alias :dormi :sleep
9
10
  alias :definisci_metodo_singolo :define_singleton_method
10
11
  alias :blocco_dato? :block_given?
11
12
  alias :cattura :catch
@@ -9,4 +9,6 @@ class NilClass
9
9
  def esiste?
10
10
  !nil?
11
11
  end
12
- end
12
+ alias :non_è_nullo? :esiste?
13
+ alias :non_è_nulla? :esiste?
14
+ end
@@ -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
@@ -0,0 +1,12 @@
1
+ ##
2
+ # Core Ext - Rational
3
+ #
4
+ # Alias di metodi della classe Rational.
5
+
6
+ class Rational
7
+ alias :in_intero :to_i
8
+ alias :in_decimale :to_f
9
+ alias :in_stringa :to_s
10
+ end
11
+
12
+ Razionale = Rational
@@ -55,6 +55,47 @@ class String
55
55
  return unless defined? Date
56
56
  Date.parse self
57
57
  end
58
+
59
+ def in_tempo
60
+ return unless defined? Time
61
+ Time.parse self
62
+ end
63
+
64
+ def primi(n)
65
+ self[0..(n - 1)]
66
+ end
67
+
68
+ def primo_carattere
69
+ self[0]
70
+ end
71
+
72
+ def ultimo_carattere
73
+ self[-1]
74
+ end
75
+
76
+ def salta_caratteri(n)
77
+ self[(n - 1)..-1]
78
+ end
79
+
80
+ def salta_il_primo_carattere
81
+ self[1..-1]
82
+ end
83
+
84
+ def tronca_caratteri(n)
85
+ self[0..(-1 - n)]
86
+ end
87
+
88
+ def tronca
89
+ self[0..-2]
90
+ end
91
+
92
+ def adatta(l)
93
+ if self.length > l
94
+ "#{self[0..l - 3]}.."
95
+ else
96
+ self.ljust l, " "
97
+ end
98
+ end
58
99
  end
59
100
 
60
101
  Stringa = String
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSION = "0.8.15"
3
+ VERSION = "0.9.4"
4
4
  end
5
5
  end
@@ -8,9 +8,9 @@ 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|a_meno_che|considera|quando|finché|in|definito\?)\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|a_meno_che|considera|esci|ritorna|rilascia|blocco_dato\?)$/
13
+ syn match italianRubyKeyword /\v(\s|^)(se|allora|altrimenti|a_meno_che|considera|esci|ritorna|rilascia|blocco_dato\?|super)$/
14
14
  syn match italianRubyKeyword /\v(\s|^)(inizia|recupera|assicura|riprova|esegui|fine)$/
15
15
 
16
16
  syn region italianRubyDefinition start=/definisci/ end=/[$\n\(]/ contains=italianRubySymbol,italianRubyConstant,italianRubyNumeric,italianRubySpecial,italianRubySplatOperator
@@ -31,21 +31,22 @@ syn match italianRubyConstant /\v[A-Z][a-zA-Z0-9àèéìòùÀÈÌ
31
31
  syn match italianRubyComment /\v#.*$/
32
32
 
33
33
  syn match italianRubyNumeric /\v(\s)+([0-9\.]+)/
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
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
38
39
 
39
40
  syn match italianRubySpecial /\v(\s|^)(includi|estendi|preponi)(\s|$)/
40
41
  syn match italianRubySpecial /\v(\s|^)(pubblici|protetti|privati)(\s|$)/
41
42
  syn match italianRubySpecial /\v(\s|^)(richiedi|richiedi_relativo|richiedi_tutti)(\s|$)/
42
- syn match italianRubySpecial /\v(\s|^)(cicla|alza)(\s|$)/
43
- syn match italianRubySpecial /\v(\s|^)(cattura|lancia)/
43
+ syn match italianRubySpecial /\v(\s|^)(cicla|alza)(\s|$)/me=e-1
44
+ syn match italianRubySpecial /\v(\s|^)(cattura|lancia)\s/me=e-1
44
45
  syn match italianRubySpecial /\v\.(nuovo|nuova)(\s|\,|\()/hs=s+1,he=e-1,me=e-1
45
46
  syn match italianRubySpecial /\v\.(nuovo|nuova)\)/hs=s+1,he=e-1
46
47
  syn match italianRubySpecial /\v\.(nuovo|nuova)$/hs=s+1
47
48
  syn match italianRubySpecial /\v(se_stesso|se_stessa)/
48
- syn match italianRubySpecial /\v(\s)+(si|no|nullo|nulla)(\s|$)/
49
- syn match italianRubySpecial /\v(\s)+(si|no|nullo|nulla)(\W)/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
50
51
 
51
52
  let b:current_syntax = "ir"
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.8.15
4
+ version: 0.9.4
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-08 00:00:00.000000000 Z
11
+ date: 2020-07-27 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