stringex 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/Rakefile +184 -184
  2. data/lib/stringex/acts_as_url.rb +107 -0
  3. data/lib/stringex/string_extensions.rb +198 -0
  4. data/lib/stringex/unidecoder.rb +159 -0
  5. data/lib/stringex/unidecoder_data/x00.yml +257 -0
  6. data/lib/stringex/unidecoder_data/x01.yml +257 -0
  7. data/lib/stringex/unidecoder_data/x02.yml +256 -0
  8. data/lib/stringex/unidecoder_data/x03.yml +256 -0
  9. data/lib/stringex/unidecoder_data/x04.yml +256 -0
  10. data/lib/stringex/unidecoder_data/x05.yml +256 -0
  11. data/lib/stringex/unidecoder_data/x06.yml +256 -0
  12. data/lib/stringex/unidecoder_data/x07.yml +256 -0
  13. data/lib/stringex/unidecoder_data/x09.yml +256 -0
  14. data/lib/stringex/unidecoder_data/x0a.yml +256 -0
  15. data/lib/stringex/unidecoder_data/x0b.yml +256 -0
  16. data/lib/stringex/unidecoder_data/x0c.yml +256 -0
  17. data/lib/stringex/unidecoder_data/x0d.yml +256 -0
  18. data/lib/stringex/unidecoder_data/x0e.yml +256 -0
  19. data/lib/stringex/unidecoder_data/x0f.yml +256 -0
  20. data/lib/stringex/unidecoder_data/x10.yml +256 -0
  21. data/lib/stringex/unidecoder_data/x11.yml +256 -0
  22. data/lib/stringex/unidecoder_data/x12.yml +257 -0
  23. data/lib/stringex/unidecoder_data/x13.yml +256 -0
  24. data/lib/stringex/unidecoder_data/x14.yml +257 -0
  25. data/lib/stringex/unidecoder_data/x15.yml +257 -0
  26. data/lib/stringex/unidecoder_data/x16.yml +256 -0
  27. data/lib/stringex/unidecoder_data/x17.yml +256 -0
  28. data/lib/stringex/unidecoder_data/x18.yml +256 -0
  29. data/lib/stringex/unidecoder_data/x1e.yml +256 -0
  30. data/lib/stringex/unidecoder_data/x1f.yml +256 -0
  31. data/lib/stringex/unidecoder_data/x20.yml +256 -0
  32. data/lib/stringex/unidecoder_data/x21.yml +256 -0
  33. data/lib/stringex/unidecoder_data/x22.yml +256 -0
  34. data/lib/stringex/unidecoder_data/x23.yml +256 -0
  35. data/lib/stringex/unidecoder_data/x24.yml +256 -0
  36. data/lib/stringex/unidecoder_data/x25.yml +256 -0
  37. data/lib/stringex/unidecoder_data/x26.yml +256 -0
  38. data/lib/stringex/unidecoder_data/x27.yml +256 -0
  39. data/lib/stringex/unidecoder_data/x28.yml +257 -0
  40. data/lib/stringex/unidecoder_data/x2e.yml +256 -0
  41. data/lib/stringex/unidecoder_data/x2f.yml +256 -0
  42. data/lib/stringex/unidecoder_data/x30.yml +256 -0
  43. data/lib/stringex/unidecoder_data/x31.yml +256 -0
  44. data/lib/stringex/unidecoder_data/x32.yml +256 -0
  45. data/lib/stringex/unidecoder_data/x33.yml +256 -0
  46. data/lib/stringex/unidecoder_data/x4d.yml +256 -0
  47. data/lib/stringex/unidecoder_data/x4e.yml +257 -0
  48. data/lib/stringex/unidecoder_data/x4f.yml +257 -0
  49. data/lib/stringex/unidecoder_data/x50.yml +257 -0
  50. data/lib/stringex/unidecoder_data/x51.yml +257 -0
  51. data/lib/stringex/unidecoder_data/x52.yml +257 -0
  52. data/lib/stringex/unidecoder_data/x53.yml +257 -0
  53. data/lib/stringex/unidecoder_data/x54.yml +257 -0
  54. data/lib/stringex/unidecoder_data/x55.yml +257 -0
  55. data/lib/stringex/unidecoder_data/x56.yml +257 -0
  56. data/lib/stringex/unidecoder_data/x57.yml +257 -0
  57. data/lib/stringex/unidecoder_data/x58.yml +257 -0
  58. data/lib/stringex/unidecoder_data/x59.yml +257 -0
  59. data/lib/stringex/unidecoder_data/x5a.yml +257 -0
  60. data/lib/stringex/unidecoder_data/x5b.yml +257 -0
  61. data/lib/stringex/unidecoder_data/x5c.yml +257 -0
  62. data/lib/stringex/unidecoder_data/x5d.yml +257 -0
  63. data/lib/stringex/unidecoder_data/x5e.yml +257 -0
  64. data/lib/stringex/unidecoder_data/x5f.yml +257 -0
  65. data/lib/stringex/unidecoder_data/x60.yml +257 -0
  66. data/lib/stringex/unidecoder_data/x61.yml +257 -0
  67. data/lib/stringex/unidecoder_data/x62.yml +257 -0
  68. data/lib/stringex/unidecoder_data/x63.yml +257 -0
  69. data/lib/stringex/unidecoder_data/x64.yml +257 -0
  70. data/lib/stringex/unidecoder_data/x65.yml +257 -0
  71. data/lib/stringex/unidecoder_data/x66.yml +257 -0
  72. data/lib/stringex/unidecoder_data/x67.yml +257 -0
  73. data/lib/stringex/unidecoder_data/x68.yml +257 -0
  74. data/lib/stringex/unidecoder_data/x69.yml +257 -0
  75. data/lib/stringex/unidecoder_data/x6a.yml +257 -0
  76. data/lib/stringex/unidecoder_data/x6b.yml +257 -0
  77. data/lib/stringex/unidecoder_data/x6c.yml +257 -0
  78. data/lib/stringex/unidecoder_data/x6d.yml +257 -0
  79. data/lib/stringex/unidecoder_data/x6e.yml +257 -0
  80. data/lib/stringex/unidecoder_data/x6f.yml +257 -0
  81. data/lib/stringex/unidecoder_data/x70.yml +257 -0
  82. data/lib/stringex/unidecoder_data/x71.yml +257 -0
  83. data/lib/stringex/unidecoder_data/x72.yml +257 -0
  84. data/lib/stringex/unidecoder_data/x73.yml +257 -0
  85. data/lib/stringex/unidecoder_data/x74.yml +257 -0
  86. data/lib/stringex/unidecoder_data/x75.yml +257 -0
  87. data/lib/stringex/unidecoder_data/x76.yml +257 -0
  88. data/lib/stringex/unidecoder_data/x77.yml +257 -0
  89. data/lib/stringex/unidecoder_data/x78.yml +257 -0
  90. data/lib/stringex/unidecoder_data/x79.yml +257 -0
  91. data/lib/stringex/unidecoder_data/x7a.yml +257 -0
  92. data/lib/stringex/unidecoder_data/x7b.yml +257 -0
  93. data/lib/stringex/unidecoder_data/x7c.yml +257 -0
  94. data/lib/stringex/unidecoder_data/x7d.yml +257 -0
  95. data/lib/stringex/unidecoder_data/x7e.yml +257 -0
  96. data/lib/stringex/unidecoder_data/x7f.yml +257 -0
  97. data/lib/stringex/unidecoder_data/x80.yml +257 -0
  98. data/lib/stringex/unidecoder_data/x81.yml +257 -0
  99. data/lib/stringex/unidecoder_data/x82.yml +257 -0
  100. data/lib/stringex/unidecoder_data/x83.yml +257 -0
  101. data/lib/stringex/unidecoder_data/x84.yml +257 -0
  102. data/lib/stringex/unidecoder_data/x85.yml +257 -0
  103. data/lib/stringex/unidecoder_data/x86.yml +257 -0
  104. data/lib/stringex/unidecoder_data/x87.yml +257 -0
  105. data/lib/stringex/unidecoder_data/x88.yml +257 -0
  106. data/lib/stringex/unidecoder_data/x89.yml +257 -0
  107. data/lib/stringex/unidecoder_data/x8a.yml +257 -0
  108. data/lib/stringex/unidecoder_data/x8b.yml +257 -0
  109. data/lib/stringex/unidecoder_data/x8c.yml +257 -0
  110. data/lib/stringex/unidecoder_data/x8d.yml +257 -0
  111. data/lib/stringex/unidecoder_data/x8e.yml +257 -0
  112. data/lib/stringex/unidecoder_data/x8f.yml +257 -0
  113. data/lib/stringex/unidecoder_data/x90.yml +257 -0
  114. data/lib/stringex/unidecoder_data/x91.yml +257 -0
  115. data/lib/stringex/unidecoder_data/x92.yml +257 -0
  116. data/lib/stringex/unidecoder_data/x93.yml +257 -0
  117. data/lib/stringex/unidecoder_data/x94.yml +257 -0
  118. data/lib/stringex/unidecoder_data/x95.yml +257 -0
  119. data/lib/stringex/unidecoder_data/x96.yml +257 -0
  120. data/lib/stringex/unidecoder_data/x97.yml +257 -0
  121. data/lib/stringex/unidecoder_data/x98.yml +257 -0
  122. data/lib/stringex/unidecoder_data/x99.yml +257 -0
  123. data/lib/stringex/unidecoder_data/x9a.yml +257 -0
  124. data/lib/stringex/unidecoder_data/x9b.yml +257 -0
  125. data/lib/stringex/unidecoder_data/x9c.yml +257 -0
  126. data/lib/stringex/unidecoder_data/x9d.yml +257 -0
  127. data/lib/stringex/unidecoder_data/x9e.yml +257 -0
  128. data/lib/stringex/unidecoder_data/x9f.yml +256 -0
  129. data/lib/stringex/unidecoder_data/xa0.yml +257 -0
  130. data/lib/stringex/unidecoder_data/xa1.yml +257 -0
  131. data/lib/stringex/unidecoder_data/xa2.yml +257 -0
  132. data/lib/stringex/unidecoder_data/xa3.yml +257 -0
  133. data/lib/stringex/unidecoder_data/xa4.yml +256 -0
  134. data/lib/stringex/unidecoder_data/xac.yml +257 -0
  135. data/lib/stringex/unidecoder_data/xad.yml +257 -0
  136. data/lib/stringex/unidecoder_data/xae.yml +257 -0
  137. data/lib/stringex/unidecoder_data/xaf.yml +257 -0
  138. data/lib/stringex/unidecoder_data/xb0.yml +257 -0
  139. data/lib/stringex/unidecoder_data/xb1.yml +257 -0
  140. data/lib/stringex/unidecoder_data/xb2.yml +257 -0
  141. data/lib/stringex/unidecoder_data/xb3.yml +257 -0
  142. data/lib/stringex/unidecoder_data/xb4.yml +257 -0
  143. data/lib/stringex/unidecoder_data/xb5.yml +257 -0
  144. data/lib/stringex/unidecoder_data/xb6.yml +257 -0
  145. data/lib/stringex/unidecoder_data/xb7.yml +257 -0
  146. data/lib/stringex/unidecoder_data/xb8.yml +257 -0
  147. data/lib/stringex/unidecoder_data/xb9.yml +257 -0
  148. data/lib/stringex/unidecoder_data/xba.yml +257 -0
  149. data/lib/stringex/unidecoder_data/xbb.yml +257 -0
  150. data/lib/stringex/unidecoder_data/xbc.yml +257 -0
  151. data/lib/stringex/unidecoder_data/xbd.yml +257 -0
  152. data/lib/stringex/unidecoder_data/xbe.yml +257 -0
  153. data/lib/stringex/unidecoder_data/xbf.yml +257 -0
  154. data/lib/stringex/unidecoder_data/xc0.yml +257 -0
  155. data/lib/stringex/unidecoder_data/xc1.yml +257 -0
  156. data/lib/stringex/unidecoder_data/xc2.yml +257 -0
  157. data/lib/stringex/unidecoder_data/xc3.yml +257 -0
  158. data/lib/stringex/unidecoder_data/xc4.yml +257 -0
  159. data/lib/stringex/unidecoder_data/xc5.yml +257 -0
  160. data/lib/stringex/unidecoder_data/xc6.yml +257 -0
  161. data/lib/stringex/unidecoder_data/xc7.yml +257 -0
  162. data/lib/stringex/unidecoder_data/xc8.yml +257 -0
  163. data/lib/stringex/unidecoder_data/xc9.yml +257 -0
  164. data/lib/stringex/unidecoder_data/xca.yml +257 -0
  165. data/lib/stringex/unidecoder_data/xcb.yml +257 -0
  166. data/lib/stringex/unidecoder_data/xcc.yml +257 -0
  167. data/lib/stringex/unidecoder_data/xcd.yml +257 -0
  168. data/lib/stringex/unidecoder_data/xce.yml +257 -0
  169. data/lib/stringex/unidecoder_data/xcf.yml +257 -0
  170. data/lib/stringex/unidecoder_data/xd0.yml +257 -0
  171. data/lib/stringex/unidecoder_data/xd1.yml +257 -0
  172. data/lib/stringex/unidecoder_data/xd2.yml +257 -0
  173. data/lib/stringex/unidecoder_data/xd3.yml +257 -0
  174. data/lib/stringex/unidecoder_data/xd4.yml +257 -0
  175. data/lib/stringex/unidecoder_data/xd5.yml +257 -0
  176. data/lib/stringex/unidecoder_data/xd6.yml +257 -0
  177. data/lib/stringex/unidecoder_data/xd7.yml +256 -0
  178. data/lib/stringex/unidecoder_data/xf9.yml +257 -0
  179. data/lib/stringex/unidecoder_data/xfa.yml +256 -0
  180. data/lib/stringex/unidecoder_data/xfb.yml +257 -0
  181. data/lib/stringex/unidecoder_data/xfc.yml +257 -0
  182. data/lib/stringex/unidecoder_data/xfd.yml +256 -0
  183. data/lib/stringex/unidecoder_data/xfe.yml +257 -0
  184. data/lib/stringex/unidecoder_data/xff.yml +257 -0
  185. data/stringex.gemspec +184 -1
  186. metadata +186 -3
data/Rakefile CHANGED
@@ -21,189 +21,189 @@ begin
21
21
  README.rdoc
22
22
  stringex.gemspec
23
23
  lib/stringex.rb
24
- lib/lucky_sneaks/acts_as_url.rb
25
- lib/lucky_sneaks/string_extensions.rb
26
- lib/lucky_sneaks/unidecoder.rb
27
- lib/lucky_sneaks/unidecoder_data/x00.yml
28
- lib/lucky_sneaks/unidecoder_data/x01.yml
29
- lib/lucky_sneaks/unidecoder_data/x02.yml
30
- lib/lucky_sneaks/unidecoder_data/x03.yml
31
- lib/lucky_sneaks/unidecoder_data/x04.yml
32
- lib/lucky_sneaks/unidecoder_data/x05.yml
33
- lib/lucky_sneaks/unidecoder_data/x06.yml
34
- lib/lucky_sneaks/unidecoder_data/x07.yml
35
- lib/lucky_sneaks/unidecoder_data/x09.yml
36
- lib/lucky_sneaks/unidecoder_data/x0a.yml
37
- lib/lucky_sneaks/unidecoder_data/x0b.yml
38
- lib/lucky_sneaks/unidecoder_data/x0c.yml
39
- lib/lucky_sneaks/unidecoder_data/x0d.yml
40
- lib/lucky_sneaks/unidecoder_data/x0e.yml
41
- lib/lucky_sneaks/unidecoder_data/x0f.yml
42
- lib/lucky_sneaks/unidecoder_data/x10.yml
43
- lib/lucky_sneaks/unidecoder_data/x11.yml
44
- lib/lucky_sneaks/unidecoder_data/x12.yml
45
- lib/lucky_sneaks/unidecoder_data/x13.yml
46
- lib/lucky_sneaks/unidecoder_data/x14.yml
47
- lib/lucky_sneaks/unidecoder_data/x15.yml
48
- lib/lucky_sneaks/unidecoder_data/x16.yml
49
- lib/lucky_sneaks/unidecoder_data/x17.yml
50
- lib/lucky_sneaks/unidecoder_data/x18.yml
51
- lib/lucky_sneaks/unidecoder_data/x1e.yml
52
- lib/lucky_sneaks/unidecoder_data/x1f.yml
53
- lib/lucky_sneaks/unidecoder_data/x20.yml
54
- lib/lucky_sneaks/unidecoder_data/x21.yml
55
- lib/lucky_sneaks/unidecoder_data/x22.yml
56
- lib/lucky_sneaks/unidecoder_data/x23.yml
57
- lib/lucky_sneaks/unidecoder_data/x24.yml
58
- lib/lucky_sneaks/unidecoder_data/x25.yml
59
- lib/lucky_sneaks/unidecoder_data/x26.yml
60
- lib/lucky_sneaks/unidecoder_data/x27.yml
61
- lib/lucky_sneaks/unidecoder_data/x28.yml
62
- lib/lucky_sneaks/unidecoder_data/x2e.yml
63
- lib/lucky_sneaks/unidecoder_data/x2f.yml
64
- lib/lucky_sneaks/unidecoder_data/x30.yml
65
- lib/lucky_sneaks/unidecoder_data/x31.yml
66
- lib/lucky_sneaks/unidecoder_data/x32.yml
67
- lib/lucky_sneaks/unidecoder_data/x33.yml
68
- lib/lucky_sneaks/unidecoder_data/x4d.yml
69
- lib/lucky_sneaks/unidecoder_data/x4e.yml
70
- lib/lucky_sneaks/unidecoder_data/x4f.yml
71
- lib/lucky_sneaks/unidecoder_data/x50.yml
72
- lib/lucky_sneaks/unidecoder_data/x51.yml
73
- lib/lucky_sneaks/unidecoder_data/x52.yml
74
- lib/lucky_sneaks/unidecoder_data/x53.yml
75
- lib/lucky_sneaks/unidecoder_data/x54.yml
76
- lib/lucky_sneaks/unidecoder_data/x55.yml
77
- lib/lucky_sneaks/unidecoder_data/x56.yml
78
- lib/lucky_sneaks/unidecoder_data/x57.yml
79
- lib/lucky_sneaks/unidecoder_data/x58.yml
80
- lib/lucky_sneaks/unidecoder_data/x59.yml
81
- lib/lucky_sneaks/unidecoder_data/x5a.yml
82
- lib/lucky_sneaks/unidecoder_data/x5b.yml
83
- lib/lucky_sneaks/unidecoder_data/x5c.yml
84
- lib/lucky_sneaks/unidecoder_data/x5d.yml
85
- lib/lucky_sneaks/unidecoder_data/x5e.yml
86
- lib/lucky_sneaks/unidecoder_data/x5f.yml
87
- lib/lucky_sneaks/unidecoder_data/x60.yml
88
- lib/lucky_sneaks/unidecoder_data/x61.yml
89
- lib/lucky_sneaks/unidecoder_data/x62.yml
90
- lib/lucky_sneaks/unidecoder_data/x63.yml
91
- lib/lucky_sneaks/unidecoder_data/x64.yml
92
- lib/lucky_sneaks/unidecoder_data/x65.yml
93
- lib/lucky_sneaks/unidecoder_data/x66.yml
94
- lib/lucky_sneaks/unidecoder_data/x67.yml
95
- lib/lucky_sneaks/unidecoder_data/x68.yml
96
- lib/lucky_sneaks/unidecoder_data/x69.yml
97
- lib/lucky_sneaks/unidecoder_data/x6a.yml
98
- lib/lucky_sneaks/unidecoder_data/x6b.yml
99
- lib/lucky_sneaks/unidecoder_data/x6c.yml
100
- lib/lucky_sneaks/unidecoder_data/x6d.yml
101
- lib/lucky_sneaks/unidecoder_data/x6e.yml
102
- lib/lucky_sneaks/unidecoder_data/x6f.yml
103
- lib/lucky_sneaks/unidecoder_data/x70.yml
104
- lib/lucky_sneaks/unidecoder_data/x71.yml
105
- lib/lucky_sneaks/unidecoder_data/x72.yml
106
- lib/lucky_sneaks/unidecoder_data/x73.yml
107
- lib/lucky_sneaks/unidecoder_data/x74.yml
108
- lib/lucky_sneaks/unidecoder_data/x75.yml
109
- lib/lucky_sneaks/unidecoder_data/x76.yml
110
- lib/lucky_sneaks/unidecoder_data/x77.yml
111
- lib/lucky_sneaks/unidecoder_data/x78.yml
112
- lib/lucky_sneaks/unidecoder_data/x79.yml
113
- lib/lucky_sneaks/unidecoder_data/x7a.yml
114
- lib/lucky_sneaks/unidecoder_data/x7b.yml
115
- lib/lucky_sneaks/unidecoder_data/x7c.yml
116
- lib/lucky_sneaks/unidecoder_data/x7d.yml
117
- lib/lucky_sneaks/unidecoder_data/x7e.yml
118
- lib/lucky_sneaks/unidecoder_data/x7f.yml
119
- lib/lucky_sneaks/unidecoder_data/x80.yml
120
- lib/lucky_sneaks/unidecoder_data/x81.yml
121
- lib/lucky_sneaks/unidecoder_data/x82.yml
122
- lib/lucky_sneaks/unidecoder_data/x83.yml
123
- lib/lucky_sneaks/unidecoder_data/x84.yml
124
- lib/lucky_sneaks/unidecoder_data/x85.yml
125
- lib/lucky_sneaks/unidecoder_data/x86.yml
126
- lib/lucky_sneaks/unidecoder_data/x87.yml
127
- lib/lucky_sneaks/unidecoder_data/x88.yml
128
- lib/lucky_sneaks/unidecoder_data/x89.yml
129
- lib/lucky_sneaks/unidecoder_data/x8a.yml
130
- lib/lucky_sneaks/unidecoder_data/x8b.yml
131
- lib/lucky_sneaks/unidecoder_data/x8c.yml
132
- lib/lucky_sneaks/unidecoder_data/x8d.yml
133
- lib/lucky_sneaks/unidecoder_data/x8e.yml
134
- lib/lucky_sneaks/unidecoder_data/x8f.yml
135
- lib/lucky_sneaks/unidecoder_data/x90.yml
136
- lib/lucky_sneaks/unidecoder_data/x91.yml
137
- lib/lucky_sneaks/unidecoder_data/x92.yml
138
- lib/lucky_sneaks/unidecoder_data/x93.yml
139
- lib/lucky_sneaks/unidecoder_data/x94.yml
140
- lib/lucky_sneaks/unidecoder_data/x95.yml
141
- lib/lucky_sneaks/unidecoder_data/x96.yml
142
- lib/lucky_sneaks/unidecoder_data/x97.yml
143
- lib/lucky_sneaks/unidecoder_data/x98.yml
144
- lib/lucky_sneaks/unidecoder_data/x99.yml
145
- lib/lucky_sneaks/unidecoder_data/x9a.yml
146
- lib/lucky_sneaks/unidecoder_data/x9b.yml
147
- lib/lucky_sneaks/unidecoder_data/x9c.yml
148
- lib/lucky_sneaks/unidecoder_data/x9d.yml
149
- lib/lucky_sneaks/unidecoder_data/x9e.yml
150
- lib/lucky_sneaks/unidecoder_data/x9f.yml
151
- lib/lucky_sneaks/unidecoder_data/xa0.yml
152
- lib/lucky_sneaks/unidecoder_data/xa1.yml
153
- lib/lucky_sneaks/unidecoder_data/xa2.yml
154
- lib/lucky_sneaks/unidecoder_data/xa3.yml
155
- lib/lucky_sneaks/unidecoder_data/xa4.yml
156
- lib/lucky_sneaks/unidecoder_data/xac.yml
157
- lib/lucky_sneaks/unidecoder_data/xad.yml
158
- lib/lucky_sneaks/unidecoder_data/xae.yml
159
- lib/lucky_sneaks/unidecoder_data/xaf.yml
160
- lib/lucky_sneaks/unidecoder_data/xb0.yml
161
- lib/lucky_sneaks/unidecoder_data/xb1.yml
162
- lib/lucky_sneaks/unidecoder_data/xb2.yml
163
- lib/lucky_sneaks/unidecoder_data/xb3.yml
164
- lib/lucky_sneaks/unidecoder_data/xb4.yml
165
- lib/lucky_sneaks/unidecoder_data/xb5.yml
166
- lib/lucky_sneaks/unidecoder_data/xb6.yml
167
- lib/lucky_sneaks/unidecoder_data/xb7.yml
168
- lib/lucky_sneaks/unidecoder_data/xb8.yml
169
- lib/lucky_sneaks/unidecoder_data/xb9.yml
170
- lib/lucky_sneaks/unidecoder_data/xba.yml
171
- lib/lucky_sneaks/unidecoder_data/xbb.yml
172
- lib/lucky_sneaks/unidecoder_data/xbc.yml
173
- lib/lucky_sneaks/unidecoder_data/xbd.yml
174
- lib/lucky_sneaks/unidecoder_data/xbe.yml
175
- lib/lucky_sneaks/unidecoder_data/xbf.yml
176
- lib/lucky_sneaks/unidecoder_data/xc0.yml
177
- lib/lucky_sneaks/unidecoder_data/xc1.yml
178
- lib/lucky_sneaks/unidecoder_data/xc2.yml
179
- lib/lucky_sneaks/unidecoder_data/xc3.yml
180
- lib/lucky_sneaks/unidecoder_data/xc4.yml
181
- lib/lucky_sneaks/unidecoder_data/xc5.yml
182
- lib/lucky_sneaks/unidecoder_data/xc6.yml
183
- lib/lucky_sneaks/unidecoder_data/xc7.yml
184
- lib/lucky_sneaks/unidecoder_data/xc8.yml
185
- lib/lucky_sneaks/unidecoder_data/xc9.yml
186
- lib/lucky_sneaks/unidecoder_data/xca.yml
187
- lib/lucky_sneaks/unidecoder_data/xcb.yml
188
- lib/lucky_sneaks/unidecoder_data/xcc.yml
189
- lib/lucky_sneaks/unidecoder_data/xcd.yml
190
- lib/lucky_sneaks/unidecoder_data/xce.yml
191
- lib/lucky_sneaks/unidecoder_data/xcf.yml
192
- lib/lucky_sneaks/unidecoder_data/xd0.yml
193
- lib/lucky_sneaks/unidecoder_data/xd1.yml
194
- lib/lucky_sneaks/unidecoder_data/xd2.yml
195
- lib/lucky_sneaks/unidecoder_data/xd3.yml
196
- lib/lucky_sneaks/unidecoder_data/xd4.yml
197
- lib/lucky_sneaks/unidecoder_data/xd5.yml
198
- lib/lucky_sneaks/unidecoder_data/xd6.yml
199
- lib/lucky_sneaks/unidecoder_data/xd7.yml
200
- lib/lucky_sneaks/unidecoder_data/xf9.yml
201
- lib/lucky_sneaks/unidecoder_data/xfa.yml
202
- lib/lucky_sneaks/unidecoder_data/xfb.yml
203
- lib/lucky_sneaks/unidecoder_data/xfc.yml
204
- lib/lucky_sneaks/unidecoder_data/xfd.yml
205
- lib/lucky_sneaks/unidecoder_data/xfe.yml
206
- lib/lucky_sneaks/unidecoder_data/xff.yml
24
+ lib/stringex/acts_as_url.rb
25
+ lib/stringex/string_extensions.rb
26
+ lib/stringex/unidecoder.rb
27
+ lib/stringex/unidecoder_data/x00.yml
28
+ lib/stringex/unidecoder_data/x01.yml
29
+ lib/stringex/unidecoder_data/x02.yml
30
+ lib/stringex/unidecoder_data/x03.yml
31
+ lib/stringex/unidecoder_data/x04.yml
32
+ lib/stringex/unidecoder_data/x05.yml
33
+ lib/stringex/unidecoder_data/x06.yml
34
+ lib/stringex/unidecoder_data/x07.yml
35
+ lib/stringex/unidecoder_data/x09.yml
36
+ lib/stringex/unidecoder_data/x0a.yml
37
+ lib/stringex/unidecoder_data/x0b.yml
38
+ lib/stringex/unidecoder_data/x0c.yml
39
+ lib/stringex/unidecoder_data/x0d.yml
40
+ lib/stringex/unidecoder_data/x0e.yml
41
+ lib/stringex/unidecoder_data/x0f.yml
42
+ lib/stringex/unidecoder_data/x10.yml
43
+ lib/stringex/unidecoder_data/x11.yml
44
+ lib/stringex/unidecoder_data/x12.yml
45
+ lib/stringex/unidecoder_data/x13.yml
46
+ lib/stringex/unidecoder_data/x14.yml
47
+ lib/stringex/unidecoder_data/x15.yml
48
+ lib/stringex/unidecoder_data/x16.yml
49
+ lib/stringex/unidecoder_data/x17.yml
50
+ lib/stringex/unidecoder_data/x18.yml
51
+ lib/stringex/unidecoder_data/x1e.yml
52
+ lib/stringex/unidecoder_data/x1f.yml
53
+ lib/stringex/unidecoder_data/x20.yml
54
+ lib/stringex/unidecoder_data/x21.yml
55
+ lib/stringex/unidecoder_data/x22.yml
56
+ lib/stringex/unidecoder_data/x23.yml
57
+ lib/stringex/unidecoder_data/x24.yml
58
+ lib/stringex/unidecoder_data/x25.yml
59
+ lib/stringex/unidecoder_data/x26.yml
60
+ lib/stringex/unidecoder_data/x27.yml
61
+ lib/stringex/unidecoder_data/x28.yml
62
+ lib/stringex/unidecoder_data/x2e.yml
63
+ lib/stringex/unidecoder_data/x2f.yml
64
+ lib/stringex/unidecoder_data/x30.yml
65
+ lib/stringex/unidecoder_data/x31.yml
66
+ lib/stringex/unidecoder_data/x32.yml
67
+ lib/stringex/unidecoder_data/x33.yml
68
+ lib/stringex/unidecoder_data/x4d.yml
69
+ lib/stringex/unidecoder_data/x4e.yml
70
+ lib/stringex/unidecoder_data/x4f.yml
71
+ lib/stringex/unidecoder_data/x50.yml
72
+ lib/stringex/unidecoder_data/x51.yml
73
+ lib/stringex/unidecoder_data/x52.yml
74
+ lib/stringex/unidecoder_data/x53.yml
75
+ lib/stringex/unidecoder_data/x54.yml
76
+ lib/stringex/unidecoder_data/x55.yml
77
+ lib/stringex/unidecoder_data/x56.yml
78
+ lib/stringex/unidecoder_data/x57.yml
79
+ lib/stringex/unidecoder_data/x58.yml
80
+ lib/stringex/unidecoder_data/x59.yml
81
+ lib/stringex/unidecoder_data/x5a.yml
82
+ lib/stringex/unidecoder_data/x5b.yml
83
+ lib/stringex/unidecoder_data/x5c.yml
84
+ lib/stringex/unidecoder_data/x5d.yml
85
+ lib/stringex/unidecoder_data/x5e.yml
86
+ lib/stringex/unidecoder_data/x5f.yml
87
+ lib/stringex/unidecoder_data/x60.yml
88
+ lib/stringex/unidecoder_data/x61.yml
89
+ lib/stringex/unidecoder_data/x62.yml
90
+ lib/stringex/unidecoder_data/x63.yml
91
+ lib/stringex/unidecoder_data/x64.yml
92
+ lib/stringex/unidecoder_data/x65.yml
93
+ lib/stringex/unidecoder_data/x66.yml
94
+ lib/stringex/unidecoder_data/x67.yml
95
+ lib/stringex/unidecoder_data/x68.yml
96
+ lib/stringex/unidecoder_data/x69.yml
97
+ lib/stringex/unidecoder_data/x6a.yml
98
+ lib/stringex/unidecoder_data/x6b.yml
99
+ lib/stringex/unidecoder_data/x6c.yml
100
+ lib/stringex/unidecoder_data/x6d.yml
101
+ lib/stringex/unidecoder_data/x6e.yml
102
+ lib/stringex/unidecoder_data/x6f.yml
103
+ lib/stringex/unidecoder_data/x70.yml
104
+ lib/stringex/unidecoder_data/x71.yml
105
+ lib/stringex/unidecoder_data/x72.yml
106
+ lib/stringex/unidecoder_data/x73.yml
107
+ lib/stringex/unidecoder_data/x74.yml
108
+ lib/stringex/unidecoder_data/x75.yml
109
+ lib/stringex/unidecoder_data/x76.yml
110
+ lib/stringex/unidecoder_data/x77.yml
111
+ lib/stringex/unidecoder_data/x78.yml
112
+ lib/stringex/unidecoder_data/x79.yml
113
+ lib/stringex/unidecoder_data/x7a.yml
114
+ lib/stringex/unidecoder_data/x7b.yml
115
+ lib/stringex/unidecoder_data/x7c.yml
116
+ lib/stringex/unidecoder_data/x7d.yml
117
+ lib/stringex/unidecoder_data/x7e.yml
118
+ lib/stringex/unidecoder_data/x7f.yml
119
+ lib/stringex/unidecoder_data/x80.yml
120
+ lib/stringex/unidecoder_data/x81.yml
121
+ lib/stringex/unidecoder_data/x82.yml
122
+ lib/stringex/unidecoder_data/x83.yml
123
+ lib/stringex/unidecoder_data/x84.yml
124
+ lib/stringex/unidecoder_data/x85.yml
125
+ lib/stringex/unidecoder_data/x86.yml
126
+ lib/stringex/unidecoder_data/x87.yml
127
+ lib/stringex/unidecoder_data/x88.yml
128
+ lib/stringex/unidecoder_data/x89.yml
129
+ lib/stringex/unidecoder_data/x8a.yml
130
+ lib/stringex/unidecoder_data/x8b.yml
131
+ lib/stringex/unidecoder_data/x8c.yml
132
+ lib/stringex/unidecoder_data/x8d.yml
133
+ lib/stringex/unidecoder_data/x8e.yml
134
+ lib/stringex/unidecoder_data/x8f.yml
135
+ lib/stringex/unidecoder_data/x90.yml
136
+ lib/stringex/unidecoder_data/x91.yml
137
+ lib/stringex/unidecoder_data/x92.yml
138
+ lib/stringex/unidecoder_data/x93.yml
139
+ lib/stringex/unidecoder_data/x94.yml
140
+ lib/stringex/unidecoder_data/x95.yml
141
+ lib/stringex/unidecoder_data/x96.yml
142
+ lib/stringex/unidecoder_data/x97.yml
143
+ lib/stringex/unidecoder_data/x98.yml
144
+ lib/stringex/unidecoder_data/x99.yml
145
+ lib/stringex/unidecoder_data/x9a.yml
146
+ lib/stringex/unidecoder_data/x9b.yml
147
+ lib/stringex/unidecoder_data/x9c.yml
148
+ lib/stringex/unidecoder_data/x9d.yml
149
+ lib/stringex/unidecoder_data/x9e.yml
150
+ lib/stringex/unidecoder_data/x9f.yml
151
+ lib/stringex/unidecoder_data/xa0.yml
152
+ lib/stringex/unidecoder_data/xa1.yml
153
+ lib/stringex/unidecoder_data/xa2.yml
154
+ lib/stringex/unidecoder_data/xa3.yml
155
+ lib/stringex/unidecoder_data/xa4.yml
156
+ lib/stringex/unidecoder_data/xac.yml
157
+ lib/stringex/unidecoder_data/xad.yml
158
+ lib/stringex/unidecoder_data/xae.yml
159
+ lib/stringex/unidecoder_data/xaf.yml
160
+ lib/stringex/unidecoder_data/xb0.yml
161
+ lib/stringex/unidecoder_data/xb1.yml
162
+ lib/stringex/unidecoder_data/xb2.yml
163
+ lib/stringex/unidecoder_data/xb3.yml
164
+ lib/stringex/unidecoder_data/xb4.yml
165
+ lib/stringex/unidecoder_data/xb5.yml
166
+ lib/stringex/unidecoder_data/xb6.yml
167
+ lib/stringex/unidecoder_data/xb7.yml
168
+ lib/stringex/unidecoder_data/xb8.yml
169
+ lib/stringex/unidecoder_data/xb9.yml
170
+ lib/stringex/unidecoder_data/xba.yml
171
+ lib/stringex/unidecoder_data/xbb.yml
172
+ lib/stringex/unidecoder_data/xbc.yml
173
+ lib/stringex/unidecoder_data/xbd.yml
174
+ lib/stringex/unidecoder_data/xbe.yml
175
+ lib/stringex/unidecoder_data/xbf.yml
176
+ lib/stringex/unidecoder_data/xc0.yml
177
+ lib/stringex/unidecoder_data/xc1.yml
178
+ lib/stringex/unidecoder_data/xc2.yml
179
+ lib/stringex/unidecoder_data/xc3.yml
180
+ lib/stringex/unidecoder_data/xc4.yml
181
+ lib/stringex/unidecoder_data/xc5.yml
182
+ lib/stringex/unidecoder_data/xc6.yml
183
+ lib/stringex/unidecoder_data/xc7.yml
184
+ lib/stringex/unidecoder_data/xc8.yml
185
+ lib/stringex/unidecoder_data/xc9.yml
186
+ lib/stringex/unidecoder_data/xca.yml
187
+ lib/stringex/unidecoder_data/xcb.yml
188
+ lib/stringex/unidecoder_data/xcc.yml
189
+ lib/stringex/unidecoder_data/xcd.yml
190
+ lib/stringex/unidecoder_data/xce.yml
191
+ lib/stringex/unidecoder_data/xcf.yml
192
+ lib/stringex/unidecoder_data/xd0.yml
193
+ lib/stringex/unidecoder_data/xd1.yml
194
+ lib/stringex/unidecoder_data/xd2.yml
195
+ lib/stringex/unidecoder_data/xd3.yml
196
+ lib/stringex/unidecoder_data/xd4.yml
197
+ lib/stringex/unidecoder_data/xd5.yml
198
+ lib/stringex/unidecoder_data/xd6.yml
199
+ lib/stringex/unidecoder_data/xd7.yml
200
+ lib/stringex/unidecoder_data/xf9.yml
201
+ lib/stringex/unidecoder_data/xfa.yml
202
+ lib/stringex/unidecoder_data/xfb.yml
203
+ lib/stringex/unidecoder_data/xfc.yml
204
+ lib/stringex/unidecoder_data/xfd.yml
205
+ lib/stringex/unidecoder_data/xfe.yml
206
+ lib/stringex/unidecoder_data/xff.yml
207
207
  }
208
208
  gem.test_files = %w{
209
209
  test/acts_as_url_test.rb
@@ -212,7 +212,7 @@ begin
212
212
  }
213
213
  gem.rdoc_options = %w{--main README.rdoc --charset utf-8 --line-numbers}
214
214
  gem.extra_rdoc_files = %w{MIT-LICENSE README.rdoc}
215
- gem.version = "1.3.1"
215
+ gem.version = "1.3.2"
216
216
  end
217
217
 
218
218
  Jeweler::GemcutterTasks.new
@@ -0,0 +1,107 @@
1
+ # encoding: UTF-8
2
+ module Stringex
3
+ module ActsAsUrl # :nodoc:
4
+ def self.included(base)
5
+ base.extend ClassMethods
6
+ end
7
+
8
+ module ClassMethods # :doc:
9
+ # Creates a callback to automatically create an url-friendly representation
10
+ # of the <tt>attribute</tt> argument. Example:
11
+ #
12
+ # act_as_url :title
13
+ #
14
+ # will use the string contents of the <tt>title</tt> attribute
15
+ # to create the permalink. <strong>Note:</strong> you can also use a non-database-backed
16
+ # method to supply the string contents for the permalink. Just use that method's name
17
+ # as the argument as you would an attribute.
18
+ #
19
+ # The default attribute <tt>acts_as_url</tt> uses to save the permalink is <tt>url</tt>
20
+ # but this can be changed in the options hash. Available options are:
21
+ #
22
+ # <tt>:url_attribute</tt>:: The name of the attribute to use for storing the generated url string.
23
+ # Default is <tt>:url</tt>
24
+ # <tt>:scope</tt>:: The name of model attribute to scope unique urls to. There is no default here.
25
+ # <tt>:only_when_blank</tt>:: If true, the url generation will only happen when <tt>:url_attribute</tt> is
26
+ # blank. Default is false (meaning url generation will happen always)
27
+ # <tt>:sync_url</tt>:: If set to true, the url field will be updated when changes are made to the
28
+ # attribute it is based on. Default is false.
29
+ def acts_as_url(attribute, options = {})
30
+ cattr_accessor :attribute_to_urlify
31
+ cattr_accessor :scope_for_url
32
+ cattr_accessor :url_attribute # The attribute on the DB
33
+ cattr_accessor :only_when_blank
34
+ cattr_accessor :duplicate_count_separator
35
+ cattr_accessor :allow_slash
36
+
37
+ if options[:sync_url]
38
+ before_validation(:ensure_unique_url)
39
+ else
40
+ if defined?(ActiveModel::Callbacks)
41
+ before_validation(:ensure_unique_url, :on => :create)
42
+ else
43
+ before_validation_on_create(:ensure_unique_url)
44
+ end
45
+ end
46
+
47
+ self.attribute_to_urlify = attribute
48
+ self.scope_for_url = options[:scope]
49
+ self.url_attribute = options[:url_attribute] || "url"
50
+ self.only_when_blank = options[:only_when_blank] || false
51
+ self.duplicate_count_separator = options[:duplicate_count_separator] || "-"
52
+ self.allow_slash = options[:allow_slash] || false
53
+
54
+ class_eval <<-"END"
55
+ def #{url_attribute}
56
+ if !new_record? && errors[attribute_to_urlify].present?
57
+ self.class.find(id).send(url_attribute)
58
+ else
59
+ read_attribute(url_attribute)
60
+ end
61
+ end
62
+ END
63
+ end
64
+
65
+ # Initialize the url fields for the records that need it. Designed for people who add
66
+ # <tt>acts_as_url</tt> support once there's already development/production data they'd
67
+ # like to keep around.
68
+ #
69
+ # Note: This method can get very expensive, very fast. If you're planning on using this
70
+ # on a large selection, you will get much better results writing your own version with
71
+ # using pagination.
72
+ def initialize_urls
73
+ find(:all, :conditions => {self.url_attribute => nil}).each do |instance|
74
+ instance.send :ensure_unique_url
75
+ instance.save
76
+ end
77
+ end
78
+ end
79
+
80
+ private
81
+
82
+ def ensure_unique_url
83
+ url_attribute = self.class.url_attribute
84
+ separator = self.class.duplicate_count_separator
85
+ base_url = self.send(url_attribute)
86
+ base_url = self.send(self.class.attribute_to_urlify).to_s.to_url(:allow_slash => self.allow_slash) if base_url.blank? || !self.only_when_blank
87
+ conditions = ["#{url_attribute} LIKE ?", base_url+'%']
88
+ unless new_record?
89
+ conditions.first << " and id != ?"
90
+ conditions << id
91
+ end
92
+ if self.class.scope_for_url
93
+ conditions.first << " and #{self.class.scope_for_url} = ?"
94
+ conditions << send(self.class.scope_for_url)
95
+ end
96
+ url_owners = self.class.find(:all, :conditions => conditions)
97
+ write_attribute url_attribute, base_url
98
+ if url_owners.any?{|owner| owner.send(url_attribute) == base_url}
99
+ n = 1
100
+ while url_owners.any?{|owner| owner.send(url_attribute) == "#{base_url}#{separator}#{n}"}
101
+ n = n.succ
102
+ end
103
+ write_attribute url_attribute, "#{base_url}#{separator}#{n}"
104
+ end
105
+ end
106
+ end
107
+ end