unicode_case_converter 0.1.1 → 0.2.0

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
  SHA1:
3
- metadata.gz: ef9c9fcb1eea42c5a56361b513fc7d397ad646e5
4
- data.tar.gz: 77e71dcfafdbddb0bd7795dd537f5bb9eabdedcf
3
+ metadata.gz: 844460e46e8f0bc6de1aa637cb43b912e0cf6653
4
+ data.tar.gz: 7da928bdbcf271be0eb4503e6ce545c913980309
5
5
  SHA512:
6
- metadata.gz: 866bbbd1132b3d33b9619fb04da09a0ba48af7de83bf8d08533a66a2c23356ed7e8168be6821f287c38bf9772df403006d58746cdf9c342c5453d3029dbcc4e3
7
- data.tar.gz: 120b1d937065d98c829f74aab7b6479fafcc35dfbe5a3b381cfc7e83be5bcc17fb34d919af3c9dc37b11dee88698545b9d046506fdb5a0b285ff3387a865aa38
6
+ metadata.gz: 95b9a7b948e36fb4854d38b9f138e6da51be0f0e63acddad5b368c4290cb22779bfe6263b16b38648cf75297fe3d2829c36cf684ccd2fe469880d0bf1f96ffbb
7
+ data.tar.gz: 1e794b7c010814358daffbcd6d0ed2b582455c79c65b2c101886d924145c3e9ded30453be89d5231d99eb22240e760d4cc8ba22239360606084d14973781601d
data/README.md CHANGED
@@ -32,6 +32,10 @@ UnicodeCaseConverter::Converter.new(text).downcase
32
32
  text = "αβγδεζηθικλμνξοπρστυφχψωάέήίόύώϊϋ"
33
33
  UnicodeCaseConverter::Converter.new(text).upcase
34
34
  # => "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΆΈΉΊΌΎΏΪΫ"
35
+
36
+ text = "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΆΈΉΊΌΎΏΪΫ"
37
+ UnicodeCaseConverter::Converter.new(text).capitalize
38
+ # => "Αβγδεζηθικλμνξοπρστυφχψωάέήίόύώϊϋ"
35
39
  ```
36
40
 
37
41
  ## Contributing
@@ -1,3 +1,3 @@
1
1
  module UnicodeCaseConverter
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -139,5 +139,9 @@ module UnicodeCaseConverter
139
139
  .gsub(/\u{2126}/, "\u{03C9}")
140
140
  .gsub(/\u{212A}/, "\u{006B}")
141
141
  end
142
+
143
+ def capitalize
144
+ UnicodeCaseConverter::Converter.new(UnicodeCaseConverter::Converter.new(text).downcase.slice(0,1)).upcase + UnicodeCaseConverter::Converter.new(text).downcase.slice(1..-1)
145
+ end
142
146
  end
143
147
  end
@@ -27,6 +27,20 @@ describe UnicodeCaseConverter do
27
27
  expect(ucc.downcase).to eq("αβγδεζηθικλμνξοπρστυφχψωάέήίόύώϊϋ")
28
28
  end
29
29
 
30
+ it "capitalizes a string (example)" do
31
+ text = "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΆΈΉΊΌΎΏΪΫ".freeze
32
+ ucc = UnicodeCaseConverter::Converter.new(text)
33
+ unicode_result = Unicode.capitalize(text)
34
+ expect(ucc.capitalize).to eq(unicode_result)
35
+ end
36
+
37
+ it "capitalizes a string 2" do
38
+ text = "hello world".freeze
39
+ ucc = UnicodeCaseConverter::Converter.new(text)
40
+ unicode_result = Unicode.capitalize(text)
41
+ expect(ucc.capitalize).to eq(unicode_result)
42
+ end
43
+
30
44
  (0..3).each do |first_digit|
31
45
  [*'0'..'9', *'A'..'F'].sample(16).sort.each do |second_digit|
32
46
  [*'0'..'9', *'A'..'F'].sample(16).sort.each do |third_digit|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode_case_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias