turkish_support 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: b9977ac304561543e6bedb296775671794632132
4
- data.tar.gz: ff1e14f5208eb1b53fce8305d12e371b4d9f4ed6
3
+ metadata.gz: aebbf4b1c2c8f0283519893af65a7af8ddff76f4
4
+ data.tar.gz: 494229ce7f845ca31046b82159b039e33b43504c
5
5
  SHA512:
6
- metadata.gz: a5d988d932c97b82ab3bc91388503fc659552453dbbdf1095419ba9ab001ae41a7d0d82e804df50af9a6fa009a5f82b0d9f2d17b66a22c879d3eea09048bf088
7
- data.tar.gz: 5e310dba18dea8b458fe93170171f5167859ba94b221ed74b9320ea91de9c6985c02e204e9e6de532d60891115a9872cc91212b73658078cdeee61f826999f18
6
+ metadata.gz: 65e2dc445b5eb618c8b4d647dcf1460dab949eb8b7510614d567133feb3d191c4f8aa29d99df068ebf00b4ceab30affd784464232e5ce530234b376444c7341c
7
+ data.tar.gz: b2fed1c1d5d1f0e79828ba9a4dafa9308776bca9e2e4d4648fca73b359809e133a341f92d9c6dd0f6f6474ff5ea23f343fcfd1ec1e43200140414ca2299b919a
@@ -7,5 +7,17 @@ module TurkishSupport
7
7
  def change_chars_for_downcase
8
8
  tr UNSUPPORTED_CHARS[:upcase], UNSUPPORTED_CHARS[:downcase]
9
9
  end
10
+
11
+ def is_unsupported_downcase?
12
+ UNSUPPORTED_CHARS[:downcase].include? self
13
+ end
14
+
15
+ def is_unsupported_upcase?
16
+ UNSUPPORTED_CHARS[:upcase].include? self
17
+ end
18
+
19
+ def is_unsupported?
20
+ is_unsupported_upcase? or is_unsupported_downcase?
21
+ end
10
22
  end
11
23
  end
@@ -1,17 +1,5 @@
1
1
  module TurkishSupport
2
2
  refine String do
3
- def is_unsupported_downcase?
4
- UNSUPPORTED_CHARS[:downcase].include? self
5
- end
6
-
7
- def is_unsupported_upcase?
8
- UNSUPPORTED_CHARS[:upcase].include? self
9
- end
10
-
11
- def is_unsupported?
12
- is_unsupported_upcase? or is_unsupported_downcase?
13
- end
14
-
15
3
  def swapcase
16
4
  chars.map do |ch|
17
5
  if ch.is_unsupported?
@@ -1,7 +1,7 @@
1
1
  module TurkishSupport
2
2
  refine String do
3
3
  def titleize
4
- self.split.map{ |w| w.capitalize }.join(' ')
4
+ self.split.map{ |w| w.downcase.capitalize }.join(' ')
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module TurkishSupport
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -103,10 +103,15 @@ module TurkishSupport
103
103
  end
104
104
 
105
105
  describe "#titleize" do
106
- it "capitalizes first character of all words" do
106
+ it "upcases first character of all words" do
107
107
  titleized = "merhaba çamur ismet".titleize
108
108
  expect(titleized).to eq("Merhaba Çamur İsmet")
109
109
  end
110
+
111
+ it "downcases characters other than first characters of all words" do
112
+ titleized = "mERHABA çAMUR iSMET".titleize
113
+ expect(titleized).to eq("Merhaba Çamur İsmet")
114
+ end
110
115
  end
111
116
 
112
117
  describe "#swapcase" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turkish_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sıtkı Bağdat