italian-ruby 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 187bf6fe0d3fbc81e45a76e62504ce4b719856e1ffe4d2f57bab21b6263ddee8
4
- data.tar.gz: 2b7d3526225d79285a7d92bf42f1f6032e1a22f94e5d66cc2fcb5c04a48b3134
3
+ metadata.gz: 8cae403d93d9024ec704693160708ec4089f7af87c8f4205057a4f09662c479a
4
+ data.tar.gz: a4aa40571b5b63d9d6804796be6b2c8c8c3399545f954e7a6306b2903b64997f
5
5
  SHA512:
6
- metadata.gz: a2c63f32a66e83542ca03dfcbeb896aac9da20029d13b0fe0bc4b1be6e4e45f81dd09d6ebb9f3c38e07b0fba7d3f302fb72622edea206fc55564577055d3ecc9
7
- data.tar.gz: 8a8aaa3fb92a0366c688838ff6e445bfcd9de8b1613318e6d99bc834a125c047a5b361fb14a1061b3fc6a5f88ae5033152d76545f1448aaaced46beef2319d49
6
+ metadata.gz: 6bfa94933d4c7017992367bd5b06d0ae9e56fb025863edc5713aed6e9c59a7459f83b2042f0838437c1ce18d8523c5d36ca53d76032405a739b3d3a7c9b77c18
7
+ data.tar.gz: d19444233d85a2fe1605a3821f6bdd2f48fb1df068c6f880b42290f55a80968e588711211c8ac03dcdda8dcbb67c785aec9e6b7047e8ed2e5b52bbdf854860db
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ class DateTime
4
+
5
+ ##
6
+ # Restituisce il numero di millisecondi trascorsi dalla Unix Epoch.
7
+ def to_unix_ms
8
+ strftime("%Q").to_i
9
+ end
10
+ alias :in_unix_ms :to_unix_ms
11
+
12
+ end
@@ -42,4 +42,21 @@ class Integer
42
42
  Time.now + self
43
43
  end
44
44
 
45
+ ##
46
+ # Restituisce la rappresentazione in byte (unsigned char) del numero intero.
47
+ def u8
48
+ raise RangeError, "#{self} out of u8 range" if (self >= 256)
49
+ self.chr
50
+ end
51
+
52
+ ##
53
+ # Restituisce la rappresentazione in byte (unsigned short) del numero intero.
54
+ def u16
55
+ raise RangeError, "#{self} out of u16 range" if (self >= 65536)
56
+ return "#{self.u8}#{0.u8}" if self < 256
57
+ first_byte = self & 0b000000011111111
58
+ second_byte = self >> 8
59
+ "#{first_byte.u8}#{second_byte.u8}"
60
+ end
61
+
45
62
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "metodi/array"
4
4
  require_relative "metodi/date"
5
+ require_relative "metodi/date_time"
5
6
  require_relative "metodi/false_class"
6
7
  require_relative "metodi/hash"
7
8
  require_relative "metodi/integer"
@@ -1,5 +1,5 @@
1
1
  module Italian
2
2
  module Ruby
3
- VERSIONE = "1.6.1"
3
+ VERSIONE = "1.6.2"
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: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Ballardin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-25 00:00:00.000000000 Z
11
+ date: 2024-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,6 +123,7 @@ files:
123
123
  - lib/italian/ruby/metodi.rb
124
124
  - lib/italian/ruby/metodi/array.rb
125
125
  - lib/italian/ruby/metodi/date.rb
126
+ - lib/italian/ruby/metodi/date_time.rb
126
127
  - lib/italian/ruby/metodi/false_class.rb
127
128
  - lib/italian/ruby/metodi/hash.rb
128
129
  - lib/italian/ruby/metodi/integer.rb
@@ -155,7 +156,7 @@ metadata:
155
156
  homepage_uri: https://github.com/Pluvie/italian-ruby
156
157
  source_code_uri: https://github.com/Pluvie/italian-ruby
157
158
  changelog_uri: https://github.com/Pluvie/italian-ruby/CHANGELOG.md
158
- post_install_message:
159
+ post_install_message:
159
160
  rdoc_options: []
160
161
  require_paths:
161
162
  - lib
@@ -171,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
172
  version: '0'
172
173
  requirements: []
173
174
  rubygems_version: 3.2.3
174
- signing_key:
175
+ signing_key:
175
176
  specification_version: 4
176
177
  summary: Program in Ruby writing in Italian.
177
178
  test_files: []