italian-ruby 0.9.3 → 0.9.8

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: eb1a6dace711e982fcab30f41dcef87fe2ef9ec238f2c3ae803f89a2f2e43d01
4
- data.tar.gz: 7ea55816ac3d49866d49b59a1e8ba8160bf0925355d4361ad367bfd103d8db5c
3
+ metadata.gz: 31dcb948144adaa9eff20ea6a059a9bd20fabad5cc6759aae9573e7b78163703
4
+ data.tar.gz: 5bcc385cf3c572e3a0db1526c65e15c3ef1d121e01db4acaf87549d2bfda0a16
5
5
  SHA512:
6
- metadata.gz: d2ee1b95564690d3a33328da4487b2c03481229b5e6e3046e3bbc97e97c538eef0d9209e08f180ba324a8f3fc6b347487191337b98eacf6531e1ff01ca1f6bee
7
- data.tar.gz: a3057042a4a3cf55e9bbe00adc8b524e7a544f1d28147f1fcd0c0fa84c34aa63aeafdc15ad027d753b446462329ebfb2d3c54f7cc7832e7fcc1a683505900924
6
+ metadata.gz: d753d798c934fb5f56c3e876966dfeaa41aac9f4fc4ffff324758cb0b06e1fb29db4913ca450642211ae37adddb4a061f39d626dae764e083d6b9c5514457486
7
+ data.tar.gz: c183eba37499cbc015e68e6854bf1a192c8032d493c4fade6e39ff80d52ed9a54dd39b416be9989ea4575b82c6188608146db77a4065d9e82ba80f0ee501e80f
@@ -36,6 +36,14 @@ class Date
36
36
  end
37
37
  alias :due_anni_precedenti :due_anni_fa
38
38
 
39
+ def formatta_locale(format)
40
+ if defined? I18n
41
+ I18n.l self, format: format
42
+ else
43
+ strftime format
44
+ end
45
+ end
46
+
39
47
  alias :original_equality :==
40
48
  def ==(other)
41
49
  return (self == other.to_date) if other.is_a? Time
@@ -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
@@ -7,6 +7,7 @@ class Float
7
7
  INFINITO = INFINITY
8
8
 
9
9
  alias :in_intero :to_i
10
+ alias :in_stringa :to_s
10
11
  alias :arrotonda :round
11
12
  alias :arrotonda_per_eccesso :ceil
12
13
  alias :arrotonda_per_difetto :floor
@@ -8,6 +8,9 @@ module RSpec
8
8
  def self.variabili_condivise(*args, &block)
9
9
  shared_context *args, &block
10
10
  end
11
+ def self.contesto_condiviso(*args, &block)
12
+ shared_context *args, &block
13
+ end
11
14
 
12
15
  ##
13
16
  # Core
@@ -25,6 +28,7 @@ module RSpec
25
28
 
26
29
  class << self
27
30
  alias :includi_variabili :include_context
31
+ alias :includi_contesto :include_context
28
32
  end
29
33
  end
30
34
 
@@ -135,6 +139,8 @@ end
135
139
  RSpec.configure do |config|
136
140
  RSpec::Matchers.alias_matcher :sia, :be
137
141
  RSpec::Matchers.alias_matcher :siano, :be
142
+ RSpec::Matchers.alias_matcher :sia_nullo, :be_nil
143
+ RSpec::Matchers.alias_matcher :sia_nulla, :be_nil
138
144
  RSpec::Matchers.alias_matcher :tutti, :all
139
145
  RSpec::Matchers.alias_matcher :tutte, :all
140
146
  RSpec::Matchers.alias_matcher :equivalga_a, :eq
@@ -144,6 +150,7 @@ RSpec.configure do |config|
144
150
  RSpec::Matchers.alias_matcher :abbia_ricevuto, :have_received
145
151
  RSpec::Matchers.alias_matcher :cambi, :change
146
152
  RSpec::Matchers.alias_matcher :di, :by
153
+ RSpec::Matchers.alias_matcher :includa, :include
147
154
 
148
155
  config.alias_example_to :esso
149
156
  config.alias_example_to :essa
@@ -152,4 +159,4 @@ RSpec.configure do |config|
152
159
  alias :verifica :expect
153
160
  alias :consenti :allow
154
161
  end
155
- end
162
+ end
@@ -8,7 +8,9 @@ class Integer
8
8
  alias :in_decimale :to_f
9
9
  alias :in_stringa :to_s
10
10
  alias :in_numero :to_i
11
+ alias :in_intero :to_i
11
12
  alias :valore_assoluto :abs
13
+ alias :arrotonda :round
12
14
 
13
15
  def secondi
14
16
  self
@@ -9,7 +9,7 @@ class OpenStruct
9
9
  def in_mappa(*args)
10
10
  hash = to_h *args
11
11
  hash.in_mappa do |key, value|
12
- if value.respond_to? :to_h
12
+ if value.is_a? OpenStruct
13
13
  [ key, value.to_h ]
14
14
  else
15
15
  [ key, value ]
@@ -18,4 +18,4 @@ class OpenStruct
18
18
  end
19
19
  end
20
20
 
21
- Archivio = OpenStruct
21
+ Archivio = OpenStruct
@@ -56,6 +56,11 @@ class String
56
56
  Date.parse self
57
57
  end
58
58
 
59
+ def in_tempo
60
+ return unless defined? Time
61
+ Time.parse self
62
+ end
63
+
59
64
  def primi(n)
60
65
  self[0..(n - 1)]
61
66
  end
@@ -13,6 +13,7 @@ class Time
13
13
  alias :in_stringa :to_s
14
14
  alias :in_numero :to_i
15
15
  alias :formatta :strftime
16
+ alias :localizza :localtime
16
17
 
17
18
  def in_data
18
19
  self.to_date
@@ -22,6 +23,14 @@ class Time
22
23
  self
23
24
  end
24
25
 
26
+ def formatta_locale(format)
27
+ if defined? I18n
28
+ I18n.l self, format: format
29
+ else
30
+ strftime format
31
+ end
32
+ end
33
+
25
34
  alias :original_equality :==
26
35
  def ==(other)
27
36
  return (self.to_date == other) if other.is_a? Date
@@ -35,4 +44,4 @@ class Time
35
44
  end
36
45
  end
37
46
 
38
- Tempo = Time
47
+ Tempo = Time
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSION = "0.9.3"
3
+ VERSION = "0.9.8"
4
4
  end
5
5
  end
@@ -8,10 +8,10 @@ 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\?|alias|super)\s/me=e-1
11
+ syn match italianRubyKeyword /\v(\s|^)(se|allora|altrimenti_se|a_meno_che|considera|quando|finché|in|definito\?|blocco_dato\?|alias|super)\s/me=e-1
12
12
  syn match italianRubyKeyword /\v(\s|^)(prossimo|prossima|esci|ritorna|rilascia|recupera)\s/me=e-1
13
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)$/
14
+ syn match italianRubyKeyword /\v(\s|^)(prossimo|prossima|inizia|recupera|assicura|riprova|esegui|fine)$/
15
15
 
16
16
  syn region italianRubyDefinition start=/definisci/ end=/[$\n\(]/ contains=italianRubySymbol,italianRubyConstant,italianRubyNumeric,italianRubySpecial,italianRubySplatOperator
17
17
  syn match italianRubyMethodName /\v([a-z0-9_=\?\!àèéìòù]+)/ contained containedin=italianRubyDefinition
@@ -46,7 +46,7 @@ syn match italianRubySpecial /\v\.(nuovo|nuova)(\s|\,|\()/hs=s+1,
46
46
  syn match italianRubySpecial /\v\.(nuovo|nuova)\)/hs=s+1,he=e-1
47
47
  syn match italianRubySpecial /\v\.(nuovo|nuova)$/hs=s+1
48
48
  syn match italianRubySpecial /\v(se_stesso|se_stessa)/
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
+ syn match italianRubySpecial /\v(\s)+(si|no|nullo|nulla|vero|falso)$/
50
+ syn match italianRubySpecial /\v(\s)+(si|no|nullo|nulla|vero|falso)\W/he=e-1,me=e-1
51
51
 
52
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.9.3
4
+ version: 0.9.8
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-16 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler