kyanite 0.7.8 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -114,27 +114,7 @@ class String
114
114
  str
115
115
  end
116
116
 
117
-
118
- unless defined? MYSQL_REPLACES
119
- MYSQL_REPLACES = [
120
- [/ä/, 'a'],
121
- [/ö/, 'o'],
122
- [/ü/, 'u'],
123
- [/Ä/, 'a'],
124
- [/Ö/, 'o'],
125
- [/Ü/, 'u'],
126
- [/ss/, 'ß'],
127
- [/SS/, 'ß']
128
- ]
129
- end
130
-
131
-
132
- # Converts a string so that you can recognize with utf8_general_ci compared strings
133
- #
134
- def mysqlize
135
- self.tidy_bytes.mgsub(MYSQL_REPLACES).downcase.to_s
136
- end
137
-
117
+
138
118
 
139
119
  end
140
120
 
@@ -7,24 +7,14 @@ end
7
7
 
8
8
 
9
9
  require 'kyanite/string/chars_const'
10
+ require 'kyanite/string/misc'
10
11
 
11
12
 
12
13
 
13
14
 
14
15
  class String
15
16
 
16
- unless defined? MYSQL_REPLACES
17
- MYSQL_REPLACES = [
18
- [/ä/, 'a'],
19
- [/ö/, 'o'],
20
- [/ü/, 'u'],
21
- [/Ä/, 'a'],
22
- [/Ö/, 'o'],
23
- [/Ü/, 'u'],
24
- [/ss/, 'ß'],
25
- [/SS/, 'ß']
26
- ]
27
- end
17
+
28
18
 
29
19
  # ---------------------------------------------------------------------------------------------------------------------------------
30
20
  # @!group Clear / Format Text
@@ -102,13 +92,25 @@ class String
102
92
 
103
93
 
104
94
 
105
- # Formt einen String so um, dass man auch mit utf8_general_ci verglichene Strings wiedererkennen kann
106
- #
107
- # See TestKyaniteStringChars for tests and examples.
95
+ unless defined? MYSQL_REPLACES
96
+ MYSQL_REPLACES = [
97
+ [/ä/, 'a'],
98
+ [/ö/, 'o'],
99
+ [/ü/, 'u'],
100
+ [/Ä/, 'a'],
101
+ [/Ö/, 'o'],
102
+ [/Ü/, 'u'],
103
+ [/ss/, 'ß'],
104
+ [/SS/, 'ß']
105
+ ]
106
+ end
107
+
108
+
109
+ # Converts a string so that you can recognize with utf8_general_ci compared strings
108
110
  #
109
- # def mysqlize
110
- # self.tidy_bytes.mgsub(MYSQL_REPLACES).downcase.to_s
111
- # end
111
+ def mysqlize
112
+ self.mgsub(MYSQL_REPLACES).downcase.to_s
113
+ end
112
114
 
113
115
 
114
116
 
@@ -138,17 +138,17 @@ ENDOFSTRING
138
138
 
139
139
 
140
140
 
141
- # def test_mysqlize
142
- # test0 = 'aaoouuß'
143
- # test1 = 'aäoöuüss'
144
- # test2 = 'AÄOÖUÜSS'
145
- # test3 = 'AAOOUUß'
146
-
147
- # assert_equal test0, test0.mysqlize
148
- # assert_equal test0, test1.mysqlize
149
- # assert_equal test0, test2.mysqlize
150
- # assert_equal test0, test3.mysqlize
151
- # end
141
+ def test_mysqlize
142
+ test0 = 'aaoouuß'
143
+ test1 = 'aäoöuüss'
144
+ test2 = 'AÄOÖUÜSS'
145
+ test3 = 'AAOOUUß'
146
+
147
+ assert_equal test0, test0.mysqlize
148
+ assert_equal test0, test1.mysqlize
149
+ assert_equal test0, test2.mysqlize
150
+ assert_equal test0, test3.mysqlize
151
+ end
152
152
 
153
153
 
154
154
 
data/version.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Kyanite
4
4
 
5
- VERSION = '0.7.8'
5
+ VERSION = '0.7.9'
6
6
 
7
7
  end
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kyanite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.7.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: