italian-ruby 0.8.0 → 0.8.6

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: 4cab121f7e8742a235a82272040fbd2ede3398c478b2c3b69a257780322044d9
4
- data.tar.gz: b0fe51d9543677770288e5f9468796a0cec503700957e9c2eac64b806f585e78
3
+ metadata.gz: 27e0f8311e6c0afdd408d26bba2b2924193ca62016024fbc00c74b12ef26b253
4
+ data.tar.gz: 86e565d946be4c77fa45b5c77c2fc47320fa57ac329131b2885d226beb4e6916
5
5
  SHA512:
6
- metadata.gz: a730f2340c449e15d014df8f6e5015870956684f1d453c33ad54d3e64f043c17b6085c9f6da78fb835035f1b18f5084ecb3546140840d6c13d6a0f207424de60
7
- data.tar.gz: 0fa5cea14ddb75717eb89a2d4662e5fe46d217c16f577f5be7b5de918c4e07ec157f989ba31f592b9118d542180f596f5850993857b7fdfce063f215131f1fc7
6
+ metadata.gz: e56cb01b18175ba4b561641904772363877a9ad041d1b28dc3d1fc1e5ae7856a3554e34660afec0e03978f031393ba8aba3e5b962b66e145b7c5d8c33b5f9bf5
7
+ data.tar.gz: 695c312163d2d1fd484c2da2d0331e111ee907e677210a1d0d8f33cab0f810fc1fe6aa55f130d86637b40d005ccd698a8ff6adc5448b52737456edd97b9488b8
@@ -14,6 +14,7 @@ require_relative "core_ext/nil_class"
14
14
  require_relative "core_ext/false_class"
15
15
  require_relative "core_ext/true_class"
16
16
  require_relative "core_ext/json"
17
+ require_relative "core_ext/open_struct"
17
18
  require_relative "core_ext/object"
18
19
  require_relative "core_ext/array"
19
20
  require_relative "core_ext/range"
@@ -69,6 +69,7 @@ class Array
69
69
  alias :rovescia :reverse
70
70
  alias :inverti :reverse
71
71
  alias :lista :entries
72
+ alias :affetta :slice
72
73
 
73
74
  def esiste?
74
75
  !nil? && !empty?
@@ -24,7 +24,9 @@ class Date
24
24
  alias :anno_precedente :prev_year
25
25
  alias :in_stringa :to_s
26
26
  alias :in_data :to_date
27
+ alias :in_tempo :to_time
27
28
  alias :giorno_della_settimana :cwday
29
+ alias :formatta :strftime
28
30
 
29
31
  def due_anni_fa
30
32
  self.prev_year.prev_year
@@ -10,6 +10,7 @@ class File
10
10
  alias :nome_cartella :dirname
11
11
  alias :esiste? :exists?
12
12
  alias :scrivi :write
13
+ alias :leggi :read
13
14
  alias :apri :open
14
15
  end
15
16
 
@@ -5,4 +5,7 @@ module JSON
5
5
  def self.processa(*args)
6
6
  self.parse(*args)
7
7
  end
8
+ def self.in_stringa(*args)
9
+ self.dump(*args)
10
+ end
8
11
  end
@@ -0,0 +1,21 @@
1
+ require "ostruct"
2
+
3
+ ##
4
+ # Core Ext - OpenStruct
5
+ #
6
+ # Alias di metodi della classe OpenStruct.
7
+
8
+ class OpenStruct
9
+ def in_mappa(*args)
10
+ hash = to_h *args
11
+ hash.in_mappa do |key, value|
12
+ if value.respond_to? :to_h
13
+ [ key, value.to_h ]
14
+ else
15
+ [ key, value ]
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ Archivio = OpenStruct
@@ -43,6 +43,11 @@ class String
43
43
  def non_finisce_con?(*args)
44
44
  !finisce_con? *args
45
45
  end
46
+
47
+ def in_data
48
+ return unless defined? Date
49
+ Date.parse self
50
+ end
46
51
  end
47
52
 
48
53
  Stringa = String
@@ -12,10 +12,15 @@ class Time
12
12
 
13
13
  alias :in_stringa :to_s
14
14
  alias :in_numero :to_i
15
+ alias :formatta :strftime
15
16
 
16
17
  def in_data
17
18
  self.to_date
18
19
  end
20
+
21
+ def in_tempo
22
+ self
23
+ end
19
24
  end
20
25
 
21
26
  Tempo = Time
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSION = "0.8.0"
3
+ VERSION = "0.8.6"
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.8.0
4
+ version: 0.8.6
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-06-08 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,6 +95,7 @@ files:
95
95
  - lib/italian/ruby/core_ext/nil_class.rb
96
96
  - lib/italian/ruby/core_ext/numeric.rb
97
97
  - lib/italian/ruby/core_ext/object.rb
98
+ - lib/italian/ruby/core_ext/open_struct.rb
98
99
  - lib/italian/ruby/core_ext/proc.rb
99
100
  - lib/italian/ruby/core_ext/range.rb
100
101
  - lib/italian/ruby/core_ext/string.rb