turkishChar 0.1.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/turkishChar.rb +30 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4f3474047c3db6169717248dd8d497daadb7e284375b0c64427811ddee1a818f
4
+ data.tar.gz: 8760ae4d540e106f9e9c3cedb7a197b7f37811eee4c268f6403bfa715a9782b5
5
+ SHA512:
6
+ metadata.gz: 946249b7ed5cd84830280419ea0c49a5a7ed361a017bc9469092a3998f792635b08b599149f459e2c73a0b28bc03e35694693f9f2e44d12d378e22d2c6d9b8bc
7
+ data.tar.gz: e93a00df8eba893d4b67ef209cf639544c15e1f5fab9c158ad4cff20e807e7fc92bee89e0edb7394bcee6117ed71bd837efa238e1f1868c44eac0d9c6a770947
@@ -0,0 +1,30 @@
1
+
2
+
3
+ class TurkishChar
4
+
5
+ def self.upcaseWord word
6
+ word=word.gsub('ö','Ö').gsub('ü','Ü').gsub('ç','Ç').gsub('ı','I').gsub('i','İ').gsub('ğ','Ğ').gsub('ş','Ş')
7
+ return word.upcase
8
+ end
9
+
10
+ def self.downcaseWord word
11
+ word=word.gsub('Ö','ö').gsub('Ü','ü').gsub('Ç','ç').gsub('I','ı').gsub('İ','i').gsub('Ğ','ğ').gsub('Ş','ş')
12
+ return word.downcase
13
+ end
14
+
15
+ def self.capitalizeWord word
16
+ word=downcaseWord(word)
17
+ if 'öüişğıçş'.include? word[0]
18
+ ["ö","ü","ı","i","ç","ğ","ş"].each do |char|
19
+ if char==word[0]
20
+ word[0]=upcaseWord(char)
21
+ break
22
+ end
23
+ end
24
+ end
25
+
26
+ return word.capitalize
27
+ end
28
+
29
+
30
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: turkishChar
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Bünyamin Orhan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-26 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: convert turkish charecter
14
+ email: ahmet.orhan65@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/turkishChar.rb
20
+ homepage: http://rubygems.org/gems/turkishChar
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.7.6.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: turkishChar
44
+ test_files: []