in_italiano 0.0.5 → 0.0.7

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: 33f98443c874dcc1f7b57f80fcde96e0501d3924cc3b8dbb0a8a27d179206fff
4
- data.tar.gz: e11241569ea2b125886607c6f453a6e96c81d84b68da03b8e273be5063d189d1
3
+ metadata.gz: 7162825f59115a2179b49ff3c0388112148d14d73be5573aae89380fc0ef553b
4
+ data.tar.gz: 964d92db612b411a576c606ff9fc4b71d75ed8f38314d3400bf41cd8e87b9db1
5
5
  SHA512:
6
- metadata.gz: 16f5b0b6978c9c4f0b31960994fe844f271421866c9c75557d14edd20bb3575f146c729598755f39245b260bc9ae1302c51825e86521dc92483c3c40f901068b
7
- data.tar.gz: a052e38d3fe4acf6d01181497d33757e15cff72817ee3613461c21e63d5ca6ae7a28e7940fca5ffe6f788bfd07c71cdf415f276c1b43e4c9df7991f66471d479
6
+ metadata.gz: be4ff49a7e3d35c1b8615cf5b8ef80f5d81f8b6864e81ed805534e4fe8e7ad948e0548e77d17e327c58d81b9fbc4817ef6fd2c30768da219f65fce7f575832b8
7
+ data.tar.gz: eeca95a144e1426b9c018ebc08691268a8e371486388ffe1934cf85f2de5a81df84d1df8ea63a26324ec19188cefa0da6a8f90216d8fc705aa99d5462196e477
@@ -0,0 +1,21 @@
1
+ module InItaliano
2
+ module Classes
3
+ module Array
4
+ module Patch
5
+ # Array Class Documentation:
6
+ # https://docs.ruby-lang.org/en/3.4/Array.html
7
+
8
+ def method_missing(symbol, *args)
9
+ if symbol === :in_italiano
10
+ translation = TRANSLATIONS[::InItaliano.last_class][::InItaliano.last_method]
11
+ ::InItaliano.last_class = nil
12
+ ::InItaliano.last_method = nil
13
+ translation
14
+ else
15
+ super(symbol, *args)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,18 @@
1
+ module InItaliano
2
+ module Classes
3
+ module String
4
+ module ClassMethodsPatch
5
+ # String Class Documentation:
6
+ # https://docs.ruby-lang.org/en/3.4/String.html
7
+
8
+ def in_italiano(method_name = nil)
9
+ if method_name.nil?
10
+ return "Cordicella"
11
+ end
12
+
13
+ TRANSLATIONS[:string][method_name]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -20,6 +20,13 @@ module InItaliano
20
20
  super
21
21
  end
22
22
 
23
+ def bytes
24
+ ::InItaliano.last_class = :string
25
+ ::InItaliano.last_method = :bytes
26
+
27
+ super
28
+ end
29
+
23
30
  def capitalize
24
31
  ::InItaliano.last_class = :string
25
32
  ::InItaliano.last_method = :capitalize
@@ -8,6 +8,4 @@ module InItaliano
8
8
  @last_method = nil
9
9
  end
10
10
  end
11
-
12
-
13
11
  end
data/lib/in_italiano.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'in_italiano/history'
2
2
 
3
+ require 'in_italiano/classes/array/patch'
3
4
  require 'in_italiano/classes/string/patch'
5
+ require 'in_italiano/classes/string/class_methods_patch'
4
6
  require 'in_italiano/classes/true_class/patch'
5
7
 
6
8
  module InItaliano
@@ -8,6 +10,7 @@ module InItaliano
8
10
  string: {
9
11
  append_as_bytes: "aggiungere come byte",
10
12
  ascii_only?: "solo ascii?",
13
+ bytes: "i byte",
11
14
  capitalize: "capitalizzare"
12
15
  }
13
16
  }
@@ -33,7 +36,12 @@ module InItaliano
33
36
  end
34
37
  end
35
38
 
39
+ class Array
40
+ prepend InItaliano::Classes::Array::Patch
41
+ end
42
+
36
43
  class String
44
+ extend InItaliano::Classes::String::ClassMethodsPatch
37
45
  prepend InItaliano::Classes::String::Patch
38
46
  end
39
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: in_italiano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - dgonzdev
@@ -15,7 +15,8 @@ extensions: []
15
15
  extra_rdoc_files: []
16
16
  files:
17
17
  - lib/in_italiano.rb
18
- - lib/in_italiano/array_translations.rb
18
+ - lib/in_italiano/classes/array/patch.rb
19
+ - lib/in_italiano/classes/string/class_methods_patch.rb
19
20
  - lib/in_italiano/classes/string/patch.rb
20
21
  - lib/in_italiano/classes/true_class/patch.rb
21
22
  - lib/in_italiano/history.rb
@@ -1,14 +0,0 @@
1
- module InItaliano
2
- module StringTranslations
3
- def method_missing(symbol, *args)
4
- if symbol === :in_italiano
5
- translation = TRANSLATIONS[@@last_class][@@last_method]
6
- @@last_class = nil
7
- @@last_method = nil
8
- translation
9
- else
10
- super(symbol, *args)
11
- end
12
- end
13
- end
14
- end