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 +4 -4
- data/lib/turkish_support/helpers.rb +12 -0
- data/lib/turkish_support/swapcase.rb +0 -12
- data/lib/turkish_support/titleize.rb +1 -1
- data/lib/turkish_support/version.rb +1 -1
- data/spec/turkish_support_spec.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aebbf4b1c2c8f0283519893af65a7af8ddff76f4
|
4
|
+
data.tar.gz: 494229ce7f845ca31046b82159b039e33b43504c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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?
|
@@ -103,10 +103,15 @@ module TurkishSupport
|
|
103
103
|
end
|
104
104
|
|
105
105
|
describe "#titleize" do
|
106
|
-
it "
|
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
|