flatulent 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/flatulent-0.0.4.gem +0 -0
  2. data/install.rb +210 -0
  3. data/lib/flatulent.rb +76 -61
  4. data/rails/app/controllers/flatulent_controller.rb +6 -4
  5. data/rails/log/development.log +7242 -0
  6. data/rails/tmp/sessions/ruby_sess.82080df62364f531 +0 -0
  7. data/rails/tmp/sessions/ruby_sess.8900d08ad306f253 +0 -0
  8. data/rails/tmp/sessions/ruby_sess.f8fa47c3571d2497 +0 -0
  9. metadata +7 -49
  10. data/flatulent-0.0.2.gem +0 -0
  11. data/rails/lib/flatulent.rb +0 -450
  12. data/rails/lib/flatulent/attributes.rb +0 -79
  13. data/rails/lib/flatulent/crypt/blowfish-tables.rb +0 -190
  14. data/rails/lib/flatulent/crypt/blowfish.rb +0 -109
  15. data/rails/lib/flatulent/crypt/cbc.rb +0 -123
  16. data/rails/lib/flatulent/crypt/gost.rb +0 -140
  17. data/rails/lib/flatulent/crypt/idea.rb +0 -193
  18. data/rails/lib/flatulent/crypt/noise.rb +0 -94
  19. data/rails/lib/flatulent/crypt/purerubystringio.rb +0 -378
  20. data/rails/lib/flatulent/crypt/rijndael-tables.rb +0 -117
  21. data/rails/lib/flatulent/crypt/rijndael.rb +0 -269
  22. data/rails/lib/flatulent/fontfiles/banner.flf +0 -2494
  23. data/rails/lib/flatulent/fontfiles/big.flf +0 -2204
  24. data/rails/lib/flatulent/fontfiles/block.flf +0 -1691
  25. data/rails/lib/flatulent/fontfiles/bubble.flf +0 -1630
  26. data/rails/lib/flatulent/fontfiles/digital.flf +0 -1286
  27. data/rails/lib/flatulent/fontfiles/ivrit.flf +0 -900
  28. data/rails/lib/flatulent/fontfiles/lean.flf +0 -1691
  29. data/rails/lib/flatulent/fontfiles/mini.flf +0 -899
  30. data/rails/lib/flatulent/fontfiles/mnemonic.flf +0 -3702
  31. data/rails/lib/flatulent/fontfiles/script.flf +0 -1493
  32. data/rails/lib/flatulent/fontfiles/shadow.flf +0 -1097
  33. data/rails/lib/flatulent/fontfiles/slant.flf +0 -1295
  34. data/rails/lib/flatulent/fontfiles/small.flf +0 -1097
  35. data/rails/lib/flatulent/fontfiles/smscript.flf +0 -1097
  36. data/rails/lib/flatulent/fontfiles/smshadow.flf +0 -899
  37. data/rails/lib/flatulent/fontfiles/smslant.flf +0 -1097
  38. data/rails/lib/flatulent/fontfiles/standard.flf +0 -2227
  39. data/rails/lib/flatulent/fontfiles/term.flf +0 -600
  40. data/rails/lib/flatulent/pervasives.rb +0 -32
  41. data/rails/lib/flatulent/stringxor.rb +0 -27
  42. data/rails/lib/flatulent/text.rb +0 -6
  43. data/rails/lib/flatulent/text/double_metaphone.rb +0 -356
  44. data/rails/lib/flatulent/text/figlet.rb +0 -17
  45. data/rails/lib/flatulent/text/figlet/font.rb +0 -117
  46. data/rails/lib/flatulent/text/figlet/smusher.rb +0 -64
  47. data/rails/lib/flatulent/text/figlet/typesetter.rb +0 -68
  48. data/rails/lib/flatulent/text/levenshtein.rb +0 -65
  49. data/rails/lib/flatulent/text/metaphone.rb +0 -97
  50. data/rails/lib/flatulent/text/porter_stemming.rb +0 -171
  51. data/rails/lib/flatulent/text/soundex.rb +0 -61
@@ -1,61 +0,0 @@
1
- #
2
- # Ruby implementation of the Soundex algorithm,
3
- # as described by Knuth in volume 3 of The Art of Computer Programming.
4
- #
5
- # Author: Michael Neumann (neumann@s-direktnet.de)
6
- #
7
-
8
- module Text # :nodoc:
9
- module Soundex
10
-
11
- def soundex(str_or_arr)
12
- case str_or_arr
13
- when String
14
- soundex_str(str_or_arr)
15
- when Array
16
- str_or_arr.collect{|ele| soundex_str(ele)}
17
- else
18
- nil
19
- end
20
- end
21
- module_function :soundex
22
-
23
- private
24
-
25
- #
26
- # returns nil if the value couldn't be calculated (empty-string, wrong-character)
27
- # do not change the parameter "str"
28
- #
29
- def soundex_str(str)
30
- return nil if str.empty?
31
-
32
- str = str.upcase
33
- last_code = get_code(str[0,1])
34
- soundex_code = str[0,1]
35
-
36
- for index in 1...(str.size) do
37
- return soundex_code if soundex_code.size == 4
38
-
39
- code = get_code(str[index,1])
40
-
41
- if code == "0" then
42
- last_code = nil
43
- elsif code == nil then
44
- return nil
45
- elsif code != last_code then
46
- soundex_code += code
47
- last_code = code
48
- end
49
- end # for
50
-
51
- return soundex_code + "000"[0,4-soundex_code.size]
52
- end
53
- module_function :soundex_str
54
-
55
- def get_code(char)
56
- char.tr! "AEIOUYWHBPFVCSKGJQXZDTLMNR", "00000000111122222222334556"
57
- end
58
- module_function :get_code
59
-
60
- end # module Soundex
61
- end # module Text